Help Couenne


#1

Hello, i’m using Couenne to solve a MINLP problem. It has been running for days now, and during this time, i keep getting messages like this:

Cbc0010I After 26300 nodes, 3934 on tree, 1e+050 best solution, best possible 1 (324734.74 seconds)
Cbc0010I After 26400 nodes, 3918 on tree, 1e+050 best solution, best possible 1.0000347 (325483.56 s
econds)
Optimality Based BT: 0 improved bounds
Optimality Based BT: 21 improved bounds
Cbc0010I After 26500 nodes, 3915 on tree, 1e+050 best solution, best possible 2 (369102.49 seconds)

In my problem, i’m trying to minimize this:

@variable(m, a[i=1:Nt], Bin)
@objective(m, Min, sum(a[i] for i = 1:Nt))

Can anyone explain to me what does that mean? For example, in the first one, it has already solved 26300 problems in the BB tree? and what does 3934 on tree and 1e+050 means? Is the best value of my objective function found so far 1?

This makes sense to me, because i know that if any of those a[i] = 1 i have a viable solution.

But as you can see, in the last message, the best possible is 2. How can this be?


#2

I need to ask something else…

I’ve tested my code with 2 different obj functions.

For obj function 1: It runs for a long time and i got those messages i posted in the first topic. (It didn’t finished runnig, i had to stop the code);
For obj function 2: It says my problem is infeasible.

How is this possible? doesn’t make sense to me.


#3

Could you provide the full code?


#4

The following works fine for me and solves in 0.000749s:

using JuMP
using CouenneNL

m = Model(solver=CouenneNLSolver())
Nt = 5
@variable(m, a[i=1:Nt], Bin)
@objective(m, Min, sum(a[i] for i = 1:Nt))
status = solve(m)
@assert status == :Optimal

This is on Julia 1.0.1. toml files here: https://gist.github.com/tkoolen/5db3908615fbcd7e663d430f0d71176d.


#5

I could, but i would need to attach a function i made and some data i wrote in a .txt file too, so you could run the code. Anyway this can be done here?

Btw, the CouenneNLSolver is already updated to work in Julia 1.0.1? I remember it only used to work in Julia 0.6.


#6

I’m using https://github.com/rdeits/CouenneNL.jl instead, which is just a thin wrapper around AmplNLWriter, doesn’t require you to build from source, and has been updated for 1.0.

1e+050 best solution really means that no feasible point has been found (there is no incumbent). best possible 2 means that a lower bound on the objective value of 2 has been established by the solver (which does not necessarily require finding a feasible point).

Feasibility does not depend on the objective function, so if you’re getting infeasible back for one objective function there’s no sense in trying a different one.

Try removing some constraints and see which ones cause the problem to become infeasible. You also might want to try reducing the size of your problem as you’re debugging the formulation.


#7

Allright, thanks for the info! I’ll try to reduce the size of my problem to see if i can get it to work!

EDIT: Trying to install that to use in Julia 1.0.1, but i keep getting this error:

julia> Pkg.add("CouenneNL")
WARNING: Base.Pkg is deprecated, run `using Pkg` instead
 in module Main
  Updating registry at `C:\Users\Muril\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
ERROR: The following package names could not be resolved:
 * CouenneNL (not found in project, manifest or registry)
Please specify by known `name=uuid`.
Stacktrace:
 [1] pkgerror(::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\shar
e\julia\stdlib\v0.7\Pkg\src\Types.jl:120
 [2] #ensure_resolved#42(::Bool, ::Function, ::Pkg.Types.EnvCache, ::Array{Pkg.Types.PackageSpec,1})
 at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg
\src\Types.jl:890
 [3] #ensure_resolved at .\none:0 [inlined]
 [4] #add_or_develop#13(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{
(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at C:\cygwin\home\A
dministrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:59
 [5] #add_or_develop at .\none:0 [inlined]
 [6] #add_or_develop#12 at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\shar
e\julia\stdlib\v0.7\Pkg\src\API.jl:29 [inlined]
 [7] #add_or_develop at .\none:0 [inlined]
 [8] #add_or_develop#11(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol},NamedTuple{(:mode,),Tuple
{Symbol}}}, ::Function, ::Array{String,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_w
in64\build\usr\share\julia\stdlib\v0.7\Pkg\src\API.jl:28
 [9] add(::String) at .\none:0
 [10] top-level scope at none:0

#8

Follow the instructions at


#9

Hello, i have reduced the size of my problem, and i finally got an answer (not a right answer, but i know why its wrong, and i’m trying to fix that). But it only works with these values:

hsmin = 3;
hsmax = 23;
@variable(m, hsmin <= hs[i=1:Nt] <= hsmax, Int)

I understand if i reduce the value of hsmax, i’m reducing the search space of my problem, and could make it infeasible (but from my experience, it shouldnt be infeasible anyway). I tried increasing it, and it gave me an infeasible result too.

hsmax can only accept odd values here, i tried from 5, 7, ..., 25, 27, 29. And it only works if i use 23.

Any ideas what could be causing this?


#10

Is there anyway i can stop Couenne and get in return the integer solution it found so far?

Since it started to get close to this solution, is starting to take so long to finish. For example, i got this:

Cbc0010I After 95800 nodes, 5974 on tree, 4.1972143 best solution, best possible 4.0000773 (5266.99
seconds)

and after a long time running…

Cbc0010I After 223400 nodes, 10717 on tree, 4.1972143 best solution, best possible 4.062431 (9952.79
 seconds)

I was thinking something like, if the integer solution found differs, say x%, from the best possible, i want to stop it and get the results. Or maybe a time limit after it has found an integer solution.