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

Compute IIS #36

Merged
merged 10 commits into from
Jul 14, 2019
Merged

Compute IIS #36

merged 10 commits into from
Jul 14, 2019

Conversation

dourouc05
Copy link
Contributor

Following jump-dev/JuMP.jl#1035: implement IIS support in a second package.

This is just the first basic, baby step: retrieve data from the solver (only low-level API). It is only tested when the model is feasible, right now. I don't see any general use of the values of the duals nor the isolation thing, as they are very specific to Xpress (as far as I can tell). Or should I still implement them in this PR? (Maybe using optional parameters to getfirstiis?) Also, I ignore the fact that Xpress can compute several IISes: maybe there should be another function to return them all, or a variant that returns an IIS iterator? (Just thinking out loud, right now, but I'd like feedback on these ideas, especially on whether they should be implemented in this PR or not.)

I tried to be as close as possible to jump-dev/CPLEX.jl#233 (even copy-pasting the comments).

dourouc05 added 7 commits May 7, 2019 19:37
Right now, only tested when the model is feasible.
  Got exception outside of a @test

  Stacktrace:
   [1] error(::String) at .\error.jl:33
   [2] get_error_msg(::Xpress.Model) at C:\Users\kwsq4764\.julia\dev\Xpress\src\xprs_model.jl:82
   [3] Xpress.XpressError(::Xpress.Model) at C:\Users\kwsq4764\.julia\dev\Xpress\src\xprs_model.jl:99
   [4] getfirstiis(::Xpress.Model) at C:\Users\kwsq4764\.julia\dev\Xpress\src\xprs_model.jl:417
   [5] compute_conflict(::Xpress.Optimizer) at C:\Users\kwsq4764\.julia\dev\Xpress\src\MOIWrapper.jl:573
   [6] top-level scope at C:\Users\kwsq4764\.julia\dev\Xpress\test\MOIWrapper.jl:152
   [7] top-level scope at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Test\src\Test.jl:1083
   [8] top-level scope at C:\Users\kwsq4764\.julia\dev\Xpress\test\MOIWrapper.jl:142
   [9] top-level scope at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Test\src\Test.jl:1083
   [10] top-level scope at C:\Users\kwsq4764\.julia\dev\Xpress\test\MOIWrapper.jl:90
   [11] top-level scope at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Test\src\Test.jl:1083
   [12] top-level scope at C:\Users\kwsq4764\.julia\dev\Xpress\test\MOIWrapper.jl:89
   [13] include at .\boot.jl:326 [inlined]
   [14] include_relative(::Module, ::String) at .\loading.jl:1038
   [15] include at .\sysimg.jl:29 [inlined]
   [16] include(::String) at .\loading.jl:1073
   [17] top-level scope at none:0
   [18] eval at .\boot.jl:328 [inlined]
   [19] evalfile(::String, ::Array{String,1}) at .\loading.jl:1069 (repeats 2 times)
   [20] top-level scope at C:\Users\kwsq4764\.julia\dev\Xpress\test\runtests.jl:29 [inlined]
   [21] top-level scope at .\none:0
   [22] include at .\boot.jl:326 [inlined]
   [23] include_relative(::Module, ::String) at .\loading.jl:1038
   [24] include(::Module, ::String) at .\sysimg.jl:29
   [25] include(::String) at .\client.jl:403
   [26] top-level scope at none:0
   [27] eval(::Module, ::Any) at .\boot.jl:328
   [28] exec_options(::Base.JLOptions) at .\client.jl:243
   [29] _start() at .\client.jl:436
@dourouc05
Copy link
Contributor Author

dourouc05 commented May 9, 2019

I guess that's pretty much it. I added tests for the C API, plus the MOI interface (basically, a copy-paste from CPLEX), plus tests. I had to remove everything that relates to SingleVariable, as it is not supported for Xpress.

Right now, all the new tests are passing (I have many issues with the MOI tests not passing, most of them being that SingleVariable is not supported).

Regarding the access to several IISes, I think it would be best to way until jump-dev/JuMP.jl@79f279a#diff-a4299a42a71a0a4a853f0c4324ce54ddR27 is solved (access to several solutions, which I believe is not possible for all solvers; then we can copy the mechanism for IISes).

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that the tests all pass. Looks good. It would be good to fix existing tests (in another PR). We shouldn't be in the state that tests are failing.

@dourouc05 dourouc05 changed the title [WIP] Compute IIS Compute IIS May 9, 2019
Copy link
Member

@joaquimg joaquimg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to figure out whats the reason for tests not passing. We have to see what CPLEX and gurobi interfaces implement that we don't.

@dourouc05
Copy link
Contributor Author

There is no difference in SUPPORTED_CONSTRAINTS with, for instance, CPLEX, except order and (LQOI.Linear, LQOI.IV), which only Xpress supports. (To ease comparison, maybe there should be guide lines about the order defined at LQOI or MOI level?)

However, two failures are related to start values:

MathOptInterface.UnsupportedAttribute{MathOptInterface.VariablePrimalStart}: Attribute MathOptInterface.VariablePrimalStart() is not supported by the model.

I could not find the relevant functions to call in Xpress in their manual, except for "warm-starting is nice when you reoptimize". I guess it means the user cannot specify a solution? For now, I used the same solution as CPLEX: disable the corresponding tests.

There are also a couple of warnings about MPB:

running mathprog.jl ...
Testing linproginterface with solver Xpress.XpressSolver
Test Summary:                                                                                                         | Pass  Total
Testing LP interface with Xpress.XpressSolver(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()) |   88     88
Done
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\kwsq4764\.julia\packages\MathProgBase\rVlFR\src\HighLevelInterface\HighLevelInterface.jl:9
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\kwsq4764\.julia\packages\MathProgBase\rVlFR\src\HighLevelInterface\HighLevelInterface.jl:9
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\kwsq4764\.julia\packages\MathProgBase\rVlFR\src\HighLevelInterface\HighLevelInterface.jl:9
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\kwsq4764\.julia\packages\MathProgBase\rVlFR\src\HighLevelInterface\HighLevelInterface.jl:9
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\kwsq4764\.julia\packages\MathProgBase\rVlFR\src\HighLevelInterface\HighLevelInterface.jl:9
┌ Warning: Element type Int64 does not have an infinite value. Note that this may artifically introduce ranged (two-sided) constraints. To avoid this, consider casting the problem data to Float64.
└ @ MathProgBase.HighLevelInterface C:\Users\kwsq4764\.julia\packages\MathProgBase\rVlFR\src\HighLevelInterface\HighLevelInterface.jl:9
Test Summary:                                                                                 | Pass  Total
Testing linprog and subfunctions with Xpress.XpressSolver(Base.Iterators.Pairs(:PRESOLVE=>0)) |   26     26
Test Summary:                                                                                                       | Pass  Total
Testing mixintprog with Xpress.XpressSolver(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()) |    3      3
Test Summary:                                                                        | Pass  Total
Testing quadprog with Xpress.XpressSolver(Base.Iterators.Pairs(:BARGAPSTOP=>1.0e-9)) |    9      9
Test Summary:                                                                                                           | Pass  Total
Testing SOCP interface with Xpress.XpressSolver(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()) |    3      3
Testing coniclineartest with solver Xpress.XpressSolver
Test Summary:                                                                                                                                    | Pass  Total
Testing linear problems through conic interface with Xpress.XpressSolver(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()) |   24     24
Done
Testing conicSOCtest with solver Xpress.XpressSolver
Test Summary:                                                                                                                                 | Pass  Total
Testing SOC problems through conic interface with Xpress.XpressSolver(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()) |   26     26
Done

Maybe there are still other MOI tests that do not pass, but the tests are just sluggish… (at least on this computer).

@joaquimg
Copy link
Member

those warning are expected.
If CPLEX is disabling the tests we can do the same.

@dourouc05
Copy link
Contributor Author

Should this be merged, now?

@joaquimg
Copy link
Member

Sure, I plan to doublecheck and merge tomorrow.
Thanks for the bump.

@joaquimg joaquimg merged commit d290201 into jump-dev:master Jul 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants