dijkstra: Dijkstra's Algorithm

Description Usage Arguments Details Value Examples

View source: R/dijkstra.R

Description

dijkstra takes a graph and an initial node and calculates the shortest path from the initial node to every other node in the graph.

Usage

1
dijkstra(graph, init_node)

Arguments

graph

Must be a data frame with three variables (v1, v2, w)

init_node

Must be numeric scalar or integer

Details

https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

Value

The shortest path from the initial node to every other node

Examples

1
2

faridmusayev/R_Lab03 documentation built on Dec. 20, 2021, 7:44 a.m.