Class TSPLIBImporter.Metadata<V,​E>

  • 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 Detail

      • 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