Optimization: principles and algorithms, by Michel Bierlaire
Functions
dijkstra.m File Reference

Algorithm 23.2: Dijkstra. More...

Go to the source code of this file.

Functions

function dijkstra (in adj, in cost, in orig, in printlevel)
 Calculate the shortest paths from one origin to all nodes using Dijkstra's algorithm. More...
 

Detailed Description

Algorithm 23.2: Dijkstra.

Implementation of algorithm 23.2 of [1]

Note
Tested with runDijkstra.m
Calls prepareNetwork
Author
Michel Bierlaire
Date
Wed Thu Apr 9 17:22:28 2015

Definition in file dijkstra.m.

Function Documentation

◆ dijkstra()

function dijkstra ( in  adj,
in  cost,
in  orig,
in  printlevel 
)

Calculate the shortest paths from one origin to all nodes using Dijkstra's algorithm.

Parameters
adjadjacency matrix of the network. Each nonzero entry corresponds to an arc. The value of the entry is the ID of the arc.
costthe cost of each arc
origthe origin node
printlevelIf different from 0, detailes about the iterations are printed. (Default: 0)
Returns
[lambda,pred] lambda is the vector of labels, pred is the vector of the predecessors in the shortest path
Copyright 2015-2018 Michel Bierlaire