shortest_path: Calculate shortest path

View source: R/shortest_path.R

shortest_pathR Documentation

Calculate shortest path

Description

Calculates shortest route based on distance or any other metric (e.g. time) that you can specify using column name.

Usage

shortest_path(graph, from_node, to_node, weight = NULL)

Arguments

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).

Value

igraph.es object with the optimal route


kjetilhaukas/shortestpath documentation built on April 28, 2022, 12:06 a.m.