Interface ChinesePostman
-
public interface ChinesePostmanAn algorithm for the chinese postman problem.The chinese postman problem is to find a closed path that visits all edges in the graph at least once, with minimum weight sum with respect to a given edge weight function.
The problem can be solved in polynomial time.
Use
newInstance()to get a default implementation of this interface. A builder obtained vianewBuilder()may support different options to obtain different implementations.- Author:
- Barak Ugav
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceChinesePostman.BuilderA builder forChinesePostmanobjects.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <V,E>
Path<V,E>computeShortestEdgeVisitorCircle(Graph<V,E> g, WeightFunction<E> w)Compute the shortest circuit that visits all edges in the graph at least once.static ChinesePostman.BuildernewBuilder()Create a new builder for chinese postman algorithms.static ChinesePostmannewInstance()Create a new algorithm object for chinese postman problem.
-
-
-
Method Detail
-
computeShortestEdgeVisitorCircle
<V,E> Path<V,E> computeShortestEdgeVisitorCircle(Graph<V,E> g, WeightFunction<E> w)
Compute the shortest circuit that visits all edges in the graph at least once.If
gisIntGraph, the returned object isIPath. IfgisIntGraph, prefer to passIWeightFunctionfor best performance.- Type Parameters:
V- the vertices typeE- the edges type- Parameters:
g- a graphw- an edge weight function- Returns:
- a closed path that visits all edges in the graph, with minimum weight sum with respect to the given edge weight function
-
newInstance
static ChinesePostman newInstance()
Create a new algorithm object for chinese postman problem.This is the recommended way to instantiate a new
ChinesePostmanobject. TheChinesePostman.Buildermight support different options to obtain different implementations.- Returns:
- a default implementation of
ChinesePostman
-
newBuilder
static ChinesePostman.Builder newBuilder()
Create a new builder for chinese postman algorithms.Use
newInstance()for a default implementation.- Returns:
- a new builder that can build
ChinesePostmanobjects
-
-