TSP_IO
Read or Write Traveling Salesman Problem (TSP) Files
TSP_IO
is a FORTRAN90 library which
is intended to be used to read or write some of the formats used
in TSPLIB, a collection of traveling salesman problems stored in
a particular format known as "TSP".
Licensing:
The computer code and data files described and made available on this
web page are distributed under
the GNU LGPL license.
Languages:
TSP_IO is available in
a FORTRAN90 version.
Related Data and Programs:
CITIES,
a dataset directory which
contains sets of information about cities and the distances between them;
CITIES,
a FORTRAN90 library which
handles various problems associated with a set of "cities" on a map.
TSP,
a dataset directory which
contains test data for the traveling salesperson problem;
TSP_BRUTE,
a FORTRAN90 program which
reads a file of city-to-city distances and solves the
traveling salesperson problem, using brute force.
TSP_LAU,
a FORTRAN90 library which
implements a heuristic algorithm for the solution of
the traveling salesperson problem, by Hang Tong Lau.
Reference:
-
Gerhard Reinelt,
TSPLIB - A Traveling Salesman Problem Library,
ORSA Journal on Computing,
Volume 3, Number 4, Fall 1991, pages 376-384.
Source Code:
Examples and Tests:
P01 is a small example of 15 cities.
-
p01.tsp,
the TSP file.
-
p01_d.txt,
the distance table file created by TSP_IO_PRB.
ATT48 is a classic example of 48 cities.
List of Routines:
-
CH_CAP capitalizes a single character.
-
GET_UNIT returns a free FORTRAN unit number.
-
I4MAT_PRINT prints an I4MAT.
-
I4MAT_PRINT_SOME prints some of an I4MAT.
-
I4MAT_WRITE writes an I4MAT file.
-
PSEUDO_EUCLIDEAN_DISTANCE computes the distance used for the ATT example.
-
S_EQI is a case insensitive comparison of two strings for equality.
-
S_TO_I4 reads an integer value from a string.
-
S_WORD_EXTRACT_FIRST extracts the first word from a string.
-
TEXT_SPLIT uses a colon to locate the keyword and field in a line of text.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TSP_EDGE_WEIGHT_READ reads the edge weights of a TSP file.
-
TSP_HEADER_READ reads the header of a TSP file.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 01 November 2010.