Skip to main content

Dijkstra/A* path finding functions

Project description

Dijkstar is an implementation of Dijkstra’s single-source shortest-paths algorithm. If a destination node is given, the algorithm halts when that node is reached; otherwise it continues until paths from the source node to all other nodes are found.

Accepts an optional cost (or “weight”) function that will be called on every iteration.

Also accepts an optional heuristic function that is used to push the algorithm toward a destination instead of fanning out in every direction. Using such a heuristic function converts Dijkstra to A* (and this is where the name “Dijkstar” comes from).

Performance is decent on a graph with 100,000+ nodes. Runs in around .5 seconds on average .

See the source for the required graph structure:

https://bitbucket.org/wyatt/dijkstar/src/tip/dijkstar/__init__.py?at=Dijkstar#cl-36

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Dijkstar-1.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page