How to extract a varying Problem Solution in IBM ILOG CPLEX Optimization Studio

207 Views Asked by At

I am trying to find feasible solutions for a specific problem using IBM ILOG CPLEX Optimization Studio. I currently found a method to extract the problem solution using SheetWrite, however, this method requires a predefined range in the excel sheet. I have currently written my .mod file, so that I can provide varying datasets, with different kinds of sizes, resulting in a different size of decision variable for each separate dataset. So far I have not find a way to define the target ranges for SheetWrite using variables depending on the decision variables' sizes. Is this possible?

Are there other options available to extract the problem solution? I would like to post-process the problem solution using either Python or Matlab, so an extract as a textfile with all variables collected would be fine as well.

2

There are 2 best solutions below

0
Chris Bracchi On

So if a textfile is OK you can try to use printSolution. And you'll find more info on SheetWrite here. Chris.

2
TimChippingtonDerrick On

It would be better still to directly call the solver from your Python or Matlab environment, then you could directly query the values of your modelling variables in your solution from the solver. No need to go via a text file, spreadsheet or whatever. The main value of such text files for most people is to manually inspect the solutions etc.