google-research / FirstOrderLp.jl

Experimental first-order solvers for linear and quadratic programming.
Apache License 2.0
103 stars 19 forks source link

How to access the duals of LP #103

Closed ZedongPeng closed 2 years ago

ZedongPeng commented 2 years ago

Expected Behavior

I new to Julia and FirstOrderLp.jl. I am solving a LP using FirstOrderLp.jl and wanna access the dual values after solving it. But I don't know how to do it? Is there any example I can refer to?

mlubin commented 2 years ago

Starting with the example in the README:

julia --project=scripts scripts/solve_qp.jl \
--instance_path test/trivial_lp_model.mps --iteration_limit 5000 \
--method pdhg --output_dir /tmp/first_order_lp_solve

This outputs text files at /tmp/first_order_lp_solve/trivial_lp_model_primal.txt and /tmp/first_order_lp_solve/trivial_lp_model_dual.txt that contain the primal and dual solutions, respectively (one coordinate per line, in text format).

To access the duals via the API, I'd recommend starting with the example in solve_qp.jl.

ZedongPeng commented 2 years ago

Thanks. @mlubin I think issue can be closed.