dijkstra: Dijkstra

Description Usage Arguments Value References

View source: R/dijkstra.R

Description

Implementation of Djikstra's algorithm to find the shortest path to all nodes from an initial node using an adjacency matrix

Usage

1
dijkstra(graph, init_node)

Arguments

graph

A data frame with three variables that contain same-sized vectors describing nodes, edges and wieghts of a graph

init_node

The node from which the shortest distance to all other nodes is calculated

Value

A vector of the distances from init_node to all other nodes

References

https://en.wikipedia.org/wiki/Dijkstras_algorithm and https://www.youtube.com/watch?v=Ww4nU_NcAIQ


senseiyukisan/732A94 documentation built on Sept. 18, 2020, 12:56 p.m.