View source: R/shortest_path.R
| shortest_path | R Documentation |
Calculates shortest route based on distance or any other metric (e.g. time) that you can specify using column name.
shortest_path(graph, from_node, to_node, weight = NULL)
graph |
tbl_graph object |
from_node |
node ID for starting point |
to_node |
vector of node IDs for end points |
weigth |
optional. Which weight to use for optimization. Defaults to using the distance as weight (i.e. shortest path using distance). |
igraph.es object with the optimal route
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.