V
- the vertex typeE
- the edge typepublic class MartinShortestPath<V,E> extends Object
Martin's label setting algorithm is a multiple objective extension of Dijkstra's algorithm, where the minimum operator is replaced by a dominance test. It computes a maximal complete set of efficient paths when all the cost values are non-negative.
Note that the multi-objective shortest path problem is a well-known NP-hard problem.
MultiObjectiveShortestPathAlgorithm.MultiObjectiveSingleSourcePaths<V,E>
Modifier and Type | Field and Description |
---|---|
protected Graph<V,E> |
graph
The underlying graph.
|
Constructor and Description |
---|
MartinShortestPath(Graph<V,E> graph,
Function<E,double[]> edgeWeightFunction)
Create a new shortest path algorithm
|
Modifier and Type | Method and Description |
---|---|
protected GraphPath<V,E> |
createEmptyPath(V source,
V sink)
Create an empty path.
|
MultiObjectiveShortestPathAlgorithm.MultiObjectiveSingleSourcePaths<V,E> |
getPaths(V source)
Compute all shortest paths starting from a single source vertex.
|
List<GraphPath<V,E>> |
getPaths(V source,
V sink)
Get a shortest path from a source vertex to a sink vertex.
|
protected final Graph<V,E> graph
public List<GraphPath<V,E>> getPaths(V source, V sink)
MultiObjectiveShortestPathAlgorithm
source
- the source vertexsink
- the target vertexpublic MultiObjectiveShortestPathAlgorithm.MultiObjectiveSingleSourcePaths<V,E> getPaths(V source)
MultiObjectiveShortestPathAlgorithm
getPaths
in interface MultiObjectiveShortestPathAlgorithm<V,E>
source
- the source vertexprotected final GraphPath<V,E> createEmptyPath(V source, V sink)
source
- the source vertexsink
- the sink vertexCopyright © 2018. All rights reserved.