drasys.or.graph.tsp
Interface TSPI

All Known Subinterfaces:
ConstructI, ImproveI

public interface TSPI

The interface used by all algorithms to access TSP algorithms.


Method Summary
 double getCost()
          Returns the cost of the solution tour.
 java.util.Vector getTour()
          Returns the solution tour generated by the algorithm.
 java.util.Vector rotateClosedTour(java.util.Vector tour, java.lang.Object key)
          Rotates the closed tour until the vertex that matches key is the vertex that is repeated on both ends.
 void setEdgeKey(java.lang.Object edgeKey)
          Sets the key used to select from parallel edges between vertices.
 void setGraph(GraphI graph)
          Sets the graph for the TSP algorithm.
 void setProperties(PropertiesI properties)
          Sets the edge properties object.
 

Method Detail

setGraph

public void setGraph(GraphI graph)
Sets the graph for the TSP algorithm.

setProperties

public void setProperties(PropertiesI properties)
Sets the edge properties object.

setEdgeKey

public void setEdgeKey(java.lang.Object edgeKey)
Sets the key used to select from parallel edges between vertices. The default value for 'edgeKey' is null.

getCost

public double getCost()
Returns the cost of the solution tour.
Throws:
GraphError - if no solution was created.

getTour

public java.util.Vector getTour()
Returns the solution tour generated by the algorithm. The vector contains all the edges and the vertices in alternating order starting and ending with a vertex. The elements will always be arranged in the order of forward tour traversal.
Throws:
GraphError - if no solution was created.

rotateClosedTour

public java.util.Vector rotateClosedTour(java.util.Vector tour,
                                         java.lang.Object key)
                                  throws VertexNotFoundException
Rotates the closed tour until the vertex that matches key is the vertex that is repeated on both ends.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com