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

Revamp optimization deps #2923

Merged
merged 15 commits into from
Jan 30, 2022
Merged

Revamp optimization deps #2923

merged 15 commits into from
Jan 30, 2022

Conversation

mforets
Copy link
Member

@mforets mforets commented Jan 28, 2022

No description provided.

@schillic
Copy link
Member

We need at least one more method:

lbounds = zeros(N, m)
ubounds = Inf
sense = fill('=', n + 1)
obj = zeros(N, m)
lp = linprog(obj, A, sense, b, lbounds, ubounds, solver)

@schillic
Copy link
Member

schillic commented Jan 28, 2022

I would prefer to keep the variables before passing to linprog to remember what they mean.

@schillic
Copy link
Member

schillic commented Jan 29, 2022

The current problem is that we cannot obtain an infeasibility ray from the solution anymore.

elseif haskey(lp.attrs, :unboundedray)
ray = lp.attrs[:unboundedray]

MOI describes that case here but I could not find out how to obtain the ray. I think we are supposed to just use the solution then.

@schillic
Copy link
Member

Next error: GLPK.GLPKError("no bf solution found (use GLPK.factorize)"). Not idea what that means.

@mforets
Copy link
Member Author

mforets commented Jan 29, 2022

related? jump-dev/GLPK.jl#116

@mforets
Copy link
Member Author

mforets commented Jan 29, 2022

Locally I get:

LazySets.Star |   72     72
  4.535867 seconds (12.75 M allocations: 712.187 MiB, 4.74% gc time, 98.72% compilation time)
Test Summary:     | Pass  Total
LazySets.Bloating |   72     72
  1.643870 seconds (2.25 M allocations: 136.260 MiB, 2.60% gc time, 95.64% compilation time)
glp_eval_tab_col: basis factorization does not exist
Error detected in file draft/glpapi12.c at line 923

signal (6): Aborted
in expression starting at /home/mforets/.julia/dev/LazySets/test/LazyOperations/Intersection.jl:1
gsignal at /lib64/libc.so.6 (unknown line)
abort at /lib64/libc.so.6 (unknown line)
errfunc at /workspace/srcdir/glpk-5.0/src/env/error.c:53
glp_eval_tab_col at /workspace/srcdir/glpk-5.0/src/draft/glpapi12.c:923
glp_eval_tab_col at /home/mforets/.julia/packages/GLPK/JpN1q/src/gen/libglpk_api.jl:446 [inlined]
_get_unbounded_ray at /home/mforets/.julia/packages/GLPK/JpN1q/src/MOI_wrapper/infeasibility_certificates.jl:102
optimize! at /home/mforets/.julia/packages/GLPK/JpN1q/src/MOI_wrapper/MOI_wrapper.jl:1540
optimize! at /home/mforets/.julia/packages/MathOptInterface/YDdD3/src/Bridges/bridge_optimizer.jl:319
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
optimize! at /home/mforets/.julia/packages/MathOptInterface/YDdD3/src/Utilities/cachingoptimizer.jl:252
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
#optimize!#100 at /home/mforets/.julia/packages/JuMP/qhoVb/src/optimizer_interface.jl:130
optimize! at /home/mforets/.julia/packages/JuMP/qhoVb/src/optimizer_interface.jl:106 [inlined]
optimize! at /home/mforets/.julia/packages/JuMP/qhoVb/src/optimizer_interface.jl:106 [inlined]
linprog at /home/mforets/.julia/dev/LazySets/src/Initialization/init_JuMP.jl:50
linprog at /home/mforets/.julia/dev/LazySets/src/Initialization/init_JuMP.jl:38
σ_helper at /home/mforets/.julia/dev/LazySets/src/Sets/HPolyhedron.jl:190 [inlined]
#ρ#158 at /home/mforets/.julia/dev/LazySets/src/Sets/HPolyhedron.jl:116
ρ at /home/mforets/.julia/dev/LazySets/src/Sets/HPolyhedron.jl:116 [inlined]
#ρ#310 at /home/mforets/.julia/dev/LazySets/src/LazyOperations/Intersection.jl:524
ρ at /home/mforets/.julia/dev/LazySets/src/LazyOperations/Intersection.jl:524 [inlined]
_isbounded_unit_dimensions at /home/mforets/.julia/dev/LazySets/src/Interfaces/LazySet.jl:337
isbounded at /home/mforets/.julia/dev/LazySets/src/LazyOperations/Intersection.jl:549
unknown function (ip: 0x7f00bcd6465d)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
top-level scope at /home/mforets/.julia/dev/LazySets/test/LazyOperations/Intersection.jl:27
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:876
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:830
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:944
eval at ./boot.jl:373 [inlined]
include_string at ./loading.jl:1196
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
_include at ./loading.jl:1253
include at ./client.jl:451 [inlined]
macro expansion at /home/mforets/.julia/dev/LazySets/test/runtests.jl:118 [inlined]
macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
macro expansion at /home/mforets/.julia/dev/LazySets/test/runtests.jl:118 [inlined]
macro expansion at ./timing.jl:220 [inlined]
top-level scope at /home/mforets/.julia/dev/LazySets/test/runtests.jl:118
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:876
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:830
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/toplevel.c:944
eval at ./boot.jl:373 [inlined]
include_string at ./loading.jl:1196
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
_include at ./loading.jl:1253
include at ./Base.jl:418
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
exec_options at ./client.jl:292
_start at ./client.jl:495
jfptr__start_40531.clone_1 at /home/mforets/Tools/julia-1.7.1-linux-x86_64/julia-1.7.1/lib/julia/sys.so (unknown line)
_jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2247 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2429
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
true_main at /buildworker/worker/package_linux64/build/src/jlapi.c:559
jl_repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:701
main at /buildworker/worker/package_linux64/build/cli/loader_exe.c:42
__libc_start_main at /lib64/libc.so.6 (unknown line)
_start at /home/mforets/Tools/julia-1.7.1-linux-x86_64/julia-1.7.1/bin/julia (unknown line)
Allocations: 603281151 (Pool: 603083916; Big: 197235); GC: 287
Aborted (core dumped)

@schillic
Copy link
Member

Yes, that seems to be similar. We should extract a small example and report.

@schillic
Copy link
Member

schillic commented Jan 29, 2022

Got it:

using GLPK
using MathOptInterface
const MOI = MathOptInterface
optimizer = GLPK.Optimizer(method=GLPK.EXACT)
c = [-1.0, 0]
A = [1.0 1; -1 -1]
b = [1.0, -1]
x = MOI.add_variables(optimizer, 2)

MOI.set(optimizer,
        MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(),
        MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(c, x), 0.0)
       )
MOI.set(optimizer, MOI.ObjectiveSense(), MOI.MIN_SENSE)
for i in 1:2
    MOI.add_constraint(optimizer,
                       MOI.ScalarAffineFunction(MOI.ScalarAffineTerm.(A[i, :], x), 0.0),
                       MOI.LessThan(b[i])
                      )
end
MOI.optimize!(optimizer)

I reported the error in jump-dev/GLPK.jl#207.

@mforets
Copy link
Member Author

mforets commented Jan 29, 2022

CI / test (1.3, x64, ubuntu-latest) (pull_request) Failing after 2m — test (1.3, x64, ubuntu-latest)

i would suggest removing such an old julia version from CI

@schillic
Copy link
Member

i would suggest removing such an old julia version from CI

This just happened in another merged PR, simply rebase here.

Copy link
Member

@schillic schillic left a comment

Choose a reason for hiding this comment

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

Nice, I think this closes #2922.

@mforets mforets merged commit 8f4a611 into master Jan 30, 2022
@mforets mforets deleted the mforets/2922 branch January 30, 2022 10:55
@schillic schillic mentioned this pull request Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants