Skip to content

Commit

Permalink
update edge weights to be negative coefficient magnitude
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbybp committed Nov 16, 2024
1 parent 31b88b0 commit 9b6dc92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyomo/contrib/incidence_analysis/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def get_bipartite_incidence_graph(
# Weight is "logarithmic distance from 1". TODO: Make this more
# modular so we can specify other weights.
# NOTE: Assuming coefs are not None, i.e. everything is linear
weight = abs(math.log(abs(info["coef"])))
#weight = abs(math.log(abs(info["coef"])))
#
# Now weights are "negative magnitude". In this way, min weight will
# choose maximum magnitudes
weight = -abs(info["coef"])
if var in var_node_map:
graph.add_edge(i, var_node_map[var], weight=weight)
else:
Expand Down

0 comments on commit 9b6dc92

Please sign in to comment.