0

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 Answers2

0

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

0

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.

TimChippingtonDerrick
  • 2,042
  • 1
  • 12
  • 13
  • Is this easy to execute? So far it seems that the newest version of cplex is not very matlab friendly – MazzleFlush Jul 22 '21 at 19:44
  • There is some documentation online, e.g. https://www.ibm.com/docs/en/SSSA5P_12.8.0/ilog.odms.studio.help/pdf/gscplexmatlab.pdf but that is for an older version. It was there in CPLEX 12.9 but seems not to be installed with the latest version of CPLEX. – TimChippingtonDerrick Jul 23 '21 at 22:15