Invalid handle exception in call to AStarShortestPath.getPath

132 Views Asked by At

In the execution of the getPath method of AStarShortestPath I am getting exceptions new IllegalArgumentException("Invalid handle!");

In the graph that is originally created, I added some cold shortcuts by adding segments between every 16th node on what in my model is a kind of long straight road.

It is at the moment not easy to create a small sample code here that would reproduce the problem. Stack trace:

org.jheaps.tree.PairingHeap.decreaseKey(PairingHeap.java:425)
org.jheaps.tree.PairingHeap.access$000(PairingHeap.java:89)
org.jheaps.tree.PairingHeap$Node.decreaseKey(PairingHeap.java:363)
org.jgrapht.alg.shortestpath.AStarShortestPath.expandNode(AStarShortestPath.java:224)

But first of all my question is if somebody else saw this exception and if what the solution was in that case.

I am using version 1.4.0 of JGraphT

Update: I may have found the problem: there were edges with very small differences in weight. The difference dipped below the tolerance of the ToleranceDoubleComparator: DEFAULT_EPSILON = 1e-9

This made the sorting unpredictable, leading to the error.

0

There are 0 best solutions below