dijkstra: Implementation of dijkstra algorithm to find the shortest...

Description Usage Arguments Value References

View source: R/dijkstra.R

Description

This algorithm caculates the shortest distance between initial node and all the other nodes and saves the result into a vector.

Usage

1
dijkstra(graph, init_node)

Arguments

graph

A dataframe with 3 variables v1, v2 and w ie edges of the graph from v1 to v2 with weight w.

init_node

A number which is considered to be the initial point.

Value

The shortest distance from init_node to all other nodes in the graph.

References

https://en.wikipedia.org/wiki/Dijkstra

https://en.wikipedia.org/wiki/Graph#Mathematics


Suhani8884/Lab3A documentation built on Sept. 14, 2020, 12:02 a.m.