Skip to content

Commit

Permalink
fix rank maximal matching algorithm
Browse files Browse the repository at this point in the history
The algorithm previously iterated through the range from the minimum rank to just before the maximum rank, but it now encompasses the full range, including the maximum rank.
  • Loading branch information
oriyalperin authored Oct 24, 2023
1 parent 67c569c commit 1d2af43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion networkz/algorithms/bipartite/rank_maximal_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def rank_maximal_matching(G, rank="rank", top_nodes=None):
M = nx.bipartite.hopcroft_karp_matching(Gi, left)
matching_length = len(M)
free_nodes = find_free_vertices(Gi, M)
for i in range(min_rank, max_rank):
for i in range(min_rank, max_rank+1):
even, odd, unreachable = divide_to_sets(Gi, M.items(), free_nodes)
remove_edges(graph, odd, unreachable, i, rank=rank)
create_Gi(graph, Gi, i + 1, rank=rank)
Expand Down

0 comments on commit 1d2af43

Please sign in to comment.