Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  contraint problem - cplex machine scheduling

    Posted 04/08/17 03:07 PM

    Originally posted by: jinsad


    Hi, 
    
    It is the first time I am using CPLEX and I just started on operations research field. So I was trying to solve the machine scheduling problem (3x3 for the first try) with the Manne formulation (the attached file). I did the code, it is working but it is violating the constraints. 
    I think this has a very easy solution fot more experienced people, but rigth now I am starting to work on infinite cycles. I would greatly appreciate any help or any hints :)
    
    
    float pt[machine,job]=...; //time
    float machinejob[machine,job]=...;// order
    dvar float Cmax;
    dvar float s[job,machine];
    dvar boolean bina[job,job,machine];
    
    minimize Cmax;
    subject to {
    forall (i in machine, j in job )
            r_5:  s[i][j]>=0;
    forall (i in machine, j in job :i>1)
            r_1: machinejob[i][j] >= machinejob[i-1][j]+pt[i][j];
    forall (i in machine, j in job)
            r_2: Cmax >= machinejob[i][j]+pt[i][j];
    forall (i in machine, j in job, k in job: k>j)
        r_3: s[i][j] >= s[i][k] + pt[i][k] - M*bina[i][j][k];
    forall (i in machine, j in job, k in job: k>j)
        r_4: s[i][k] >= s[i][j] + pt[i][j] - M*(1-bina[i][j][k]);
      }    
    

     


    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: contraint problem - cplex machine scheduling

    Posted 04/09/17 01:11 PM

    Your question is hard to read if you put all your text into a code section :-(

    What do you mean by "it violates constraints"? Does the solution you get violate any of the constraints you wrote in your model or is the result invalid to for the real-world problem you are trying to solve? My guess is that it is the latter, which would mean there is an error in your model. What looks suspicious to me is constraint r_1. Shouldn't that be pt[i-1][j] there (instead of pt[i][j])? At least that is what your image suggests. Also, in your image constraint r_2 does not range over machine. The machine index in this constraint seems to be a constant ('m')? This would however only effect the value of the optimal solution, not feasibility.


    #DecisionOptimization
    #MathematicalProgramming-General