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

Initial point is incorrectly classified as infeasible #49

Closed
adowling2 opened this issue Apr 19, 2017 · 5 comments · Fixed by #52
Closed

Initial point is incorrectly classified as infeasible #49

adowling2 opened this issue Apr 19, 2017 · 5 comments · Fixed by #52
Labels

Comments

@adowling2
Copy link

adowling2 commented Apr 19, 2017

Summary: When I use SCIP.jl to pass a MINLP JuMP model to SCIP, the solve complains the initial point is infeasible. When I use AmplNLWriter to send the same model to SCIP, it correctly classifies the initial point as feasible.

Example:

using JuMP, SCIP, AmplNLWriter

# Switch between interfaces to SCIP
#m = Model(solver=SCIPSolver())
m = Model(solver=AmplNLSolver("/opt/scipoptsuite-4.0.0/scip-4.0.0/interfaces/ampl/bin/scipampl"))

@variable(m, 0 <= x[1:3] <= 10, start=5.0)
@variable(m, y, Bin, start=1.0)

@NLconstraint(m, x[1] + x[2] <= x[3]*y)
@constraint(m, x[1] - x[2] == 0)

@objective(m, Min, x[1])

# This makes the initial point feasible
setvalue(x[3], 10.0)

solve(m)

Using SCIP.jl:

  [nonlinear] <nonlin_obj>: (1 * <_var0_>)-1<_var4_>[C]  <= 0;
violation: right hand side is violated by 5 (scaled: 5)
all 1 solutions given by solution candidate storage are infeasible

feasible solution found by trivial heuristic after 0.0 seconds, objective value 0.000000e+00
presolving:
(round 1, fast)       0 del vars, 0 del conss, 0 add conss, 0 chg bounds, 0 chg sides, 0 chg coeffs, 3 upgd conss, 0 impls, 0 clqs
(round 2, fast)       2 del vars, 2 del conss, 0 add conss, 2 chg bounds, 0 chg sides, 0 chg coeffs, 3 upgd conss, 0 impls, 0 clqs
presolving (3 rounds: 3 fast, 0 medium, 0 exhaustive):
 3 deleted vars, 2 deleted constraints, 0 added constraints, 2 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients
 0 implications, 0 cliques
transformed 1/1 original solutions to the transformed problem space
Quadratic constraint handler does not have LAPACK for eigenvalue computation. Will assume that matrices (with size > 2x2) are indefinite.
Presolving Time: 0.01

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 0.01
Solving Nodes      : 0
Primal Bound       : +0.00000000000000e+00 (1 solutions)
Dual Bound         : +0.00000000000000e+00
Gap                : 0.00 %
:Optimal

Using AmplNLWriter:

SCIP version 4.0.0 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: CPLEX 12.6.3.0] [GitHash: a80a247]
Copyright (C) 2002-2017 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)

External codes: 
  CPLEX 12.6.3.0       Linear Programming Solver developed by IBM (www.cplex.com)
  CppAD 20160000.1     Algorithmic Differentiation of C++ algorithms developed by B. Bell (www.coin-or.org/CppAD)
  Ipopt 3.12.4         Interior Point Optimizer developed by A. Waechter et.al. (www.coin-or.org/Ipopt)
  ASL                  AMPL Solver Library developed by D. Gay (www.netlib.com/ampl)


number of parameters = 2137
non-default parameter settings:


read problem </home/adowling2/.julia/v0.5/AmplNLWriter/.solverdata/tmpVJvBW1.nl>
============

original problem has 4 variables (1 bin, 0 int, 0 impl, 3 cont) and 2 constraints

1/1 feasible solution given by solution candidate storage, new primal bound 5.000000e+00

feasible solution found by trivial heuristic after 0.0 seconds, objective value 0.000000e+00
presolving:
presolving (1 rounds: 1 fast, 0 medium, 0 exhaustive):
 0 deleted vars, 0 deleted constraints, 0 added constraints, 0 tightened bounds, 0 added holes, 0 changed sides, 0 changed coefficients
 0 implications, 0 cliques
transformed 3/3 original solutions to the transformed problem space
Presolving Time: 0.00

SCIP Status        : problem is solved [optimal solution found]
Solving Time (sec) : 0.01
Solving Nodes      : 0
Primal Bound       : +0.00000000000000e+00 (3 solutions)
Dual Bound         : +0.00000000000000e+00
Gap                : 0.00 %

optimal solution found

:Optimal

Perhaps this is a red herring, but notice the warning message about LAPACK eigenvalue computation with SCIP.jl. Including Ipopt is supposed to provide an interface to LAPACK. Using the AMPL executable for SCIP, we see that Ipopt is included as an external code and the warning message is absent.

Edit x2: Using @NLobjective instead of @objective results in the same behavior.

@adowling2 adowling2 changed the title Initial point is incorrectly declared as infeasible Initial point is incorrectly classified as infeasible Apr 19, 2017
@rschwarz
Copy link
Collaborator

Your observation about LAPACK and IPOPT is correct. However, whether you compile SCIP with IPOPT support is independent to SCIP.jl. Our instructions do not use IPOPT, but you can, by setting IPOPT=TRUE in the make call. SCIP.jl should work just the same.

Whether or not this has anything to do with your solution candidate, I can not tell. I know that we (in SCIP.jl) do not yet support incomplete initial solutions, where only values for some of the variables are given. But in your example, some solution is apparently set, and tested.

@adowling2
Copy link
Author

@leethargo Thank you for the quick reply.

I compiled with IPOPT=true.

Looking closer at the output

  [nonlinear] <nonlin_obj>: (1 * <_var0_>)-1<_var4_>[C]  <= 0;
violation: right hand side is violated by 5 (scaled: 5)
all 1 solutions given by solution candidate storage are infeasible

from my example, I noticed the variables go from var0 to var4. However, there are only 4 variables in the example. You mentioned that SCIP.jl does not support incomplete solution candidates. Is it possible that SCIP.jl is adding an extra dummy variable which happens to be uninitialized?

@rschwarz
Copy link
Collaborator

I think the (lack of support for) incomplete solution candidates is not the issue.

If I look at the violated constraint, it looks like this constraint is created automatically (together with the variable _var4_ during the process of transforming the nonlinear constraints for SCIP. Unfortunately, the auxiliary variable _var4_ will apparently take the value 0 for the solution candidate, which is infeasible.

So, this is a bug in either SCIP.jl or CSIP.

@rschwarz
Copy link
Collaborator

Sorry, this does not look like an easy fix.

@fserra
Copy link
Collaborator

fserra commented Apr 19, 2017

yes, somehow, we need to evaluate the objective function at the point given and then assign the extra variable to that value

rschwarz added a commit that referenced this issue Jun 9, 2017
rschwarz added a commit that referenced this issue Jun 9, 2017
update CSIP to 0.4.1, add test for #49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants