Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linprog, quadprog, and mixintprog #24

Closed
mlubin opened this issue Jul 12, 2017 · 21 comments
Closed

linprog, quadprog, and mixintprog #24

mlubin opened this issue Jul 12, 2017 · 21 comments

Comments

@mlubin
Copy link
Member

mlubin commented Jul 12, 2017

These should be renamed without the prog and perhaps moved to a separate package. I don't see a good reason why these three particular functions should be in MOI itself.

Relevant: http://www.juliaopt.org/MathOptInterface.jl/latest/apimanual.html#A-more-complex-example:-solveintegerlinear-1

@mlubin mlubin mentioned this issue Jul 12, 2017
51 tasks
@joaquimg
Copy link
Member

I agree they should be in a separate package.

@mlubin
Copy link
Member Author

mlubin commented Jul 12, 2017

SolveAndForget.jl

@joaquimg
Copy link
Member

HighLevelMathOptInterface.jl

@rschwarz
Copy link
Contributor

MathOptStandardForm.jl or MatrixMathOpt.jl

Compared to JuMP or Convex, it's actually not so high-level, right?

@joaquimg
Copy link
Member

If the functions remain with the old names linprog and mixintprog we could name it MatrixMathProg.jl
If we use MatrixMathOpt.jl we can rename the functions to linopt and mixintopt

@mlubin
Copy link
Member Author

mlubin commented Jul 14, 2017

@chriscoey would argue for trashing the linprog-style names and calling the functions solve_LP, solve_MIP or something along those lines. No real reason to imitate the uninformative Matlab names here.

@chriscoey
Copy link
Contributor

Miles knows me too well. Yes, those names make me cringe.

@blegat
Copy link
Member

blegat commented Dec 31, 2017

What about something like

struct MatrixLP{T} <: AbstractStandaloneInstance
    c::AbstractVector{T}
    A::AbstractMatrix{T}
    lb::AbstractVector{T}
    ub::AbstractVector{T}
    l::AbstractVector{T}
    u::AbstractVector{T}
end
# Implements all MOI.get it can but no MOI.set!

The user can then do

MOI.copy!(solver, MatrixLP(c, A, lb, ub, l, u))

The name could be MatrixOptInterface.jl (MXOI) to mimic SemidefiniteOptInterface (SDOI), LinQuadOptInterface (LQOI) and StochOptInterface (SOI).

@mlubin
Copy link
Member Author

mlubin commented Dec 31, 2017

@blegat, I like that idea. Couldn't MatrixLP just create an MOIU.Instance and load the data in, instead of defining a new instance type?

@mlubin
Copy link
Member Author

mlubin commented Jan 1, 2018

MatrixLP could have a special convention for the variable and constraint indices (aligning with the A matrix), so I see why we might want a separate implementation of AbstractStandaloneInstance.

@blegat
Copy link
Member

blegat commented Jan 1, 2018

Yes, either that or MatrixLP also returns a vector of variable indices and a vector of constraint indices

@mlubin
Copy link
Member Author

mlubin commented Jan 1, 2018

MatrixLP also returns a vector of variable indices and a vector of constraint indices

That seems entirely unnecessary. When you create an array to store n things, the array doesn't return the list of indices 1, ..., n.

@blegat
Copy link
Member

blegat commented Jan 1, 2018

I meant, either MatrixLP is a separate implementation or it returns an MOIU instance with a vector of variables indices and a vector of constraint indices.

@mlubin
Copy link
Member Author

mlubin commented Jan 1, 2018

Ah. Well, a separate implementation would also be a useful code example that people will be able to understand without all the complexities of the MOIU instance.

@blegat
Copy link
Member

blegat commented Jan 1, 2018

Yes, the behaviour of the other solution can be recovered by doing

MOIU.@instance LPInstance ...
instance = LPInstance()
MOI.copy!(instance, MatrixLP(...))

@mlubin
Copy link
Member Author

mlubin commented Jan 1, 2018

It feels like we have the right abstractions now, I didn't expect that to be so easy :)

@mlubin
Copy link
Member Author

mlubin commented Feb 1, 2019

This is a good up for grabs issue. I support @blegat's LPInstance idea over a linprog copy. This can stay in the MOI package. We changed our philosophy about splitting off packages since this issue was last discussed.

@joaquimg
Copy link
Member

joaquimg commented Feb 2, 2019

I was thinking, maybe it could live in LinQuad, and it might be good to use the linquad mocksolver to generate the matrix instances (which is the other way).
Something else I was thinking is to have ConicOptInterface, since a very similar code is used in SCS, ECOS, ProxSDP and maybe more.

@blegat
Copy link
Member

blegat commented Feb 2, 2019

Something else I was thinking is to have ConicOptInterface, since a very similar code is used in SCS, ECOS, ProxSDP and maybe more.

What can be shared by these interfaces is building a matrix similar to the MPB conic interface using the allocate-load interface.
I agree that we could have something like an AbstractMatrixConicOptimizer <: AbstractOptimizer to share that.

@joaquimg
Copy link
Member

joaquimg commented Apr 9, 2019

I started playing around with this in https://github.com/joaquimg/MatrixOptInterface.jl
Just a sketch for now, but comments would be nice.
(zero performance optimization so far)

@odow
Copy link
Member

odow commented Aug 12, 2021

Closing because we have https://github.com/jump-dev/MatrixOptInterface.jl although it still needs some work.

We also have documentation to explain how to transition to JuMP:
https://jump.dev/MathOptInterface.jl/dev/tutorials/mathprogbase/#Transitioning-the-high-level-functions

@odow odow closed this as completed Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants