A graph collection with Dijkstra algorithm for C#
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
GraphCollection.Tests
GraphCollection
packages
.gitattributes
.gitignore
.travis.yml
GraphCollection.sln
LICENSE
README.md

README.md

GraphCollection

Build Status

Completely re-written to be simpler and hopefully increase performance. Currently only supports bi-directional nodes.

##Example usage
How to graph the example on wikipedia

    var one = new GraphNode<int>(1);
    var two = new GraphNode<int>(2);
    var three = new GraphNode<int>(3);
    var four = new GraphNode<int>(4);
    var five = new GraphNode<int>(5);
    var six = new GraphNode<int>(6);
    
    one.AddNeighbour(six, 14);
    one.AddNeighbour(three, 9);
    one.AddNeighbour(two, 7);
    
    two.AddNeighbour(three, 10);
    two.AddNeighbour(four, 15);
    
    three.AddNeighbour(six, 2);
    three.AddNeighbour(four, 11);
    
    four.AddNeighbour(five, 6);
    
    five.AddNeighbour(six, 9);
    
    var graph = new List<GraphNode<int>> {one, two, three, four, five, six};
    
    var dijkstra = new Dijkstra<int>(graph);
    var path = dijkstra.FindShortestPathBetween(one, five);

Special thanks to Ikegami Atsuko http://cleo.ci.seikei.ac.jp/~atsuko/

Please visit my blog at http://www.arakawa.asia