V
- Vertex typeE
- Edge typepublic static class GraphUtils.SuurballeTarjanAlgorithm<V,E>
extends Object
Class to calculate the shortest link-disjoint path pair between two nodes using Suurballe-Tarjan's algorithm.
Reference: J.W. Suurballe, R.E. Tarjan, "A Quick Method for Finding Shortest Pairs of Disjoint Paths," <i>Networks</i>, vol. 14, no. 2, pp. 325-335, 1984
Constructor and Description |
---|
GraphUtils.SuurballeTarjanAlgorithm(edu.uci.ics.jung.graph.Graph<V,E> graph,
org.apache.commons.collections15.Transformer<E,Double> nev)
Default constructor.
|
GraphUtils.SuurballeTarjanAlgorithm(edu.uci.ics.jung.graph.Graph<V,E> graph,
org.apache.commons.collections15.Transformer<E,Double> nev,
boolean cached)
This constructor allows to configure if the shortest-path algorithm should
cached previous computations.
|
Modifier and Type | Method and Description |
---|---|
List<List<E>> |
getDisjointPaths(V startVertex,
V endVertex)
Returns the shortest link-disjoint path pair (in increasing order of weight).
|
public GraphUtils.SuurballeTarjanAlgorithm(edu.uci.ics.jung.graph.Graph<V,E> graph, org.apache.commons.collections15.Transformer<E,Double> nev)
graph
- Graph on which shortest paths are searchednev
- The class responsible for returning weights for edgespublic GraphUtils.SuurballeTarjanAlgorithm(edu.uci.ics.jung.graph.Graph<V,E> graph, org.apache.commons.collections15.Transformer<E,Double> nev, boolean cached)
graph
- Graph on which shortest paths are searchednev
- The class responsible for returning weights for edgescached
- Indicates whether previous computations from the shortest-path algorithm should be cachedpublic List<List<E>> getDisjointPaths(V startVertex, V endVertex)
Returns the shortest link-disjoint path pair (in increasing order of weight).
Important: If only one path can be found, only such a path will be returned.
startVertex
- Start vertex of the calculated pathsendVertex
- Target vertex of the calculated paths