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

Algorithm 23.1: shortest paths. More...

Go to the source code of this file.

Functions

function shortestPath (in adj, in cost, in orig)
 Calculate the shortest paths from one origin to all nodes. More...
 

Detailed Description

Algorithm 23.1: shortest paths.

Implementation of algorithm 23.1 of [1]

Note
Tested with runShortestPath.m
Calls prepareNetwork
Author
Michel Bierlaire
Date
Thu Apr 9 17:20:42 2015

Definition in file shortestPath.m.

Function Documentation

◆ shortestPath()

function shortestPath ( in  adj,
in  cost,
in  orig 
)

Calculate the shortest paths from one origin to all nodes.

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 vector.
origthe origin node
Returns
lambda the vector of labels
pred the vector of the predecessors in the shortest path
Copyright 2015-2018 Michel Bierlaire