Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Problem in code

    Posted 12/02/14 12:22 PM

    Originally posted by: giannil


    Hello,

    We are trying to make an optimal schedule and therefore we have a model that first make couples of artist that should play together.

    We can make couples of 2, 3, etc. artist, that isn't the problem.

    After this we have a model that uses this solution to make the schedule. In the last model we try to make an optimal sequence of the couples of artist.

    There we found a problem. The model works fine for couples of 2 and gives us an optimal solution. But when we have couples of 3 it won't give any values.

    In particular, this code works when aantalPodia is 2. When it is 3 or more it doesn't work.

    Is there anything wrong with are code?

    This is our code :

    int AantalFG = ...;
     int AantalPodia = ...;
     int AantalTijdsblokken = ...;
     int AantalArtiesten = AantalPodia*AantalTijdsblokken;
     int X[0 .. AantalArtiesten-1][0 .. AantalArtiesten-1] = ...; //in vorige stap is bepaald welke optredens samenvallen
     
     int Voorkeuren [0 .. AantalFG-1][0 .. AantalArtiesten-1] = ...;
     
      //Conflicten is een matrix waarin op plaats ij het aantal festivalgangers staan die zowel optreden i als optreden j willen bijwonen
     
     int Conflicten[a in 0 .. AantalArtiesten-1][b in 0 .. AantalArtiesten-1]= sum(c in 0 .. AantalFG-1) Voorkeuren[c][a]*Voorkeuren[c][b];
     
    //Decision Variables
      //Oijk = 1, als optreden i plaatsvind op podium j tijdens tijdslot k
     
      dvar int O[0 .. AantalArtiesten-1][0 .. AantalPodia-1][0 .. AantalTijdsblokken-1] in 0 .. 1;
     
      //Zij = 1, als optreden j volgt op i op een verschillend podium
     
      dvar int Z[0 .. AantalArtiesten-1][0 .. AantalArtiesten-1] in 0 .. 1;
     
    //Objective Function
     
    minimize sum(i,j in 0 .. AantalArtiesten-1)Conflicten[i][j]*Z[i][j];
     
    //Constraints
     
    subject to{
     
      //Uniciteit
    //Elke artiest moet 1 podium en 1 tijdsblok toegewezen krijgen
     
    forall( i in 0 .. AantalArtiesten-1)
    sum(j in 0 .. AantalPodia-1, k in 0 .. AantalTijdsblokken-1)O[i][j][k] == 1;
     
    //Er mag maar 1 artiest per podium en per tijdsblok zijn
     
    forall( j in 0 .. AantalPodia-1, k in 0 .. AantalTijdsblokken-1)
    sum( i in 0 .. AantalArtiesten-1) O[i][j][k] == 1;
     
      //__________________________________________________________________
      
      //De optredens waarvan bepaald is dat zei in het vorige deel samenvallen, moeten ook effectief in hetzelfde tijdslot vallen
     
      forall(k in 0 .. AantalTijdsblokken-1, i, a in 0 .. AantalArtiesten-1: a > i)
       X[i][a]*sum(j in 0 .. AantalPodia-1)O[i][j][k] ==  X[i][a]*sum(j in 0 .. AantalPodia-1)O[a][j][k];
     
      //De VolgOpVerschillendPodiumVariabele
     
      forall(i,a in 0 .. AantalArtiesten-1: a != i , j,b in 0 .. AantalPodia-1: b!=j, k in 0 .. AantalTijdsblokken-2)
       1+Z[i][a] >= O[i][j][k]+O[a][b][k+1];
     

    Thanks!


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Problem in code

    Posted 12/05/14 04:09 AM

    Hi,

    can you attach your .dat ?

    regards


    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: Problem in code

    Posted 12/06/14 03:54 PM

    Originally posted by: giannil


    We found our mistake but is there any possibility to make the code from this part more efficient.

    It takes a lot of time now to calculate something

    Thanks


    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: Problem in code

    Posted 12/06/14 04:28 PM

    Hi,

    well if you attach your .mod and .dat you could maybe get some good advice.

    Regards


    #DecisionOptimization
    #MathematicalProgramming-General


  • 5.  Re: Problem in code

    Posted 12/07/14 01:07 PM

    Originally posted by: giannil


    In attachment you will find two .mod files, the first "CreërenKoppels" makes the couples and the second "Bepalen..." makes the schedule taking into account the preferences of the people. The first gives also data to the second. This is done by the script.mod-file. Only the .dat file in the first is used.

    When we take 30 artists it takes more than 40h and it goes out of memory.

    Thnaks


    #DecisionOptimization
    #MathematicalProgramming-General


  • 6.  Re: Problem in code

    Posted 12/11/14 08:19 AM

    Originally posted by: giannil


    Hello,

    we made a new more efficient program but now we have again the out of memory settings.

    I set the option node file on disc and compressed but after 22% he gives out of memory again.

    Is there anything else we can do, because with the option strong branching it goes very slow..

    In attachment you can find our model.

    Thanks


    #DecisionOptimization
    #MathematicalProgramming-General


  • 7.  Re: Problem in code

    Posted 12/11/14 09:38 AM

    Hi,

    do you use the IDE or oplrun ?

    Have you tried to add after the line

    writeln("Oplossing O = ", newOpl.O.solutionValue);

    some end instructions

    newOpl.end();

    newData.end();

    data.end();

    volgDef.end();

    volgSource.end();

    regards


    #DecisionOptimization
    #MathematicalProgramming-General


  • 8.  Re: Problem in code

    Posted 12/14/14 06:05 AM

    Originally posted by: giannil


    How can you see if you use IDE or oplrun?

    The only thing I do is, run by default?

    Thanks


    #DecisionOptimization
    #MathematicalProgramming-General


  • 9.  Re: Problem in code

    Posted 12/14/14 10:43 AM

    Hi

    do you use the command line oplrun or the IDE ?

    If you use the IDE try to set mainEndEnabled to True.

    Regards


    #DecisionOptimization
    #MathematicalProgramming-General