V - Vertex typeE - Edge typepublic static class Graphs.FrozenGraph<V,E extends DefaultEdge> extends Object
| Modifier and Type | Field and Description |
|---|---|
private DefaultDirectedGraph<V,E> |
graph |
private Map<Pair<V,V>,List<V>> |
shortestPaths |
| Constructor and Description |
|---|
FrozenGraph(DefaultDirectedGraph<V,E> graph,
Map<Pair<V,V>,List<V>> shortestPaths)
Creates a frozen graph as a copy of another graph.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
findPaths(V from,
V to,
List<List<V>> list) |
private void |
findPathsExcluding(V from,
V to,
List<List<V>> list,
Set<V> excludedNodes,
List<V> prefix)
Finds all paths from "from" to "to" of length 2 or greater, such that the
intermediate nodes are not contained in "excludedNodes".
|
List<List<V>> |
getPaths(V from,
V to)
Returns an iterator of all paths between two nodes, shortest first.
|
List<V> |
getShortestPath(V from,
V to)
Returns the shortest path between two points, null if there is no path.
|
private final DefaultDirectedGraph<V,E extends DefaultEdge> graph
public List<List<V>> getPaths(V from, V to)
The current implementation is not optimal.
public List<V> getShortestPath(V from, V to)
from - Fromto - ToCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.