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
apoc.convert.toTree() returns wrong result if there is a cycle from root of the path #3996
Comments
Thanks for reporting! We'll look into it 🤨 |
Hello! Thank you for writing in :) There were some changes made in 5.18 to this procedure that might change the behaviour (adds rel id into the mix). I am not sure if that is the exact issue you are facing though, but might be worth a try. I am struggling a little bit understanding what the issue is with the list of paths only, can you send me the queries you used for the simple case? e.g a CREATE for the dataset, followed by the actual call to APOC so I know which paths are going in to the results. |
I have shared the list of paths above. If you look at the given paths response, vertex(10) has a cycle, which is also the start/root of the path. While iterating through the list of paths, if you visit this path first:
and after that visit:
then the line will replace the value in the map, so you won't get |
In the path responses below, there is a cycle starting from node(10), which is the root of the path while preparing the tree. This line blindly replaces the map, leading to the issue where few nodes are getting missed in the tree response.
Self-loop also has incorrect response.
Graph:
The text was updated successfully, but these errors were encountered: