hagberg / planarity

Planar graph algorithms
Other
39 stars 11 forks source link

Test failing #12

Closed Thomasb81 closed 1 year ago

Thomasb81 commented 1 year ago

At my end following test is failing :

https://github.com/hagberg/planarity/blob/f331ae09d033ada5d4ebddf335acce69497a39f4/planarity/tests/test_planarity_networkx.py#L60

The test infrastructure report that the 2 lists of edge are different :

          [(0, 1), (0, 2), (0, 3), (0, 4), (2, 1), (2, 4), (3, 1), (3, 2), (3, 4), (4, 1)]
          [(0, 1), (0, 2), (0, 3), (0, 4), (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)]

The first diff occur at index 4 : (2,1) vs (1,2) while the 2 tuples represent the same edge : the order in which vertex are listed has no importance in this context.

What seems to work is : assert_equal( frozenset(frozenset(x) for x in G.edges()) , frozenset(frozenset(x) for x in K.edges()) )

hagberg commented 1 year ago

Agree - seems like a good suggestion for a fix.