Package org.onlab.graph
Class AbstractGraphPathSearch<V extends Vertex,E extends Edge<V>>
- java.lang.Object
-
- org.onlab.graph.AbstractGraphPathSearch<V,E>
-
- Type Parameters:
V- vertex typeE- edge type
- All Implemented Interfaces:
GraphPathSearch<V,E>
- Direct Known Subclasses:
BellmanFordGraphSearch,BreadthFirstSearch,DepthFirstSearch,DijkstraGraphSearch,KShortestPathsSearch,SrlgGraphSearch
public abstract class AbstractGraphPathSearch<V extends Vertex,E extends Edge<V>> extends java.lang.Object implements GraphPathSearch<V,E>
Basis for various graph path search algorithm implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractGraphPathSearch.DefaultResultDefault path search result that uses the DefaultPath to convey paths in a graph.-
Nested classes/interfaces inherited from interface org.onlab.graph.GraphPathSearch
GraphPathSearch.Result<V extends Vertex,E extends Edge<V>>
-
-
Field Summary
-
Fields inherited from interface org.onlab.graph.GraphPathSearch
ALL_PATHS
-
-
Constructor Summary
Constructors Constructor Description AbstractGraphPathSearch()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckArguments(Graph<V,E> graph, V src, V dst)Checks the specified path search arguments for validity.protected abstract GraphPathSearch.Result<V,E>internalSearch(Graph<V,E> graph, V src, V dst, EdgeWeigher<V,E> weigher, int maxPaths)GraphPathSearch.Result<V,E>search(Graph<V,E> graph, V src, V dst, EdgeWeigher<V,E> weigher, int maxPaths)Searches the specified graph for paths between vertices.
-
-
-
Method Detail
-
checkArguments
protected void checkArguments(Graph<V,E> graph, V src, V dst)
Checks the specified path search arguments for validity.- Parameters:
graph- graph; must not be nullsrc- source vertex; must not be null and belong to graphdst- optional target vertex; must belong to graph
-
search
public GraphPathSearch.Result<V,E> search(Graph<V,E> graph, V src, V dst, EdgeWeigher<V,E> weigher, int maxPaths)
Description copied from interface:GraphPathSearchSearches the specified graph for paths between vertices.- Specified by:
searchin interfaceGraphPathSearch<V extends Vertex,E extends Edge<V>>- Parameters:
graph- graph to be searchedsrc- optional source vertexdst- optional destination vertex; if null paths to all vertex destinations will be searchedweigher- optional edge-weigher; if null,DefaultEdgeWeigherwill be used (assigns equal weights to all links)maxPaths- limit on number of paths;GraphPathSearch.ALL_PATHSif no limit- Returns:
- search results
-
-