Optimization: principles and algorithms, by Michel Bierlaire
|
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... | |
Algorithm 23.2: Dijkstra.
Implementation of algorithm 23.2 of [1]
Definition in file dijkstra.m.
function dijkstra | ( | in | adj, |
in | cost, | ||
in | orig, | ||
in | printlevel | ||
) |
Calculate the shortest paths from one origin to all nodes using Dijkstra's algorithm.
adj | adjacency matrix of the network. Each nonzero entry corresponds to an arc. The value of the entry is the ID of the arc. |
cost | the cost of each arc |
orig | the origin node |
printlevel | If different from 0, detailes about the iterations are printed. (Default: 0) |