PHPackages                             bmichotte/dijkstra - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bmichotte/dijkstra

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bmichotte/dijkstra
==================

php 7+ implementation of the Dijkstra algorithm

1.0.2(6y ago)131.5k3MITPHPPHP ^7.1

Since Feb 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bmichotte/dijkstra)[ Packagist](https://packagist.org/packages/bmichotte/dijkstra)[ Docs](https://github.com/bmichotte/dijkstra)[ RSS](/packages/bmichotte-dijkstra/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (2)Versions (7)Used By (0)

Dijkstra algorithm implementation
=================================

[](#dijkstra-algorithm-implementation)

[![Build Status](https://camo.githubusercontent.com/a3c5c5bd5d67f89f5f423d8d5bfa729057e0ee8378955f70aed576edefbc4806/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f626d6963686f7474652f64696a6b737472612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/bmichotte/dijkstra)[![Quality Score](https://camo.githubusercontent.com/935bfdf75eec7fde9d9be9e24d0a62b7413ad8ebf19c0d83ba8b9ebcf4b45d71/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f626d6963686f7474652f64696a6b737472612e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bmichotte/dijkstra)[![Code Coverage](https://camo.githubusercontent.com/285a2583c2d12f15003aacea4c7607e64e27705007add412a610604b049b59dc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f626d6963686f7474652f64696a6b737472612f6261646765732f636f7665726167652e706e673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bmichotte/dijkstra)[![StyleCI](https://camo.githubusercontent.com/6b3f4cf15dcf9cd2043f6a1067f0ba78b8d116f415499c524fd66ee244a31a99/68747470733a2f2f7374796c6563692e696f2f7265706f732f333234353332312f736869656c64)](https://styleci.io/repos/3245321)[![Github Action](https://github.com/bmichotte/dijkstra/workflows/CI/badge.svg)](https://github.com/bmichotte/dijkstra/actions)

More on the algorithm : [https://en.wikipedia.org/wiki/Dijkstra%27s\_algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm)

You can find an example on the `example` directory. The result of this example should be something like [![shortest paths](https://github.com/bmichotte/dijkstra/raw/master/example/image.png)](https://github.com/bmichotte/dijkstra/blob/master/example/image.png)

Installation
------------

[](#installation)

Run `composer require bmichotte/dijkstra`

Usage
-----

[](#usage)

```
// create some points
$point1 = new \Bmichotte\Dijkstra\Point(/* x */ 1, /* y */ 1);
$point2 = new \Bmichotte\Dijkstra\Point(2, 2);
$point3 = new \Bmichotte\Dijkstra\Point(3, 3);

$all_points = [$point1, $point2, $point3];

// "join" them
$point1->addPoint($point2);
$point1->addPoint($point3);
$point2->addPoint($point3);

// find the shortest path
$dijkstra = new \Bmichotte\Dijkstra\Dijkstra($all_points, /* from */ $point1, /* to */ $point3);
$shortest_path = $dijkstra->findShortestPath();

// $shortest_path[0] == $point1
// $shortest_path[1] == $point3
```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 85.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~70 days

Total

3

Last Release

2538d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.0.1PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc880297750e1361794afe95cf2908c998413cf549db79bdcfff19e60e2eb007?d=identicon)[bmichotte](/maintainers/bmichotte)

---

Top Contributors

[![bmichotte](https://avatars.githubusercontent.com/u/235510?v=4)](https://github.com/bmichotte "bmichotte (29 commits)")[![PapsOu](https://avatars.githubusercontent.com/u/5792207?v=4)](https://github.com/PapsOu "PapsOu (5 commits)")

---

Tags

dijkstra

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bmichotte-dijkstra/health.svg)

```
[![Health](https://phpackages.com/badges/bmichotte-dijkstra/health.svg)](https://phpackages.com/packages/bmichotte-dijkstra)
```

###  Alternatives

[graphp/algorithms

Common mathematical graph algorithms implemented in PHP

1392.9M14](/packages/graphp-algorithms)[fisharebest/algorithm

Implementation of standard algorithms in PHP.

71102.3k2](/packages/fisharebest-algorithm)[letournel/path-finder

Path finder algorithm

142.0k](/packages/letournel-path-finder)[xobotyi/basen

Text and integers encoding utilities for PHP with no extensions dependencies. Base32, Base58, Base64 and much more!

1220.1k](/packages/xobotyi-basen)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
