Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

duplicate node in match? #2

Closed
hstern2 opened this issue Dec 27, 2021 · 1 comment
Closed

duplicate node in match? #2

hstern2 opened this issue Dec 27, 2021 · 1 comment

Comments

@hstern2
Copy link

hstern2 commented Dec 27, 2021

from max_matching import Match
unique_edges = [(0, 1), (0, 14), (1, 2), (2, 15), (2, 3), (3, 4), (4, 27), (5, 6), (5, 26), (6, 7), (7, 25), (7, 8), (8, 9), (9, 24), (9, 10), (10, 11), (12, 13), (12, 16), (13, 14), (14, 15), (16, 17), (18, 19), (18, 21), (19, 20), (21, 22), (22, 23), (24, 25), (26, 27)]
edges = unique_edges + [(j,i) for i,j in unique_edges]
match = Match.from_edges(28, edges)
match.maximum_matching()
for n in match.nodes:
if n.mate is not None:
i = n.index
j = n.mate.index
if i < j:
print(i,j)

9 is duplicated

#0 14
#2 3
#4 27
#5 26
#6 7
#8 9
#9 24
#10 11
#12 13
#16 17
#18 21
#19 20
#22 23

@Yorkyer
Copy link
Owner

Yorkyer commented Jan 18, 2022

Hi, the bug is fixed. Thank you for reporting this.

Outcome:

0 1
2 3
4 27
5 26
6 7
8 9
10 11
12 13
14 15
16 17
18 21
19 20
22 23
24 25

@Yorkyer Yorkyer closed this as completed Jan 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants