Optimization with LINGO

686 views Asked by At

The Dynamic Programming Problem

I have one optimization problem I am trying to solve with LINGO, I am a beginner with LINGO and I need some help. The question can be accessed by cliking on the 'The Dynamic Programming Problem' link above. Sorry I cant embedd images yet.

I tried to script some code to solve the problem but get syntax errors all the time. Could you give me some hint? Thanks

    sets:

    people/a,b,c,d/: pb;
    trip(people, people): time;

    endsets

    data: 

    pb = 1, 2, 5, 10;

    time = 

    0   2   5   10
    0   0   5   10
    0   0   0   10
    0   0   0   0;

    enddata

    min = @sum(trip(i,j): time);

I also tried this but didnt work

   trip/ab, ac, ad, bc, cd/: time;
   solo/a, b, c/: time2;
   link(trip,solo,trip,solo,trip);
   endsets

   data: 
   time = 2, 5, 10, 5, 10;
   time2 = 1, 2, 5;

   enddata

   t1 = @sum(trip:solo:trip:solo:trip);

   Min = @sum(link(i));
1

There are 1 answers

1
azgrad On

Your first program runs without any syntax errors on my machine.

The only things missing are: "MODEL:" as the first line of the file, and "END" as the last line.