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

Enumerate all simple paths between two nodes. More...

Go to the source code of this file.

Functions

function enumeratePaths (in adj, in arcs, in orig, in dest, in forbiddennodes, in forward)
 Enumerate all simple paths between two nodes. More...
 

Detailed Description

Enumerate all simple paths between two nodes.

Note
Tested with runEnumeratePaths.m
Author
Michel Bierlaire
Date
Sat Apr 11 11:08:57 2015

Definition in file enumeratePaths.m.

Function Documentation

◆ enumeratePaths()

function enumeratePaths ( in  adj,
in  arcs,
in  orig,
in  dest,
in  forbiddennodes,
in  forward 
)

Enumerate all simple paths between two 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.
arcsmatrix containing the upstream and downstream nodes of each arc. Each row corresponds to an arc. Column 1 contains the upstream node and column 2 the downstream. Can be generated from the adjacency matrix by prepareNetwork
origthe origin node
destthe destination node
forbiddennodesnodes that cannot be included anymore, in order to generate simple paths.
forwardif 0, arcs can be used in any direction. If not 0, arcs can only be used in the forward direction
Returns
paths [cell array containing paths as list of nodes, cell array containing paths as list of links]
Copyright 2015-2018 Michel Bierlaire