dijkstra
Version, currently 0.2.06 versions
github.com/geocrystal/dijkstra
Dijkstra's algorithm using a priority queue in Crystal
14 stars
0 dependents
License: MIT
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
dijkstra:
github: geocrystal/dijkstra
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# dijkstra
[](https://github.com/geocrystal/dijkstra/actions/workflows/crystal.yml)
[](https://github.com/geocrystal/dijkstra/blob/master/LICENSE)
Dijkstra's algorithm using a priority queue in Crystal.
[Dijkstra's algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) is an algorithm for finding the shortest paths between nodes in a graph, which may represent, for example, road networks.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
dijkstra:
github: geocrystal/dijkstra
```
2. Run `shards install`
## Usage

```crystal
require "dijkstra"
gr = Dijkstra::Graph(Char).new(directed: true)
gr.add_edge('a', 'b', 7)
gr.add_edge('a', 'c', 9)
gr.add_edge('a', 'f', 14)
gr.add_edge('b', 'c', 10)
gr.add_edge('b', 'd', 15)
gr.add_edge('c', 'd', 11)
gr.add_edge('c', 'f', 2)
gr.add_edge('d', 'e', 6)
gr.add_edge('e', 'f', 9)
gr.shortest_path('a', 'e')
# => {26, ['a', 'c', 'd', 'e']}
# Directed : a -> c(9) -> d(20) -> e(26)
# Undirected : a -> c(9) -> f(11) -> e(20)
```
## Contributing
1. Fork it (<https://github.com/geocrystal/dijkstra/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Jun 22, 2026
- Commit
6a2edf55c9cb- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/geocrystal/dijkstra
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 6