Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Constraint generation

    Posted Mon September 15, 2008 07:43 PM

    Originally posted by: SystemAdmin


    [osta said:]

    Hi everyone,
    Although there are mutiple examples on column generation, I wonder if there is any sample about adding constraints in a model as needed, while it is being processed. That is, outlines of a script to add constraints to a model that imporve a current a solution (dual method of column generation).
    Thanks in advance

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Constraint generation

    Posted Fri October 03, 2008 02:30 AM

    Originally posted by: SystemAdmin


    [pablete said:]

    I have the same problem and haven't been able to find any documentation about it, can someone please help us.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Constraint generation

    Posted Fri October 03, 2008 07:34 PM

    Originally posted by: SystemAdmin


    [afleischer said:]

    Hi,

    there is an experimental API for this, in beta test and available in OPL 6.
    Let me give you a small example.

    int n = 5;

    dvar int x;
    dvar int y;

    template TEMPLATE {
    int n = ...;


    execute {
    writeln("n=",n);
    }

    subject to {

    x >= n+1;
    y>= n+100;
    }
    }

    execute {
    writeln("n=",n);
    }

    minimize x+y;
    subject to {
    x >= n+100;
    y >=n+1;
    }


    main {
    thisOplModel.generate();



    var templateOpl = new IloOplModel(thisOplModel.TEMPLATE,cplex);
    var templateData = new IloOplDataElements();
    templateData.n = 10;
    templateOpl.addDataSource(templateData);
    templateOpl.generate();



    cplex.solve();

    writeln("objectiveValue = ",cplex.getObjValue());
    writeln("x = ",thisOplModel.x);
    writeln("y = ",thisOplModel.y);


    if (thisOplModel.x!=105) fail();
    if (thisOplModel.y!=110) fail();

    templateData.end();
    templateOpl.end();
    }
    ;



    #DecisionOptimization
    #OPLusingCPLEXOptimizer