Package io.github.lmores.tsplib
All files in TSPLIB format are supported, except those with extension
.problems
.
This package includes a copy of the TSPLIB archive taken from the official website.
As many types of problems in the TSPLIB assume that the underlying graph is complete, edges are not explicitly stored in memory when possible. In these cases, the only value associated with an edge is its weight. TSPLIB instance files have 13 different ways to encode edge weights (EXPLICIT, EUC_2D, EUC_3D, MAX_2D, MAX_3D, MAN_2D, MAN_3D, CEIL_2D, GEO, ATT, XRAY1, XRAY2 and SPECIAL). Out of all these possibilities, only the EXPLICIT one requires the direct enumeration of all weight values, whereas in all the other cases the weight is computed by a specific function using from the coordinates of the nodes.
Since the number of nodes can be high, when the edge weights format is
different from EXPLICT, weight values are not stored in memory when an
instance is loaded; instead, they are generated on the fly each time
the method BaseInstance.getEdgeWeight(int, int)
is called.
You can obtain an in memory copy of all the edge weights using the method
BaseInstance.materializeEdgeWeightsMatrix()
.
- Since:
- 0.0.1
- Author:
- Lorenzo Moreschini
-
ClassDescriptionInterface implemented by all classes that represent a problem type from TSPLIB.The sole purpose of this class is to run the snippets used in README.md.Representation of a tour on a graph as a sequence of nodes.Methods to load the TSPLIB instances shipped with this package.Store the data found when reading a file in the TSPLIB format.Collection of constants used in TSPLIB instance files.Values allowed in the 'DISPLAY_DATA_TYPE' section of TSPLIB file format.Values allowed in the 'EDGE_FORMAT_DATA' section of TSPLIB file format.Values allowed in the 'EDGE_WEIGHT_FORMAT' section of TSPLIB file format.Values allowed in the 'EDGE_WEIGHT_TYPE' section of TSPLIB file format.Values allowed in the 'NODE_COORD_TYPE' section of TSPLIB file format.Values allowed in the 'TYPE' section of TSPLIB file format.Exception thrown when an error is encountered while parsing a TSPLIB file.Utilities to interact with the data contained in TSPLIB instances.