combinatorial-problems-0.0.5: A number of data structures to represent and allow the manipulation of standard combinatorial problems, used as test problems in computer science.

Portabilityportable
Stabilityprovisional
MaintainerRichard Senington <sc06r2s@leeds.ac.uk>
Safe HaskellNone

FileFormat.TSPLIB

Description

Partial loading routines for the TSPLIB file format. The format itself has a large number of variations, and this has only been designed to load the tsp and atsp variants. It has been tried on all the files from the repository in these classes and it parses them at least.

Relies upon the CombinatorialOptimisation.TSP library.

Currently this does not use the Haskell parsing libraries, nor ByteString, just some custom built routines.

Synopsis

Documentation

loadTSPFile :: InternalStorage -> FilePath -> IO TSPProblemSource

Loads a TSPLIB style file. The first parameter is the internal storage type from CombinatorialProblems.TSP. It allows for full matrix, triangular matrix and full recalculation. If the requested internal storage cannot be used with the file, this will throw an error (e.g. recomputation where you are given a full matrix in the file).

The second parameter is the file path.