Description Usage Arguments Examples
This Dijkstra implementation solves the Shortest Path Problem (SPP), requiring an adjacency matrix and a source node to be supplied, creating an object of class Dijkstra with the solution stored within, this can the be accessed by printing the object or plotting it, for the raw solution data use the class method getPrev().
The graph class has the following class methods:
getAdjMatrix() - Returns the adjacency matrix supplied to the algorithm.
getDist() - Returns the matrix of distances from the source to each node at each iteration.
getPrev() - Returns the matrix of previous nodes for every node at each iteration.
1 |
adjMatrix |
The ajacency matrix representing the graph to be solved, instead of a matrix the graph class can be supplied, and the adjacency matrix will be extracted. |
sourceNode |
The source node, corresponds to the node's row in the matrix supplied. Default is 1. |
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.