Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
pathTo ignores .withDirection(GraphTraversal.AnyConnected) #62
pathTo and shortestPathTo do not find a path if there is a path going the opposite direction to the edges and .withDirection(GraphTraversal.AnyConnected) is provided.
this behaviour is intentional - sorry for not having documented it explicitely. Here are the reasons:
Examining the Path type you will realize that it contains the inner nodes and, lazily, the inner edges that are on a path of the given graph. The library is designed such that you cannot compose a Path that contains non-existing nodes or edges with respect to the underlying graph. So
To achieve the desired result, you could build an inverse respectively undirected graph prior to calling
More efficienly, a new Path method
Just tell me how to proceed.