Symbolic shortest paths algorithms. More...
#include "ntr.h"
#include "cuddInt.h"
Functions | |
int | Ntr_ShortestPaths (DdManager *dd, BnetNetwork *net, NtrOptions *option) |
Computes shortest paths in a state graph. | |
static DdNode * | ntrBellman (DdManager *dd, DdNode *D, DdNode *source, DdNode **x, DdNode **y, int vars, int pr) |
Bellman-Ford algorithm for single-source shortest paths. | |
static DdNode * | ntrWarshall (DdManager *dd, DdNode *D, DdNode **x, DdNode **y, int vars, int pr) |
Floyd-Warshall algorithm for all-pair shortest paths. | |
static DdNode * | ntrSquare (DdManager *dd, DdNode *D, DdNode **x, DdNode **y, DdNode **z, int vars, int pr, int st) |
Repeated squaring algorithm for all-pairs shortest paths. |
Symbolic shortest paths algorithms.
This file contains the functions that implement the symbolic version of several shortest path algorithms described in the JFM paper on ADDs.
Copyright (c) 1995-2015, Regents of the University of Colorado
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
int Ntr_ShortestPaths | ( | DdManager * | dd, | |
BnetNetwork * | net, | |||
NtrOptions * | option | |||
) |
Computes shortest paths in a state graph.
Computes shortest paths in the state transition graph of a network. Three methods are availabe:
static DdNode* ntrBellman | ( | DdManager * | dd, | |
DdNode * | D, | |||
DdNode * | source, | |||
DdNode ** | x, | |||
DdNode ** | y, | |||
int | vars, | |||
int | pr | |||
) | [static] |
Bellman-Ford algorithm for single-source shortest paths.
In case of multiple initial states the distance for each state is from the nearest initial state. Negative-weight cycles are detected, though only in the naive way. (Lack of convergence after nodes-1 iterations.) In such a case, a constant ADD with value minus infinity is returned. Bellman-Ford is based on matrix-vector multiplication. The matrix is the distance matrix D(x,y), such that D(a,b) is the length of the arc connecting state a to state b. The vector V(x) stores the distances of all states from the initial states. The actual vector used in the matrix-vector multiplication is diff(x), that holds those distances that have changed during the last update.
static DdNode* ntrSquare | ( | DdManager * | dd, | |
DdNode * | D, | |||
DdNode ** | x, | |||
DdNode ** | y, | |||
DdNode ** | z, | |||
int | vars, | |||
int | pr, | |||
int | st | |||
) | [static] |
Repeated squaring algorithm for all-pairs shortest paths.
dd | manager | |
D | D(z,y): distance matrix | |
x | array of x variables | |
y | array of y variables | |
z | array of z variables | |
vars | number of variables in each of the three arrays | |
pr | verbosity level | |
st | use the selective trace algorithm |