Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Help obtaining dual values

    Posted 06/20/08 04:19 AM

    Originally posted by: SystemAdmin


    [g.vandenmoort said:]

    I am having issued retrieving the dual value for my constraints.  It should be straightforward but I have no clue what I'm doing wrong.  Here is my script



    //int numEdges = 4;
    int maxNode = 4;
    //range EDGES = 1..numEdges;
    range Node = 1..maxNode;
    tuple Edge {
        int head;
        int tail;
        float capacity;
        float index;
        };
    {Edge} edges = {<1,2,1.3,1>,<2,3,2.3,2>,<3,4,1.4,3>,<1,4,10.7,4>};
    float cost[edges] = [ 1, 2, 3, 7];

    dvar float+ p[edges];

    minimize sum(x in edges) cost[x]*p[x];
    subject to {
        balance:forall(y in Node: y != 1 && y != maxNode) {
            sum(x in edges:x.head==y) p[x]- sum(z in edges:z.tail==y) p[z] == 0;
        }
        toSink:sum(x in edges:x.tail==maxNode) p[x] == 0.5;
        capacity:forall(x in edges) p[x]<=x.capacity;    <br />}
    execute{
        for(var x in edges) {
            writeln(capacity[x].dual);
        }



    Thanks in advance.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Help obtaining dual values

    Posted 06/20/08 01:07 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    just change the definition of capacity to :

        forall(x in edges)
        capacity:p[x]<=x.capacity;  <br />
    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Help obtaining dual values

    Posted 06/20/08 07:46 PM

    Originally posted by: SystemAdmin


    [g.vandenmoort said:]

    Alain, I think the most important part of your post is missing.  Can you repost it using the "post as code" tag?  Thanks.

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Help obtaining dual values

    Posted 07/16/08 04:36 AM

    Originally posted by: SystemAdmin


    [rocarvaj said:]

    [quote author=alain.chabrier link=topic=351.msg990#msg990 date=1213949248]
    Hi,

    just change the definition of capacity to :

        forall(x in edges)
        capacity:p[x]<=x.capacity;   <br />
    Alain


    What Alain was trying to say is that you have to label constrains inside forall loops.

    I hope the quote looks right...
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Help obtaining dual values

    Posted 07/16/08 07:00 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Yes, sorry, the HTML scrambled my answer.

    Alain


    #DecisionOptimization
    #OPLusingCPLEXOptimizer