You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminate bidirectional search when one side is exhausted #105
When one side of a bidirectional search has exhausted all reachable nodes, the search can be terminated because there is no connection between the points.
Current implementation continuous the search on the other side, which will always fail after excessive resource consumption or a server crash.
For CH both sides must continue as they may see different levels.
Hmmh, this is not easy when I'm thinking about it more. Just saying "stop search for other side because I've no more points" is probably not enough. Because indeed the other search could require just some more iterations until they finally reach some meeting area.
Also I would like to implement a threaded solution at a later time where this stopping criteria will fail.
Probably for the stopping criteria we need the still running branch (call it B) has to look at the maximum nodes the stopped (and unreachable) branch A has visited.
I mean, we cannot immediately stop branch B from searching. We need to give him some more iterations to investigate at least the same visited nodes as branch A.
I'm still thinking about it :) ... probably you're right ...
Still don't think there is a problem. If branch A has stopped it is in a closed subnet, otherwise it would still be evaluation less probable solutions. So B has no chance of ever hitting a node of A.
Fixed it locally. The effect is drastic as most subnetworks are rather small and quickly exhausted. In my testcase time was reduced from ~39000ms to 4ms.
This is now on master. See AbstractBidirAlgo and e.g. DijkstraBidirectionRef where fillEdgesFrom or fillEdgesTo returns false if there are no more nodes to investigate. And finish will return true if one of the search spaces is finished.
Activity
karussell commentedon Sep 4, 2013
Hmmh, this is not easy when I'm thinking about it more. Just saying "stop search for other side because I've no more points" is probably not enough. Because indeed the other search could require just some more iterations until they finally reach some meeting area.
Also I would like to implement a threaded solution at a later time where this stopping criteria will fail.
Probably for the stopping criteria we need the still running branch (call it B) has to look at the maximum nodes the stopped (and unreachable) branch A has visited.
NopMap commentedon Sep 4, 2013
How can the second side find a way "in" when the first side has not found a way "out"?
karussell commentedon Sep 4, 2013
I mean, we cannot immediately stop branch B from searching. We need to give him some more iterations to investigate at least the same visited nodes as branch A.
I'm still thinking about it :) ... probably you're right ...
NopMap commentedon Sep 4, 2013
Still don't think there is a problem. If branch A has stopped it is in a closed subnet, otherwise it would still be evaluation less probable solutions. So B has no chance of ever hitting a node of A.
NopMap commentedon Sep 5, 2013
Fixed it locally. The effect is drastic as most subnetworks are rather small and quickly exhausted. In my testcase time was reduced from ~39000ms to 4ms.
more common methods for (bidir) algos; towards #27 -> new method taki…
karussell commentedon Nov 12, 2013
This is now on master. See
AbstractBidirAlgoand e.g.DijkstraBidirectionRefwherefillEdgesFromorfillEdgesToreturns false if there are no more nodes to investigate. Andfinishwill return true if one of the search spaces is finished.