dijkstra: Dijkstra Algorithm Returns the shortest path from initial...

Description Usage Arguments Value References Examples

View source: R/Dijikstra.R

Description

Dijkstra Algorithm Returns the shortest path from initial vertex to other vertexes

Usage

1
dijkstra(graph, init_node)

Arguments

graph

A data.frame which consist of 3 vectors named v1, v1 and w and all must have the same length as shown in the example. v1 and v2 represent one edge in the graph, while w holds the distance. Edges must be included twice, from v1 to v2 and the other way round.

init_node

A scalar stating from which vertexes the distances are to be calculated.

Value

Returns a vector consisting of the shortest paths from the node of origin init_node to the rest of the vertexes.

References

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

Examples

1
2

muh-faizan-khalid/euclidspackage documentation built on Nov. 11, 2019, 1:18 a.m.