dijkstra: Dijkstra's Algorithm

Description Usage Arguments Value Examples

View source: R/dijkstra.R

Description

dijkstra calculates the geodesics from the source node to all other nodes in the graph

Usage

1
dijkstra(A.mat, src)

Arguments

A.mat

An n x n adjacency matrix.

src

A positive integer from 1 to n indicating the start node index

Value

Returns a list of dist and paths

Examples

1
2
A.mat = sim_adjacency(10, weight = c(1, 5))
dijkstra(A.mat, src = 1)

lwa19/centrality documentation built on Dec. 21, 2021, 12:45 p.m.