Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX LP Format / Constraints lines

    Posted 09/27/09 10:48 PM

    Originally posted by: SystemAdmin


    [Mengue said:]

    Hi,

    I want to know if the constraint line can be write in 2 (or more) lines.

    Example:

    Maximize
    x1 + x2 + x3 + ...
    + x1001 + 1002 + 1003

    Subject To
    x1 + x2 + x3 + ...
    + x1001 + 1002 + 1003 <= 500<br />
    End

    Thanks!

    Leandro Mengue


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX LP Format / Constraints lines

    Posted 09/27/09 11:18 PM

    Originally posted by: SystemAdmin


    [shaon said:]

    [quote author=Mengue link=topic=1391.msg3863#msg3863 date=1254073703]
    Hi,

    I want to know if the constraint line can be write in 2 (or more) lines.

    Example:

    Maximize
    x1 + x2 + x3 + ...
    + x1001 + 1002 + 1003

    Subject To
    x1 + x2 + x3 + ...
    + x1001 + 1002 + 1003 <= 500<br />
    End

    Thanks!

    Leandro Mengue




    I think you need not care about this problem when creating the LP file. You just need to write a new contratint in a new line. Suppose you use c program to create this file, you just need to switch to a new line uising "\n" in fprintf. 
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX LP Format / Constraints lines

    Posted 09/27/09 11:23 PM

    Originally posted by: SystemAdmin


    [Mengue said:]

    Ok, so I understand that CPLEX will recognize that the end of constraint will be the line that has "<=", and that the next line is a new constraint, correct?<br />
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: CPLEX LP Format / Constraints lines

    Posted 09/27/09 11:30 PM

    Originally posted by: SystemAdmin


    [Mengue said:]

    To be more especific: my contraint have a big length (+/- 5000 characters) like:

    x1 + x2 + x3 + ... + x1001 + x1002 <= 500<br />
    Remember that the line have a maximun lenght of 560 characters...

    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: CPLEX LP Format / Constraints lines

    Posted 09/27/09 11:52 PM

    Originally posted by: SystemAdmin


    [shaon said:]

    [quote author=Mengue link=topic=1391.msg3867#msg3867 date=1254076205]
    To be more especific: my contraint have a big length (+/- 5000 characters) like:

    x1 + x2 + x3 + ... + x1001 + x1002 <= 500<br />
    Remember that the line have a maximun lenght of 560 characters...



    In my experience, I also have many variables in each constraint. When creating the .LP file, I just enumerated each variable and then added "<= a" and switched to next line. I never cared about the maximum length. I still do not know the maximum length you mentioned.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: CPLEX LP Format / Constraints lines

    Posted 09/28/09 12:31 AM

    Originally posted by: SystemAdmin


    [Mengue said:]

    I see in the manual:

    "The maximum length of any line of input is 560" -> from "ILOG CPLEX 10.0 File Formats" at "LP File Format"

    But, if I understand, you have a constraint line with lenght bugger thar 560, correct? And it works?

    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: CPLEX LP Format / Constraints lines

    Posted 10/05/09 10:51 PM

    Originally posted by: SystemAdmin


    [achterberg said:]

    You can use as many lines as you want for the objective function and each constraint. In this regard, a newline '\n' is just treated as a space ' ' in the parser. Of course, you should not break variable names or numbers ;)

    #CPLEXOptimizers
    #DecisionOptimization