-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing single-edge paths between two junctions #147
Comments
I think that the condition
I think that changing the "visited" variable from a node-based cache to an edge-based (bidirectional) cache would fix the problem, since it's not nodes that we don't want to visit twice, but edges. |
@ssavary This is now fixed on main! 🎉 Thank you very much for the report and for the analysis — it was spot on! I'd gone through so many hoops with off-by-one errors because I was looking at nodes rather than edges! 🤦 😂 One of those seemingly small conceptual changes that make everything clearer! 😊 |
Some paths consisting of only 2 nodes are missing in Skeleton.paths_list(), depending on the order the nodes ares visited.
Here is a simple script that shows the problem, with a simple (10,10) skeleton and its rotated version. The path list for figure 1 is
[[1, 2, 3],
[3, 4, 5, 6, 7, 8, 9],
[3, 10, 11],
[11, 12, 13, 14],
[11, 17],
[15, 16, 17],
[17, 18, 19, 20, 21]]
and the path list for the graph of figure 2 is:
[[1, 3, 5],
[2, 4, 8],
[5, 6, 7],
[5, 13, 15, 17, 19, 20, 21],
[7, 14, 16, 18],
[8, 9, 10, 11, 12]]
In the first figure, path (11,17) is found, but the equivalent path (7,8) was not found in figure 2.
Here is the script that was used to generate this example.
The text was updated successfully, but these errors were encountered: