Skip to content

Terminate bidirectional search when one side is exhausted #105

Closed

Description

@NopMap

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.

Activity

  1. ghost assigned on Sep 4, 2013
  2. karussell commented on Sep 4, 2013

    @karussell
    Member

    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.

  3. NopMap commented on Sep 4, 2013

    @NopMap
    ContributorAuthor

    How can the second side find a way "in" when the first side has not found a way "out"?

  4. karussell commented on Sep 4, 2013

    @karussell
    Member

    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 ...

  5. NopMap commented on Sep 4, 2013

    @NopMap
    ContributorAuthor

    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.

  6. NopMap commented on Sep 5, 2013

    @NopMap
    ContributorAuthor

    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.

  7. added a commit that references this issue on Oct 4, 2013
  8. karussell commented on Nov 12, 2013

    @karussell
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions