• java.lang.Object
• Type Parameters:
V - the graph vertex type
E - the graph edge type
Enclosing class:
TSPLIBImporter<V,​E>

public static class TSPLIBImporter.Metadata<V,​E>
extends java.lang.Object
Container for the meta data of an imported TSPLIB95 file.
Author:
Hannes Wellmann
• ### Method Summary

All Methods
Modifier and Type Method Description
TSPLIBImporter.Specification getSpecification()
Returns the TSPLIBImporter.Specification instance containing all values from the specification part of a TSPLIB95 file.
java.util.List<V> getTour()
Returns the List of vertices in the order of the tour defined in an imported TSPLIB95 file or null if no tour was imported.
java.util.Map<V,​TSPLIBImporter.Node> getVertexToNodeMapping()
Returns the mapping of vertex to corresponding node imported from the NODE_COORD_SECTION of a TSPLIB95 file.
boolean hasDistinctNeighborDistances()
Returns true if for the imported graph each vertex all touching edges have different weights.
boolean hasDistinctNodeLocations()
Returns true if for the imported graph all vertices have distinct coordinates and non of them have equal coordinate values , else false.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Method Detail

• #### getSpecification

public TSPLIBImporter.Specification getSpecification()
Returns the TSPLIBImporter.Specification instance containing all values from the specification part of a TSPLIB95 file.
Returns:
the Specification of an imported TSPLIB95 file
• #### getVertexToNodeMapping

public java.util.Map<V,​TSPLIBImporter.Node> getVertexToNodeMapping()
Returns the mapping of vertex to corresponding node imported from the NODE_COORD_SECTION of a TSPLIB95 file.
Returns:
the mapping of vertex to corresponding node
• #### hasDistinctNodeLocations

public boolean hasDistinctNodeLocations()
Returns true if for the imported graph all vertices have distinct coordinates and non of them have equal coordinate values , else false.
Returns:
true if no equally located nodes were imported from the file, else false
Throws:
java.lang.IllegalStateException - if no graph was imported
• #### hasDistinctNeighborDistances

public boolean hasDistinctNeighborDistances()
Returns true if for the imported graph each vertex all touching edges have different weights.

If this method returns true this means for the TSP that for each location each other location has a different distance, so there are no two other locations that have the same distance from that location.

Returns:
true if all touching edges of each vertex have different weight, else false
Throws:
java.lang.IllegalStateException - if no graph was imported