Dijkstar
Dijkstra/A*
What it is and what it does
Dijkstar is a graph pathfinding library that implements Dijkstra's algorithm for finding shortest paths between nodes in a weighted graph. It can operate in single-destination mode (halting when a target is reached) or compute paths from a source to all reachable nodes. The library supports optional cost functions to compute edge weights dynamically during traversal and optional heuristic functions to convert the algorithm to A* search, steering it toward a destination rather than exploring uniformly.
The package provides a simple Graph class for building networks by adding weighted edges, and a find_path function that returns path information including the sequence of nodes, individual edge costs, and total cost. It also supports graph serialization via pickle for saving and loading. With only six as a runtime dependency and low install friction, it integrates easily into projects needing graph algorithms.
Use it for:
- Route planning in navigation systems or street networks with dynamic cost adjustments for street names or traffic conditions
- Game pathfinding using A* heuristics to find efficient paths for NPCs or agents toward goals
- Network routing or resource allocation problems where you need optimal paths between nodes with weighted connections
- Analyzing connectivity in social networks or knowledge graphs to find shortest relationship chains
- Robotics motion planning to compute efficient paths through obstacle-aware weighted environments
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Dijkstar implements Dijkstra's shortest-path algorithm and A* search, finding optimal paths in weighted graphs with optional cost and heuristic functions.
Yes. Dijkstar is a mature, actively maintained implementation of a foundational algorithm with no known vulnerabilities, permissive licensing, and minimal dependencies. Install it if you need Dijkstra or A* pathfinding in a graph. The last release was 2021-03-30; verify that Python version support meets your requirements before adopting.
Install
dijkstar on PyPI
pip
pip install dijkstaruv
uv add dijkstarpoetry
poetry add dijkstarInstalling Dijkstar
Before you install
Low friction install with a single lightweight dependency (six). The package is actively maintained with recent commits and has been stable since its early releases.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations.
Quickstart
from dijkstar import Graph, find_path
graph = Graph()
graph.add_edge(1, 2, 110)
graph.add_edge(2, 3, 125)
graph.add_edge(3, 4, 108)
result = find_path(graph, 1, 4)
print(result.total_cost)
Verify before relying
- Whether the package supports modern Python versions beyond 3.9 (classifiers list ends there; last release was 2021-03-30)
- Performance characteristics or scalability limits for large graphs
- Whether heuristic function API is documented for A* use cases
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | actively maintained — 1,963 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 76,948/month — #14,573 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Dijkstar-2.6.0-py3-none-any.whl
Keywords: Dijkstra, A*, algorithms
Tags
More Mathematics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
kiwisolverkiwisolver is a Python binding to a fast C++…
permissive · top 1,000 on PyPI
sympySymPy is a Python library for symbolic…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
onnxruntimeonnxruntime loads and executes Open Neural…
permissive · top 1,000 on PyPI
minorminerminorminer finds graph minor embeddings—it maps…
unclear · top 15,000 on PyPI
searouteComputes the shortest sea route between two…
permissive · top 15,000 on PyPI
altgraphaltgraph constructs and analyzes graphs…
permissive · top 5,000 on PyPI
toposortImplements topological sorting of directed…
permissive · top 5,000 on PyPI
objectgraphObjectgraph provides a Python class for…
permissive · top 15,000 on PyPI
munkresImplements the Munkres algorithm (Hungarian…
permissive · top 15,000 on PyPI
grandalfGrandalf computes node coordinates and routes…
copyleft · top 5,000 on PyPI
HeapDictHeapDict is a mutable mapping that acts as a…
permissive · top 15,000 on PyPI
roundrobinProvides four round-robin selection algorithms:…
permissive · top 15,000 on PyPI