Dijkstra: Dijkstra algorithm

Description Usage Arguments Examples

View source: R/Dijkstra.R

Description

Finding the shortest path between nodes in a graph. This algorithm returns the distance and the vertices of the shortest path. It chooses the unvisited vertex with the smallest distance, calculates the distance through it to each unvisited neighbor, and updates the distance to the neighbor if it is smaller.

Usage

1
Dijkstra(graph)

Arguments

graph

represents the coordinates of the vertices 2D between 0 and 1 as well as edges with their weight

Examples

1
2
graph=graph_square(12,4)
Dijkstra(graph)

Faheemah-p/ShortPath documentation built on Feb. 3, 2022, 7:20 p.m.