You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
graph = tsplib95.load('data/gr17.tsp')
print(graph.get_weight(17, 1)) # IndexError: (17, 1) is out of bonuds
graph = tsplib95.load('data/gr120.tsp')
print(graph.get_weight(120, 1)) # ok
graph = tsplib95.load('data/gr17.tsp')
print(graph.get_weight(16, 0)) # ok
graph = tsplib95.load('data/gr120.tsp')
print(graph.get_weight(119, 0)) # IndexError: (118, -1) is out of bonuds
So inside get_weight() for some graphs (with exactly same edge_weight_type/format etc..) there is NONCONSISTENCY
of what the function does with indexing.
Eg.: for gr120.tsp instance there is implicit -1 for index passed into get_weight() but for gr17/24/48 there is not.
The subtracitng 1 issue I found for 'berlin52.tsp', 'pa561.tsp' and 'gr120'.
Btw there is typo in "raise IndexError(f'({i}, {j}) is out of bonuds" as well.
Also for some problems (eg: si_xxx.tsp) there is flipped 'i' and 'j' in "raise IndexError(f'({i}, {j}) is out of bonuds"
graph = tsplib95.load('data/si535.tsp')
print(graph.get_weight(535, 1)) # IndexError: (1, 535) is out of bonuds
Quite annoying bug tbh.
The text was updated successfully, but these errors were encountered:
So inside get_weight() for some graphs (with exactly same edge_weight_type/format etc..) there is NONCONSISTENCY
of what the function does with indexing.
Eg.: for gr120.tsp instance there is implicit -1 for index passed into get_weight() but for gr17/24/48 there is not.
The subtracitng 1 issue I found for 'berlin52.tsp', 'pa561.tsp' and 'gr120'.
Btw there is typo in "raise IndexError(f'({i}, {j}) is out of bonuds" as well.
Also for some problems (eg: si_xxx.tsp) there is flipped 'i' and 'j' in "raise IndexError(f'({i}, {j}) is out of bonuds"
graph = tsplib95.load('data/si535.tsp')
print(graph.get_weight(535, 1)) # IndexError: (1, 535) is out of bonuds
Quite annoying bug tbh.
The text was updated successfully, but these errors were encountered: