ShortestPath | R Documentation |
Calculates the shortest path between two vertices (based on the minimum amount of edges) and calculates its total weight
ShortestPath(obj, node_id1, node_id2, weight = NA, mode = "all")
## S3 method for class 'intensitynet'
ShortestPath(obj, node_id1, node_id2, weight = NA, mode = "all")
obj |
intensitynet object |
node_id1 |
starting node |
node_id2 |
ending node |
weight |
an string, calculate the shortest path based on this type of weight. If no weight type is provided, the function will calculate the shortest path based on the minimum amount of edges. Default NA. |
mode |
Character 'in', 'out', 'all' (default). Gives whether the shortest paths to or from the given vertices should be calculated for directed graphs. If out then the shortest paths from the vertex, if in then to it will be considered. If all, the default, then the corresponding undirected graph will be used, ie. not directed paths are searched. This argument is ignored for undirected graphs. |
total weight of the shortest path and the path vertices with class igraph.vs
data("und_intnet_chicago")
ShortestPath(und_intnet_chicago, node_id1 = 'V1', node_id2 = 'V300', weight = 'intensity')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.