[SCIP] SCIP and Ipopt
Ambros Gleixner
gleixner at zib.de
Tue Feb 20 07:49:06 CET 2018
Hi Vincent,
SCIP (like virtually all solvers based on floating-point arithmetics)
uses tolerances to check feasibility and integrality. Anything with a
fractionality below 1e-9 (parameter numerics/epsilon) is consider
integral, so also the value 0.999999999999998 that you saw in your
solution. You can use SCIPisIntegral() to check or SCIPround() to round
solution values in the C API.
Best,
Ambros
Am 20.02.2018 um 03:40 schrieb Vincent Mirian:
> Hi Benny.
>
> Thank you for your response. Currently, I am using the LP format with SCIP.
>
> I create a problem (attached). In the problem I defined a
> variable AssignC4BLK0 and AssignC10BLK1 as binaries. However, the output
> assigns a non-binary to these variables. Is there something that I am
> doing incorrectly? Or is this natural behavior from SCIP?
>
> Regards.
>
> On Wed, Feb 14, 2018 at 1:55 AM, Benjamin Müller
> <benjamin.mueller at zib.de <mailto:benjamin.mueller at zib.de>> wrote:
>
> Hi Vincent,
>
> you did two mistakes:
>
> 1. <y#0> should have a coefficient of 1 in the objective.
>
> 2. You declared your quadratic constraint to be linear and there
> were also some semantic problems.
>
> Your model should actually look like:
>
> STATISTICS
> Problem name : test.cip
> Variables : 5 (0 binary, 5 integer, 0 implicit integer, 0
> continuous)
> Constraints : 0 initial, 5 maximal
> OBJECTIVE
> Sense : minimize
> VARIABLES
> [integer] <c#0b#0>: obj=0, original bounds=[0,1]
> [integer] <c#1b#0>: obj=0, original bounds=[0,1]
> [integer] <c#0b#1>: obj=0, original bounds=[0,1]
> [integer] <c#1b#1>: obj=0, original bounds=[0,1]
> [integer] <y#0>: obj=1, global bounds=[0,4], local bounds=[0,4]
> CONSTRAINTS
> [linear] <pack_1>: <c#0b#0>[I] +<c#0b#1>[I] == 1;
> [linear] <pack_2>: <c#1b#0>[I] +<c#1b#1>[I] == 1;
> [linear] <cap_0>: <c#0b#0>[I] +<c#1b#0>[I] <= 1;
> [linear] <cap_1>: <c#0b#1>[I] +<c#1b#1>[I] <= 1;
> [quadratic] <obj_0>: -<c#0b#1>[C] <c#1b#1>[C] -<c#0b#0>[I]
> <c#1b#0>[I] -<y#0>[C] == -4;
> END
>
> Please read your instance with SCIP display the problem in order to
> see how SCIP parsed it.
>
> ./bin/scip -c "read test.cip display problem"
>
> Anyway, I think that you might want to use a modelling language
> instead of dealing with our .cip format. You could, e.g., use ZIMPL,
> AMPL, GAMS, ...
>
> Best,
> Benny
>
> PS: Please don't include the Ipopt mailing any more. Your problems
> are not related to Ipopt.
>
>
>
> On 02/14/2018 07:01 AM, Vincent Mirian wrote:
>
> Hi all.
>
> Thanks for the reply Benny.
>
> I created the following input file to the framework.
> STATISTICS
> Problem name : test.cip
> Variables : 5 (0 binary, 5 integer, 0 implicit
> integer, 0 continuous)
> Constraints : 0 initial, 5 maximal
> OBJECTIVE
> Sense : minimize
> VARIABLES
> [integer] <c#0b#0>: obj=0, original bounds=[0,1]
> [integer] <c#1b#0>: obj=0, original bounds=[0,1]
> [integer] <c#0b#1>: obj=0, original bounds=[0,1]
> [integer] <c#1b#1>: obj=0, original bounds=[0,1]
> [integer] <y#0>: obj=0, global bounds=[0,4], local bounds=[0,4]
> CONSTRAINTS
> [linear] <pack_1>: <c#0b#0>[I] +<c#0b#1>[I] == 1;
> [linear] <pack_2>: <c#1b#0>[I] +<c#1b#1>[I] == 1;
> [linear] <cap_0>: <c#0b#0>[I] +<c#1b#0>[I] <= 1;
> [linear] <cap_1>: <c#0b#1>[I] +<c#1b#1>[I] <= 1;
> [linear] <obj_0>: -<c#0b#1>[I]*<c#1b#1>[I]*1
> -<c#0b#0>[I]*<c#1b#0>[I]*1 +4 -<y#0> == 0;
> END
>
> The results should assign y#0 to 4. However, I get the following
> output (snippet of output to reduce length):
>
> presolving (1 rounds: 1 fast, 1 medium, 1 exhaustive):
> 5 deleted vars, 5 deleted constraints, 0 added constraints, 1
> tightened bounds, 0 added holes, 0 changed sides, 0 changed
> coefficients
> 0 implications, 0 cliques
> presolved problem has 0 variables (0 bin, 0 int, 0 impl, 0 cont)
> and 0 constraints
> transformed objective value is always integral (scale: 1)
> Presolving Time: 0.00
>
> objective value: 0
> c#0b#0 1 (obj:0)
> c#1b#1 1 (obj:0)
>
> The assignment of c#0b#0 and c#1b#1 are valid solutions. I am
> confused on the reason that the objective value is 0. I am
> assume that the objective value is y#0, since it is the only
> variable not stated. The value of y#0 should be 4.
>
> Some guidance would be appreciated. Note that I searched the
> SCIP mailing list archive but I did not find any references for
> the input format and description of the output.
>
> Any help would be appreciated. Thank you.
>
>
>
> On Tue, Feb 13, 2018 at 11:38 PM, Benjamin Müller
> <benjamin.mueller at zib.de <mailto:benjamin.mueller at zib.de>
> <mailto:benjamin.mueller at zib.de
> <mailto:benjamin.mueller at zib.de>>> wrote:
>
> Hi Vincent,
>
> I would recommend using JSCIPOpt, which is our SCIP-Java
> interface
> that can be found here:
>
> https://github.com/SCIP-Interfaces/JSCIPOpt
> <https://github.com/SCIP-Interfaces/JSCIPOpt>
> <https://github.com/SCIP-Interfaces/JSCIPOpt
> <https://github.com/SCIP-Interfaces/JSCIPOpt>>
>
> All relevant steps for building the interface are listed in the
> INSTALL.md, but basically, you will need to download the
> latest SCIP
> Optimization Suite and compile it with Ipopt. You might
> want to have
> a look at the JSCIPOpt/examples/Quadratic, which shows how
> to model
> a problem with simple quadratic constraints.
>
> Please note that SCIP can't handle a nonlinear objective
> function.
> For this reason, you need to add an auxiliary variable z
> and then
> model your problem as
>
> min z
> z >= sum_{ij} X_{ij} Y_{ij}
> ...
>
> Best,
> Benny
>
> On 02/13/2018 07:05 PM, Vincent Mirian wrote:
>
> HI all.
>
> I am new to the SCIP community.
>
> I am looking for a non-linear solver to solve:
> - an objective function similar to 0 <= sum over i and
> j of X_ij
> * Y_ij * Constant < max
> - with constraints similar tosum(X_ij) = 1 and
> sum(Y_ij) = 1
> (forcing the values of X_ij and Y_ij to zero or one). A
> solution
> would be sufficient (it can be local or global optimal).
>
> I would need to interface the solver with Java. I found
> Google
> Optimization Tools (OR-Tools) to interface SCIP with
> java. Note
> that this work is for academic research.
>
> - Would SCIP or Ipopt be suitable for my task? Would
> anyone have
> experience integrating SCIP or Ipopt into Java?
> - I'm using a machine with ubuntu 64-bit. Are there any
> issues
> with installing these tools in this machine environment?
> - What is the manner to describe the constraints and
> objective
> function using these tools?
>
> Thank you.
> -- Vincent Mirian
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de <mailto:Scip at zib.de> <mailto:Scip at zib.de
> <mailto:Scip at zib.de>>
> https://listserv.zib.de/mailman/listinfo/scip
> <https://listserv.zib.de/mailman/listinfo/scip>
> <https://listserv.zib.de/mailman/listinfo/scip
> <https://listserv.zib.de/mailman/listinfo/scip>>
>
>
> -- ______________________________
> Benjamin Müller
> Zuse Institute Berlin
> Takustr. 7, 14195 Berlin
> benjamin.mueller at zib.de <mailto:benjamin.mueller at zib.de>
> <mailto:benjamin.mueller at zib.de <mailto:benjamin.mueller at zib.de>>
> +49 30 841 85-195 <tel:%2B49%2030%20841%2085-195>
> <tel:%2B49%2030%20841%2085-195>
>
>
>
>
> --
> Vincent Mirian
>
>
> --
> ______________________________
> Benjamin Müller
> Zuse Institute Berlin
> Takustr. 7, 14195 Berlin
> benjamin.mueller at zib.de <mailto:benjamin.mueller at zib.de>
> +49 30 841 85-195 <tel:%2B49%2030%20841%2085-195>
>
>
>
>
> --
> Vincent Mirian
>
>
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> https://listserv.zib.de/mailman/listinfo/scip
>
--
Ambros Gleixner, Research Group Mathematical Optimization Methods at
Zuse Institute Berlin, http://www.zib.de/gleixner
More information about the Scip
mailing list