Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  beginner question about constraints in LP format

    Posted 06/13/09 01:52 AM

    Originally posted by: SystemAdmin


    [ppadegim said:]

    Hi everyone.  I have just started using CPLEX and I don't quite understand how constraints with different dimensions interact.  I have a problem with a constraint as follows:  Y i,j,t + Z i,t - X i,t = 0.  The Y variable is defined as transfers from i to j in period t, with Z being demand left unsatisfied in location i at period t, and X being an initial deficit in location i, period t, which is defined in an earlier constraint.  My problem is that I do not understand the way that CPLEX reads i, j, and t and am therefore having trouble writing the input file so that the LP executes properly.  Hopefully this is clear enough for everyone to understand.  I appreciate any help that might be offered.

    Thank you,

    Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: beginner question about constraints in LP format

    Posted 06/14/09 07:25 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    It would help to know how you are using CPLEX (interactive optimizer, C++ API, Java API, ...) and how you are trying to input the problem (.lp file, .mps file, type in from keyboard, read coefficients from a flat file into a C++/Java program, ...).

    /Paul

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: beginner question about constraints in LP format

    Posted 06/15/09 12:15 PM

    Originally posted by: SystemAdmin


    [ppadegim said:]

    I am using the interactive optimizer and inputting the problem as a text file.  The format is as follows:

    Minimize Z i,t
    subject to
    c1: Y i,j,t + Z i,t - X i,t = 0
    bounds
    Y i,j,t >= 0
    Z i,t >= 0
    X i,t >= 0

    Thank you very much,

    Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: beginner question about constraints in LP format

    Posted 06/15/09 08:50 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    The interactive optimizer does not understand subscripting.  If you are typing the problem in, you need to substitute integers for subscripts as you type.  So you enter

    c1: Y111 + Z11 - X11 = 0
    c2: Y121 + Z11 - X11 = 0

    etc.

    (Incidentally, you might want to reconsider that particular set of constraints:  it forces Yi,j,t to equal Yi,k,t.)

    Presumably you do not want to mess with all this yourself, so you might want to consider either (a) writing a program that expands your model and outputs it in either LP or MPS format, which you can then read into CPLEX or (b) use a modeling language (AMPL, GAMS, Mosel, OPL, MPL, ZIMPL, GMPL, ...) to convert your algebraic model to LP or MPS format and read it into CPLEX.  The first n-2 of those are commercial products, although I think there are free student versions (limited capacity) for some if not all of them.  ZIMPL and GMPL (part of GLPK) are open-source.  I think both implement a subset of the AMPL language.

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization