Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Solve a matrix equation with ILP?

    Posted 12/29/12 07:04 AM

    Originally posted by: SystemAdmin


    Hello, everyone! I would like to solve with CPLEX a matrix equation of the form:

    n1 = n0 + C*x.

    n1 and n0 as well as C (three matrices) are given, x must be calculated (integer solution).

    For example see the attached file. The last matrix with 1 column and 3 rows is not given and must be found.

    I'm new to CPLEX, any help is very much appreciated!

    Thanks in advance!
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Solve a matrix equation with ILP?

    Posted 12/29/12 12:00 PM

    Originally posted by: SystemAdmin


    Hello,

    You can do something like this:

    Minimize 
    Obj: c1 + c2 + c3
    Subject To
    R1: -2c1 + c2 + c3 = 1
    R2: c1 - c2 = 0
    R3: c1 - c3 = -1
    R4: -2c2 + 2c3 = 2
    General
    c1 c2 c3
    End
    


    The solution to this is 0, 0, 1.

    You could either use C callable library or C++/Java Concert or some other means that you are comfortable with, to load your matrix into CPLEX data structures. Once you do that, then you can use any of the CPLEX optimizers to solve the problem. In case of many solutions to your problem, the above would find the minimum of the sum. You could try other functions too.

    Regards,
    Vivek.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Solve a matrix equation with ILP?

    Posted 12/29/12 01:07 PM

    Originally posted by: SystemAdmin


    Hello VivekPeriaraj,

    thank you very much! I was looking for it, it is great!

    I have two questions:

    1) What function can I use to store/enumerate all possible solutions (if there are more then 1 solution).
    2) I am going to use Java to load the matrix into CPLEX and then get the results back into the program. I am familiar with Java, however I am new to CPLEX. Could you give me some code examples, how to load data (the above matrix) into CPLEX and how to get the results back?

    Your help is greatly appreciated!
    Thank you!
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Solve a matrix equation with ILP?

    Posted 12/29/12 02:01 PM

    Originally posted by: SystemAdmin


    Hi Mark,

    1) You could use the 'solution pool' feature of CPLEX to do that. You can find more abt it here:

    http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r3/index.jsp?topic=%2Filog.odms.cplex.help%2FContent%2FOptimization%2FDocumentation%2FOptimization_Studio%2F_pubskel%2Fps_usrmancplex1900.html

    2) You can find many examples in the CPLEX install directory. In my install, I find it here -> cplex/examples/src/java

    Regards,
    Vivek.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Solve a matrix equation with ILP?

    Posted 12/29/12 04:11 PM

    Originally posted by: SystemAdmin


    Thank you VivekPeriaraj,

    I will try to use that feature. Then I will get familiar with the available examples in the CPLEX install directory and try to implement my program.

    Thanks again.
    Best regards.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Solve a matrix equation with ILP?

    Posted 12/30/12 10:06 AM

    Originally posted by: SystemAdmin


    Hello, One point to note is that the enumerate from the solution pool would only populate feasible solutions that the optimizer find while it parses through the tree and not all of them like you want.

    Good luck!

    Vivek.
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Solve a matrix equation with ILP?

    Posted 01/02/13 02:25 AM

    Originally posted by: SystemAdmin


    If you set the solution pool intensity while populating the pool then CPLEX should enumerate all feasible solutions.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Solve a matrix equation with ILP?

    Posted 01/02/13 11:15 AM

    Originally posted by: SystemAdmin


    Perfect! Sorry I missed this parameter.

    Regards,
    Vivek.
    #CPLEXOptimizers
    #DecisionOptimization