Description Usage Arguments Value See Also Examples
dijkstra
finds the shortest distance from a given node in a graph to
every other node in the graph, and returns a vector of these distances in the
same order as the nodes.
Pseudocode for this function taken from the Wikipedia page for Dijkstra
Algorithm.
1 | dijkstra(graph, init_node)
|
graph |
A data frame with three variables (v1, v2 and w) that contains the edges of the graph (from v1 to v2) with the weight of the edge (w). |
init_node |
A node in the graph whose distance is to be found from every other node of the graph. |
A vector having the same length as the number of nodes in the
graph, containing the distances of the init_node
from every other
node in the graph, in the same order as the order of the nodes.
https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
1 | dijkstra(wiki_graph, 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.