2
$\begingroup$

CPLEX writeSolution method outputs both primal and dual variable values of a LP. I know how to parse through the solution file to extract specific primal variable values.

However, is there a build-in way (parameters or options) in CPLEX to just output primal variable values of a LP?

$\endgroup$
2
$\begingroup$

The method writeSolution will always output both primal and dual values.

A MIP Start will not have the dual values. C.f. https://www.ibm.com/support/knowledgecenter/SSSA5P_12.10.0/ilog.odms.cplex.help/CPLEX/FileFormats/topics/MST.html. But MIP Start don’t apply to continuous problems, so that’s not suited to your case.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for the answer. I tried to use writeMIPStart() on a LP solution. CPLEX will throw an exception 'ilog.cplex.CpxException: CPLEX Error 3003: Not a mixed-integer problem.' So I guess I probably should just parse the LP solution file. $\endgroup$ – Qian Zhang Sep 25 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.