Algorithm Deikstra on C#. Finding the shortest path in a graph.
- Clone this repo:
$ git clone https://github.com/the-shichko/deikstra-sharp- Declare object Deikstra
var deikstra = new Deikstra();- Declare adjacency matrix in object
deikstra.Matrix = new decimal[4, 4]
{
{ 0, 2, 5, 3 },
{ 3, 0, 5, 2 },
{ 3, 0, 0, 4 },
{ 3, 0, 0, 0 },
};- Start algorithm
Parameter - the number of the vertex from which to find the paths [0, size of matrix - 1]
var result = deikstra.Start(0);- Result of method is array of weights