All Projects → RyanCarrier → Dijkstra

RyanCarrier / Dijkstra

Licence: mit
Fastest golang Dijkstra path finder

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Dijkstra

Pathfinding
Pathfinding library for rust
Stars: ✭ 324 (+202.8%)
Mutual labels:  graph, pathfinding, dijkstra
Pathfinding
Visual explanation of pathfinding algorithms and how a*, Dijkstra and BFS can be seen as the same algorithm with different parameter/data structures used under the hood
Stars: ✭ 165 (+54.21%)
Mutual labels:  pathfinding, dijkstra
Java Ds Algorithms
Data Structures and Algorithms in Java
Stars: ✭ 125 (+16.82%)
Mutual labels:  graph, dijkstra
Pathfinder.vim
Vim plugin to suggest better movements
Stars: ✭ 228 (+113.08%)
Mutual labels:  pathfinding, dijkstra
Data Structures
Common data structures and algorithms implemented in JavaScript
Stars: ✭ 139 (+29.91%)
Mutual labels:  graph, dijkstra
pathfinding-visualizer
Website built using React Framework for visualizing Pathfinding and Maze Generation Algorithms.
Stars: ✭ 33 (-69.16%)
Mutual labels:  pathfinding, dijkstra
Pathfinder
A pathfinder visualizer in Flutter. Create mazes, generate random walls, or draw your own walls and see the pathfinding algorithms in action
Stars: ✭ 14 (-86.92%)
Mutual labels:  pathfinding, dijkstra
unity-dijkstras-pathfinding
Dijkstra's Pathfinding Algorithm Unity Implementation. (Not being maintained by me, it is just an experiment.)
Stars: ✭ 80 (-25.23%)
Mutual labels:  pathfinding, dijkstra
Graphhopper
Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.
Stars: ✭ 3,457 (+3130.84%)
Mutual labels:  pathfinding, dijkstra
Laravel Tracer
Shows the path of each blade file loaded in a template
Stars: ✭ 96 (-10.28%)
Mutual labels:  pathfinding
Sdf Ui
WebGL node editor for Signed Distance Functions
Stars: ✭ 101 (-5.61%)
Mutual labels:  graph
Doge
Darknet Osint Graph Explorer
Stars: ✭ 93 (-13.08%)
Mutual labels:  graph
Highcharts Chart
Polymer Element wrapper for highcharts library. Seamlessly create various types of charts from one element.
Stars: ✭ 97 (-9.35%)
Mutual labels:  graph
Grawkit
The Awksome Git Graph Generator
Stars: ✭ 101 (-5.61%)
Mutual labels:  graph
Ai Study
人工智能学习资料超全整理,包含机器学习基础ML、深度学习基础DL、计算机视觉CV、自然语言处理NLP、推荐系统、语音识别、图神经网路、算法工程师面试题
Stars: ✭ 93 (-13.08%)
Mutual labels:  graph
Sortinganimation
A visual representation for sorting algorithms
Stars: ✭ 105 (-1.87%)
Mutual labels:  graph
Aws Securitygroup Grapher
This ansible role gets information from an AWS VPC and generate a graphical representation of security groups
Stars: ✭ 93 (-13.08%)
Mutual labels:  graph
Tinkerpop
Apache TinkerPop - a graph computing framework
Stars: ✭ 1,309 (+1123.36%)
Mutual labels:  graph
Rdflib
RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
Stars: ✭ 1,584 (+1380.37%)
Mutual labels:  graph
Erdos
modular and modern graph-theory algorithms framework in Java
Stars: ✭ 104 (-2.8%)
Mutual labels:  dijkstra

dijkstra

Golangs fastest Dijkstra's shortest (and longest) path calculator, requires go 1.6 or above (for benchmarking).

Need for speed

Benchmark comparisons to the other two top golang dijkstra implementations;

go test -bench .

Wow so fast Wow the multiply!

Speed benefit use to diminish due to linked lists sucking at high nodes in queue for checking. Since adding a priority queue (or linked list for small nodes), the benefits get even stronger.

Priority queues are used for nodes over 800, to gain this big increase in spead (about x15), it means there is some added overhead to initializing. Oddly this shouldn't be an issue at 16-256 nodes, but both still seem to take a significant performance hit.

Documentation

godoc

How to

Generate a graph

Importing from file

The package can import dijkstra files in the format:

0 1,1 2,1
1 0,1 2,2
2

using;

graph, err := dijkstra.Import("path/to/file")

i.e. node then each arc and it's weight. The default is to use nodes with numbers starting from 0, but the package will map string appropriately.

Creating a graph

package main

func main(){
  graph:=dijkstra.NewGraph()
  //Add the 3 verticies
  graph.AddVertex(0)
  graph.AddVertex(1)
  graph.AddVertex(2)
  //Add the arcs
  graph.AddArc(0,1,1)
  graph.AddArc(0,2,1)
  graph.AddArc(1,0,1)
  graph.AddArc(1,2,2)
}

Finding paths

Once the graph is created, shortest or longest paths between two points can be generated.


best, err := graph.Shortest(0,2)
if err!=nil{
  log.Fatal(err)
}
fmt.Println("Shortest distance ", best.Distance, " following path ", best.Path)

best, err := graph.Longest(0,2)
if err!=nil{
  log.Fatal(err)
}
fmt.Println("Longest distance ", best.Distance, " following path ", best.Path)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].