1

I am working on a research problem VRP to be specific. I have a graph of nodes which i break into many sectors and then need to get a solution for each sector using CPLEX, and get the results back to python to keep working on it.

i have already written my results in python to a csv file, but it seems kind of hard to deal with csv files in CPLEX and thought that xml files are more popular and can be used in a better way in my problem. I'm open to other suggestion as well (json for example).

thx in advance

MhmdMnsr
  • 473
  • 1
  • 4
  • 4
  • 1
    Just don't go via text files. Write the problem directly into CPLEX and get the solution variable values back from CPLEX using a proper API. Text files as an intermediate step may be useful for debugging, but are a pain for any real work. – TimChippingtonDerrick Nov 30 '15 at 15:40
  • With the most recent release (12.6.3), the CPLEX Python API supports Python 2.7 and 3.4. If you're willing to use one of those versions, then that would be the way to go. – rkersh Dec 11 '15 at 23:58
  • thank you for your help! – MhmdMnsr Dec 16 '15 at 11:06
  • As for now, i found a way to exchange data between the two environments using xlsx files, and they seem to work just fine for me at the time being. The idea is simple, run CPLEX through the run command (oplrun modfile.mod datfile.dat) using the subprocess class in python. Later on i plan on using the API, but this works just fine now – MhmdMnsr Dec 16 '15 at 11:09

0 Answers0