Hello!
I need to compute the shortest path between two nodes such that all node labels on the path are unique. If a shorter path exists, but node labels are repeated, that path should NOT be returned.
The problem is fairly simple to solve if I can match all paths first and then apply conditions, but that is not very efficient. What I want to know is this:
Is there a way to supply conditions to the shortestPath algorithm such that it will only consider paths whose nodes have unique labels?
More generally, is there a way to supply conditions to shortestPath such that it will only consider paths satisfying those conditions?
I can almost use expandConfig
for this, but it can only enforce uniqueness at the node level. What would be neat is an option to change what it means for nodes to be equal... Perhaps I should submit a feature request.