skillfed

Dijkstar

Dijkstra/A*

dijkstar v2.6.0 76.9K downloads/30d#14,573 on PyPI58
Permissive license MIT Active released

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 dijkstar

uv

uv add dijkstar

poetry

poetry add dijkstar

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

dijkstra shortest path algorithmA* pathfinding graphweighted graph traversalsingle-source shortest pathsgraph path findingdijkstra a-star implementation
graph-algorithmspathfinding

More Mathematics packages