Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Help regarding .mod file

    Posted 02/20/12 05:01 PM

    Originally posted by: Y17P_Karthikeswar_Ivaturi


    Hello all,

    I am graduate research student from UMASS. I am working on virtual network Mapping algorithms for my thesis. I had to work on a code that previously existed. I came across a .mod file where the objective function is located. I need to add a small part to it, but I could not figure out how an objective function in mathematical form is written in as a computer code. I am pasting the code below, if anybody can help me understand the syntax and also help me add my part of the equation it would be great and immensely appreciated.

    HUB.mod
    file

    set SN;
    /*substrate nodes*/

    set VN;
    /*virtual nodes*/

    set AUG:=SN union VN;

    param numHubs;
    param distance{i in AUG, j in AUG};
    /*distance between i and j*/

    param W{i in VN, j in VN};
    /*demand between i and j*/

    param BW{i in AUG, j in AUG};
    /*Augmented graph edges BandWidth*/

    param cost{i in AUG, j in AUG};

    param beta;
    /*unit costs of collection (origin to hub)*/
    param alpha;
    /*unit costs of transfer (hub to hub)*/
    param delta;
    /*unit costs of distribution (hub to destination*/

    param CPU{i in AUG};
    param O{i in VN};

    param SEL{i in AUG, j in AUG};

    var Z{i in AUG, k in AUG} >=0;
    /*flow from origin i to hub k*/

    var Y{i in VN, k in SN, l in SN} >=0;
    /*flow from hub k to hub l for flow originating at node i*/

    var X{i in VN, l in SN, j in VN} >=0;

    var H{i in SN} binary;

    minimize OBJECTIVE: sum{i in VN} ( sum{k in SN}((CPU[i]/(CPU[k]+1E-06))*costi,k*beta*distancei,k*Zi,k) + (sum{k in SN} sum{l in SN}(1/(BWk,l+1E-06)) *(alpha*distancek,l*Yi,k,l)) + sum{l in SN} (CPU[i]/(CPU[l]+1E-06)) * sum{j in VN} ( costj,ldelta distancel,j*Xi,l,j));

    subject to AllocConstraint: sum{k in SN} H[k] = numHubs;
    subject to AllocConstraint1{i in VN}: sum{k in SN} Zi,k =O[i];

    subject to demandConstraint{i in VN, j in VN}: sum{l in SN} Xi,l,j = Wi,j;

    subject to FlowConservationConstraint{i in VN, k in SN}: Zi,k+sum{l in SN} Yi,l,k = sum{l in SN} Yi,k,l + sum{j in VN} Xi,k,j ;
    subject to CapConstraint{k in SN, l in SN}: sum{i in VN} (Yi,k,l) <=BWk,l;
    subject to CapConstraint1{k in SN, l in SN}: sum{i in VN} (Yi,l,k) <=BWl,k;
    subject to lessThanConstraint{i in VN, j in VN, l in SN}: Xi,l,j <= Wi,j * H[l];

    subject to lessThanConstraint1{i in VN, k in SN}:Zi,k <= O[i]*H[k];

    end;



    I am also attaching the corresponding objective function in mathematical form.

    I hope somebody would reply.

    Thank you,
    Karthik
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Help regarding .mod file

    Posted 02/20/12 06:06 PM

    Originally posted by: SystemAdmin


    This is an AMPL model file: see http://www.ampl.com. You might also want to post your question at http://groups.google.com/group/ampl (or send it to ampl@googlegroups.com).

    Based on a quick look, I would say that your mathematical objective function was changed quite a bit in the process of being implemented in this model. If the mathematical form had been implemented as written, it would be easy to read in AMPL.

    Bob Fourer
    4er@ampl.com
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Help regarding .mod file

    Posted 02/20/12 06:17 PM

    Originally posted by: Y17P_Karthikeswar_Ivaturi


    Thank you Bob for the prompt reply. I appreciate it greatly. Finally I got some start.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Help regarding .mod file

    Posted 02/20/12 06:43 PM

    Originally posted by: SystemAdmin


    Hi

    I'm attaching an OPL model file that may help you with the syntax.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Help regarding .mod file

    Posted 02/20/12 06:57 PM

    Originally posted by: Y17P_Karthikeswar_Ivaturi


    Hi,

    Thank you so much. That really helped me understanding the syntax. So, if we have a mod file, a dat file and a .lp file. How do we establish a connection between the 3 files.

    Dat file contains the input information for the mod file. So can you please tell me how is the procedure done?

    Thank you.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Help regarding .mod file

    Posted 02/20/12 07:33 PM

    Originally posted by: SystemAdmin


    The .mod is the formulation of your mathematical model, the .dat will contain the data or instructions to fetch data from a database or Microsoft Spreadsheet or SPSS Stream.
    In your OPL project, you create a Run Configuration that will include your .mod file and your .dat file(s), then you execute that run configuration.
    Or if you don't work with the IDE, you can use the command line:
    oplrun yourModel.mod yourData1.dat ... yourDataN.dat
    


    The .lp is another representation of your model that can be used with interactive CPLEX, not the IDE.
    If you want to work with interactive CPLEX, you can easily generate the .lp file from the OPL model.

    The Getting Started in the documentation may be useful to you.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Help regarding .mod file

    Posted 02/21/12 02:15 PM

    Originally posted by: Y17P_Karthikeswar_Ivaturi


    Thank you so much for the Getting Started guide that you provided, that was a lot useful.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: Help regarding .mod file

    Posted 02/22/12 08:25 PM

    Originally posted by: Y17P_Karthikeswar_Ivaturi


    I was solving an objective function and I got this as the output --
    CPLEX 12.3.0.0: optimal integer solution within mipgap or absmipgap; objective 16492019410
    10 MIP simplex iterations
    0 branch-and-bound nodes
    absmipgap = 145.402, relmipgap = 8.81652e-09

    What does it mean by optimal integer solution within mipgap or absmipgap ? And also what is relmipgap.

    Thank you
    #DecisionOptimization
    #OPLusingCPLEXOptimizer