get_shortest_path: Calculate the shortest path between two nodes on a graph

Description Usage Arguments Value Examples

Description

Calculate the shortest path between two nodes on a graph

Usage

1
get_shortest_path(graphs, start_node, end_node)

Arguments

graphs

list containing the two graphs and a map linking the two to each other.

start_node

Starting node for shortest path route.

end_node

Ending node for shortest path route.

Value

list containing the data.frame of the graph elements the shortest path lies on and the path distance.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
  graph <- road_data_sample
  start_pt <- c (11.603,48.163)
  end_pt <- c (11.608,48.167)
  pts <- select_vertices_by_coordinates (graph, start_pt, end_pt)
  route_start <- pts[1]
  route_end <- pts [2]
  get_shortest_path (graphs = graph, start_node = route_start,
  end_node = route_end)

## End(Not run)

osm-router/osmprob documentation built on May 24, 2019, 4:53 p.m.