Skip to content

try speed up in dijkstra #26

Closed
Closed

Description

@karussell

suggested by @orangeman:

Instead of the visited boolean array/set we could try to introduce a boolean flag in EdgeEntry and see if this is faster (if we avoid the visit.contains check + rely entirely on the map.get check)

Activity

  1. agouge commented on Mar 20, 2013

    @agouge

    My "naive" implementation of Dijkstra seems to be faster than the current GH implementation over several iterations.

  2. karussell commented on Mar 20, 2013

    @karussell
    MemberAuthor

    Cool, what is the difference from a bird's eye view :) ?

  3. karussell commented on Apr 8, 2013

    @karussell
    MemberAuthor

    Explanation: we don't need the "visited" BitSet at all. The map<node, EdgeEntry> makes sure only the best path will be extracted. This means a minor disadvantage: some more distances for already visited nodes are calculated. But we don't see this slowing down in my simple performance analysis (e.g. the simple dijkstra is even faster)!

    A BitSet is problematic as it is not clear how large it should be at the beginning of an algorithm and in the worst case it will have the length with the number of nodes. If we should ever need the "visited" check again we should add an EdgeEntry.visited flag instead.

  4. added a commit that references this issue on Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions