Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width300px
Page Tree
root15DOTs60ia13:Tutorial
Column
Wiki Markup
 

h1. Solving TSPLIB Instances

The file _tspSolver/src/main/Main.java_ contains code that will run your solver on instances from the [TSPLIB database|http://comopt.ifi.uni-heidelberg.de/software/TSPLIB95/].  The main method of this class begins with
{code}
	public static void main(String[] args) {
		String[] problemNames = new String[]{"bier127","eil51","brd14051","ch130","ch150","d198", "d493","d657", "d1291","fl1400"};
		String problemName = problemNames[1];
		//...
{code}
Here the elements of {{problemNames}} are files in the directory _sampleData/TSPLIB/_ that existing code will parse for you into a problem instance.  The number in the file name refers to the number of cities in the problem.  You can adjust which problem is attempted by assigning a different value to {{problemName}} (by changing the index used to access {{problemNames}}, or if you prefer, typing in a file name manually).  Try running your solver on a few different instances (start with smaller ones).

{chart:type=bar|title=Run time for TSPLIB instances solved with lazy constraints|yLabel=Run Time (sec)|legend=false|width=600|height=400}
||Problem Name||eil51|bier127|ch130|ch150|d198|
|Run time|0.11|0.77|1.98|5.09|17.57|
{chart}

Performance degrades pretty quickly on larger problems.  On my machine, d493 took over 5000 seconds to solve, and created over 250,000 nodes in branch and bound!

h1. Interpreting CPLEX Output

When running the solver, the output generated by CPLEX is directed is printed out to the console.  A complete explanation of what all of the output means can be found in the user manual [here|http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r5/index.jsp?topic=%2Filog.odms.cplex.help%2FCPLEX%2FUsrMan%2Ftopics%2Fdiscr_optim%2Fmip%2Fpara%2F52_node_log.html].  We will explain the output as needed to motivate improvements to our TSP solver.