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$
0

1 Answer 1

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.

$\endgroup$
1
  • $\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
    Commented Sep 25, 2020 at 23:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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