Topic
  • 3 replies
  • Latest Post - ‏2013-05-11T19:38:59Z by RithulKrishnan
WangZhengxu
WangZhengxu
5 Posts

Pinned topic Question based on TSP

‏2012-06-12T01:39:51Z |
Hi, all

I have a question based on the model of TSP which described in the OPL model library named Traveling Salesman Problem.

If I add two dummy cities for the salesman, namely start and end, to represent the initial and final status of the salesman.

How I can achieve this using OPL?
Updated on 2012-06-16T05:33:51Z at 2012-06-16T05:33:51Z by WangZhengxu
  • ol
    ol
    22 Posts

    Re: Question based on TSP

    ‏2012-06-13T15:37:53Z  
    Hello,
    if you want to start from a city called start, and to end in a city called end, a simple way is simply adding a constraint x<end,start>==1 to force the end to be connected to the start.
    Regards,
    ol
  • WangZhengxu
    WangZhengxu
    5 Posts

    Re: Question based on TSP

    ‏2012-06-16T05:33:51Z  
    • ol
    • ‏2012-06-13T15:37:53Z
    Hello,
    if you want to start from a city called start, and to end in a city called end, a simple way is simply adding a constraint x<end,start>==1 to force the end to be connected to the start.
    Regards,
    ol
    Thanks a lot. I think I know how to code this problem
  • RithulKrishnan
    RithulKrishnan
    1 Post

    Re: Question based on TSP

    ‏2013-05-11T19:38:59Z  
    Thanks a lot. I think I know how to code this problem

    Hi WangZhengxu,

    I'm learning cplex and need to code the traditional integer programming formulation for the traveling salesman problem. I am struggling with the code using Cplex for MATLAB, I keep getting errors and do not know how to correct them, can you please help me with the code?

     

    Thank You,

    Regards,

    Rithul