drasys.or.graph.tsp
Class ImproveBase
java.lang.Object
|
+--drasys.or.graph.tsp.TSPBase
|
+--drasys.or.graph.tsp.ImproveBase
- Direct Known Subclasses:
- ThreeOpt, TwoOpt
- public abstract class ImproveBase
- extends TSPBase
A base class containing features common to many improvement TSP algorithms.
Method Summary |
protected void |
flip(drasys.or.graph.tsp.ImproveBase.Vert a,
drasys.or.graph.tsp.ImproveBase.Vert b)
|
protected abstract void |
improve()
|
double |
improveClosedTour(java.util.Vector tour)
Improve a closed tour solution. |
double |
improveOpenTour(java.util.Vector tour)
Improve an open tour solution with arbitrary end points. |
double |
improveOpenTour(java.util.Vector tour,
boolean fixedOrigin,
boolean fixedDestination)
Improve an open tour solution with fixed end points. |
protected void |
saveTour()
|
protected void |
setVertCosts()
|
Methods inherited from class drasys.or.graph.tsp.TSPBase |
checkChangeCount,
countVertices,
forwardCost,
getCost,
getTour,
initVertices,
initVertices,
reverseCost,
rotateClosedTour,
setEdgeKey,
setGraph,
setProperties |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ImproveBase
public ImproveBase()
- The target graph must be set with 'setGraph()'.
ImproveBase
public ImproveBase(GraphI graph)
- Sets the target graph.
improve
protected abstract void improve()
throws TourNotFoundException
improveOpenTour
public double improveOpenTour(java.util.Vector tour)
throws TourNotFoundException
- Improve an open tour solution with arbitrary end points.
An open tour is one where the origin and destination vertices are different.
improveOpenTour
public double improveOpenTour(java.util.Vector tour,
boolean fixedOrigin,
boolean fixedDestination)
throws TourNotFoundException
- Improve an open tour solution with fixed end points.
An open tour is one where the origin and destination vertices are different.
The arguments can be used to fix either end.
improveClosedTour
public double improveClosedTour(java.util.Vector tour)
throws TourNotFoundException
- Improve a closed tour solution.
An closed tour is one where the origin and destination vertices are the same.
saveTour
protected void saveTour()
flip
protected final void flip(drasys.or.graph.tsp.ImproveBase.Vert a,
drasys.or.graph.tsp.ImproveBase.Vert b)
setVertCosts
protected final void setVertCosts()
Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com