jump-dev / Pajarito.jl

A solver for mixed-integer convex optimization
Mozilla Public License 2.0
131 stars 22 forks source link

getobjbound for conic_to_LPQP #338

Closed chriscoey closed 7 years ago

chriscoey commented 7 years ago

@mlubin, in new QP tests

QP maximize: Error During Test
  Got an exception of type MethodError outside of a @test
  MethodError: no method matching getobjbound(::MathProgBase.SolverInterface.ConicToLPQPBridge)
  Closest candidates are:
    getobjbound(!Matched::GLPKMathProgInterface.GLPKInterfaceMIP.GLPKMathProgModelMIP) at /home/coey/.julia/v0.5/GLPKMathProgInterface/src/GLPKInterfaceMIP.jl:549
    getobjbound(!Matched::Cbc.CbcMathProgSolverInterface.CbcMathProgModel) at /home/coey/.julia/v0.5/Cbc/src/CbcSolverInterface.jl:190
    getobjbound(!Matched::Mosek.MosekMathProgSolverInterface.MosekLinearQuadraticModel) at /home/coey/.julia/v0.5/Mosek/src/MosekLPQCQPInterface.jl:661
chriscoey commented 7 years ago

also one test isn't passing there because the answer is a factor of 2 off. it could be caused by maybe forgetting the 2 in the RSOC?

getobjectivevalue(m) = 8.022765808609499
QP large (cardls): Test Failed
  Expression: isapprox(getobjectivevalue(m),16.045564,atol=TOL)
mlubin commented 7 years ago

Try out https://github.com/JuliaOpt/MathProgBase.jl/pull/160 for the getobjbound issue.

With

@variable(m, w == 2)
@constraint(m, sum(t.^2) <= u*w)

You get u >= sum(t.^2)/2. Is that what you want?

chriscoey commented 7 years ago

Yes, I wrote that part correctly.

On Mar 29, 2017 10:46 AM, "Miles Lubin" notifications@github.com wrote:

Try out JuliaOpt/MathProgBase.jl#160 https://github.com/JuliaOpt/MathProgBase.jl/pull/160 for the getobjbound issue.

With

@variable(m, w == 2)@constraint(m, sum(t.^2) <= u*w)

You get u >= sum(t.^2)/2. Is that what you want?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaOpt/Pajarito.jl/issues/338#issuecomment-290113316, or mute the thread https://github.com/notifications/unsubscribe-auth/AJq0k6hJnJOFk6BSqVnGhCWH_MI-3Yfdks5rqm63gaJpZM4Msim6 .

mlubin commented 7 years ago

So the objective is to minimize sum(t.^2)/2 + rho*sum(x.^2)/2?

chriscoey commented 7 years ago

Yes

On Mar 29, 2017 10:53 AM, "Miles Lubin" notifications@github.com wrote:

So the objective is to minimize sum(t.^2)/2 + rho*sum(x.^2)/2?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaOpt/Pajarito.jl/issues/338#issuecomment-290115653, or mute the thread https://github.com/notifications/unsubscribe-auth/AJq0kxHwia_ndsawslpDKzPm4FCtZr_Tks5rqnBzgaJpZM4Msim6 .

mlubin commented 7 years ago

The constraints are being enforced as written:

julia> sum(getvalue(t).^2)/2 + rho*sum(getvalue(x).^2)/2
8.022766055303913

julia> getobjectivevalue(m)
8.022766159395793
chriscoey commented 7 years ago

Then that is the correct objective. But the conic tests pass with objective twice that, suggesting an issue with conic to lpqp

On Mar 29, 2017 11:00, "Miles Lubin" notifications@github.com wrote:

The constraints are being enforced as written:

julia> sum(getvalue(t).^2)/2 + rho*sum(getvalue(x).^2)/2 8.022766055303913

julia> getobjectivevalue(m) 8.022766159395793

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaOpt/Pajarito.jl/issues/338#issuecomment-290117798, or mute the thread https://github.com/notifications/unsubscribe-auth/AJq0k7GUtmAbOyRYbzRCLvH4wJlnF9X-ks5rqnH7gaJpZM4Msim6 .

mlubin commented 7 years ago

That suggests an issue with the conic formulation, not conic to lpqp.

chriscoey commented 7 years ago

I don't understand. There is only one formulation.

On Mar 29, 2017 11:12 AM, "Miles Lubin" notifications@github.com wrote:

That suggests an issue with the conic formulation, not conic to lpqp.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaOpt/Pajarito.jl/issues/338#issuecomment-290121684, or mute the thread https://github.com/notifications/unsubscribe-auth/AJq0kxmptIT-8tUmquJWmHfAP_Qf1HV8ks5rqnTqgaJpZM4Msim6 .

mlubin commented 7 years ago

What solver is reporting 16.045564?

chriscoey commented 7 years ago

All.

Could be a bug in pajarito too.

On Mar 29, 2017 11:17 AM, "Miles Lubin" notifications@github.com wrote:

What solver is reporting 16.045564?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaOpt/Pajarito.jl/issues/338#issuecomment-290123188, or mute the thread https://github.com/notifications/unsubscribe-auth/AJq0k6zCUnvPmvqbUckAcsZE1fPHKy8Iks5rqnYAgaJpZM4Msim6 .

mlubin commented 7 years ago

I was testing with mosek above through conic_to_lpqp and it was giving the right answer.

On Mar 29, 2017 11:25, "Chris C." notifications@github.com wrote:

All.

Could be a bug in pajarito too.

On Mar 29, 2017 11:17 AM, "Miles Lubin" notifications@github.com wrote:

What solver is reporting 16.045564?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaOpt/Pajarito.jl/issues/338# issuecomment-290123188, or mute the thread https://github.com/notifications/unsubscribe-auth/ AJq0k6zCUnvPmvqbUckAcsZE1fPHKy8Iks5rqnYAgaJpZM4Msim6 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/JuliaOpt/Pajarito.jl/issues/338#issuecomment-290125669, or mute the thread https://github.com/notifications/unsubscribe-auth/ABp0M7jBBbqaz225upLi1_OcWvZ9M7j3ks5rqnfNgaJpZM4Msim6 .

chriscoey commented 7 years ago

OK this seems to be fixed.

Tests passing when on MPB master.