[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Obtaining the optimal tour from tspsol
From: |
Andrew Makhorin |
Subject: |
Re: [Help-glpk] Obtaining the optimal tour from tspsol |
Date: |
Wed, 23 Aug 2006 18:11:55 +0400 |
> Is it possible to obtain the optimal tour when running tspsol, i.e., the
> order of nodes to visit?
You may use the following command:
tspsol infile -o outfile
in which case the solver writes the solution to 'outfile' in a plain text
format (like glpsol).
For example:
No. Column name St Activity Lower bound Upper bound Marginal
------ ------------ -- ------------- ------------- ------------- -------------
1 1-2* NU 1 0 1 -280
2 2-3* NL 0 0 1 20
3 3-6* NU 1 0 1 -10
4 6-8* NL 0 0 1 160
5 4-8* B 1 0 1
6 4-5* NU 1 0 1 -50
7 5-7* NU 1 0 1 -290
8 1-7* NL 0 0 1 260
9 1-5 NL 0 0 1 110
10 2-6 B 0 0 1
11 1-3 B 0 0 1
12 7-8 B 0 0 1
13 5-8 B 0 0 1
14 1-6 B 1 0 1
15 2-7 B 0 0 1
16 2-8 B 1 0 1
17 3-7 B 1 0 1
If some variable, say, '3-7', is 1 (see 'Activity'), the corresponding
edge is included in the optimal tour, otherwise not.