V
- Vertex typeE
- Edge typepublic static class Graphs.FrozenGraph<V,E extends DefaultEdge>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private DefaultDirectedGraph<V,E> |
graph |
private java.util.Map<Pair<V,V>,java.util.List<V>> |
shortestPaths |
Constructor and Description |
---|
FrozenGraph(DefaultDirectedGraph<V,E> graph,
java.util.Map<Pair<V,V>,java.util.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,
java.util.List<java.util.List<V>> list) |
private void |
findPathsExcluding(V from,
V to,
java.util.List<java.util.List<V>> list,
java.util.Set<V> excludedNodes,
java.util.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".
|
java.util.List<java.util.List<V>> |
getPaths(V from,
V to)
Returns an iterator of all paths between two nodes, shortest first.
|
java.util.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 java.util.List<java.util.List<V>> getPaths(V from, V to)
The current implementation is not optimal.
public java.util.List<V> getShortestPath(V from, V to)
from
- Fromto
- ToCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.