[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] How can I use functions in glptsp.c to solve TSPs using

From: xypron
Subject: Re: [Help-glpk] How can I use functions in glptsp.c to solve TSPs using glpk?
Date: Tue, 29 Sep 2009 13:32:22 -0700 (PDT)


tsp_read_data() is not part of the documented API (see doc/glpk.pdf).

For teaching purposes a good idea would be to provide the example as a CSV
and read it with command "table IN" inside a gmpl model (see

Only a few changes to examples/tsp.mod are needed: 

How to output a SVG graphic from glpsol is shown in tsp_svg.tar.gz 

Best regards


ikarus wrote:
> Hi,
> I saw that glpk's distribution includes glptsp.c and glptsp.h (that look
> undocumented, by the way). These files seem to provide only routines to
> read data from a TSPLIB file and to compute the distance between two
> cities. How can I use these in combination with the other functions
> included in glpk to actually solve a tsp instance?
> I would like to do something like:
> TSP *tsp = tsp_read_data("berlin52.tsp");
> glp_intopt(tsp, some_params);
> but clearly glp_intopt needs another type of data as problem descriptor
> ...
> Is there any way to do something similar? 
> ... or a script to convert the TSPLIB format in GMLP? 
> (by the way, I know that glpk is not a good option to solve large TSP
> instances, but I need it for teaching purposes)
> Thanks!

View this message in context:
Sent from the Gnu - GLPK - Help mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]