Skip to content

Commit

Permalink
check cons in UC system and vars in OC system
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbybp committed Nov 4, 2024
1 parent 46b1c70 commit 81313f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyomo/contrib/incidence_analysis/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ def minimum_weight_maximum_matching(self, variables=None, constraints=None):
c_wc_nodes = list(range(len(c_wc)))

nxb = nx.algorithms.bipartite
if v_uc_nodes:
if c_uc_nodes:
# NOTE: This gives an obnoxious FutureWarning about a future change to a
# sparse matrix return value despite the fact that I'm using format=coo.
# (This should go away when I update to NetworkX 3.0, though)
Expand All @@ -707,7 +707,7 @@ def minimum_weight_maximum_matching(self, variables=None, constraints=None):
# when given an empty graph...
uc_matching = []

if c_oc_nodes:
if v_oc_nodes:
m_oc = nxb.biadjacency_matrix(g_oc, row_order=c_oc_nodes, column_order=v_oc_nodes, format="coo")
oc_row, oc_col = sp.sparse.csgraph.min_weight_full_bipartite_matching(m_oc)
oc_matching = [(c_oc[i], v_oc[j]) for i, j in zip(oc_row, oc_col)]
Expand Down

0 comments on commit 81313f5

Please sign in to comment.