help-glpk
[Top][All Lists]
Advanced

[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)

Hi,

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
file
and read it with command "table IN" inside a gmpl model (see
doc/tables.pdf).

Only a few changes to examples/tsp.mod are needed:
http://www.nabble.com/file/p25670352/tsp.zip tsp.zip 

How to output a SVG graphic from glpsol is shown in
http://www.nabble.com/file/p21151721/tsp_svg.tar.gz tsp_svg.tar.gz 

Best regards

Xypron


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: 
http://www.nabble.com/How-can-I-use-functions-in-glptsp.c-to-solve-TSPs-using-glpk--tp25666405p25670352.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.





reply via email to

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