From a38f950ccac998d2ee7a1e4e93b106e1b47a8217 Mon Sep 17 00:00:00 2001 From: Deborah Hendrych Date: Mon, 6 Nov 2023 11:57:05 +0100 Subject: [PATCH 01/16] Order of properties should be consisted. --- src/managed_blmo.jl | 8 ++++---- test/LMO_test.jl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/managed_blmo.jl b/src/managed_blmo.jl index 37c9f4f58..e1f871e40 100644 --- a/src/managed_blmo.jl +++ b/src/managed_blmo.jl @@ -34,12 +34,12 @@ mutable struct ManagedBoundedLMO{SBLMO<:SimpleBoundableLMO} <: BoundedLinearMini simple_lmo::SBLMO lower_bounds::Vector{Float64} upper_bounds::Vector{Float64} - n::Int int_vars::Vector{Int} + n::Int solving_time::Float64 end -function ManagedBoundedLMO(simple_lmo, lb, ub, n, int_vars) +function ManagedBoundedLMO(simple_lmo, lb, ub, int_vars, n) if length(lb) != length(ub) || length(ub) != length(int_vars) || length(lb) != length(int_vars) error( "Supply lower and upper bounds for all integer variables. If there are no explicit bounds, set entry to Inf and -Inf, respectively. The entries have to match the entries of int_vars!", @@ -50,7 +50,7 @@ function ManagedBoundedLMO(simple_lmo, lb, ub, n, int_vars) @assert isapprox(lb[i], round(lb[i]), atol=1e-6, rtol=1e-2) @assert isapprox(ub[i], round(ub[i]), atol=1e-6, rtol=1e-2) end - return ManagedBoundedLMO(simple_lmo, lb, ub, n, int_vars, 0.0) + return ManagedBoundedLMO(simple_lmo, lb, ub, int_vars, n, 0.0) end #ManagedBoundedLMO(simple_lmo, lb, ub, n, int_vars) = ManagedBoundedLMO(simple_lmo, lb, ub, n, int_vars, 0.0) @@ -262,7 +262,7 @@ function solve( use_shadow_set=true, kwargs..., ) - blmo = ManagedBoundedLMO(sblmo, lower_bounds, upper_bounds, n, int_vars) + blmo = ManagedBoundedLMO(sblmo, lower_bounds, upper_bounds, int_vars, n) return solve( f, grad!, diff --git a/test/LMO_test.jl b/test/LMO_test.jl index c879bd715..e1901a696 100644 --- a/test/LMO_test.jl +++ b/test/LMO_test.jl @@ -91,7 +91,7 @@ end ubs = ones(n) sblmo = Boscia.CubeSimpleBLMO(lbs, ubs, int_vars) - blmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], n, int_vars) + blmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], int_vars, n) branching_strategy = Boscia.PartialStrongBranching(10, 1e-3, blmo) @@ -107,7 +107,7 @@ end ubs = ones(n) sblmo = Boscia.CubeSimpleBLMO(lbs, ubs, int_vars) - blmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], n, int_vars) + blmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], int_vars, n) function perform_strong_branch(tree, node) return node.level <= length(tree.root.problem.integer_variables) / 3 From 57e22cc9090cebf08dfb1c8257893ebe73f8bca0 Mon Sep 17 00:00:00 2001 From: Deborah Hendrych Date: Mon, 6 Nov 2023 12:13:48 +0100 Subject: [PATCH 02/16] Specify type. --- src/managed_blmo.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/managed_blmo.jl b/src/managed_blmo.jl index e1f871e40..d9a7f86e3 100644 --- a/src/managed_blmo.jl +++ b/src/managed_blmo.jl @@ -39,7 +39,7 @@ mutable struct ManagedBoundedLMO{SBLMO<:SimpleBoundableLMO} <: BoundedLinearMini solving_time::Float64 end -function ManagedBoundedLMO(simple_lmo, lb, ub, int_vars, n) +function ManagedBoundedLMO(simple_lmo, lb, ub, int_vars::Vector{Int}, n::Int) if length(lb) != length(ub) || length(ub) != length(int_vars) || length(lb) != length(int_vars) error( "Supply lower and upper bounds for all integer variables. If there are no explicit bounds, set entry to Inf and -Inf, respectively. The entries have to match the entries of int_vars!", From c4820f00c98e3cf7f6b80f8da8665a44e914e225 Mon Sep 17 00:00:00 2001 From: Deborah Hendrych Date: Mon, 6 Nov 2023 14:34:50 +0100 Subject: [PATCH 03/16] Check error --- examples/strong_branching_portfolio.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index 90213a41c..b75e593d5 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -12,6 +12,7 @@ import HiGHS # For bug hunting: seed = rand(UInt64) +seed = 0xd038b7eafdcb28c1 @show seed #seed = 0xeadb922ca734998b Random.seed!(seed) @@ -30,7 +31,7 @@ const Mi = (Ai + Ai') / 2 function prepare_portfolio_lmo() o = SCIP.Optimizer() - MOI.set(o, MOI.Silent(), true) + MOI.set(o, MOI.Silent(), false) MOI.empty!(o) x = MOI.add_variables(o, n) I = collect(1:n) From 80fb861d675a179b1cdec0f5044ef5fe3a91ced1 Mon Sep 17 00:00:00 2001 From: Deborah Hendrych Date: Mon, 6 Nov 2023 14:55:14 +0100 Subject: [PATCH 04/16] Merge fixes. --- examples/nonlinear.jl | 2 +- examples/worst-case.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/nonlinear.jl b/examples/nonlinear.jl index ce906cb84..fd66d5c79 100644 --- a/examples/nonlinear.jl +++ b/examples/nonlinear.jl @@ -40,7 +40,7 @@ ubs = ones(n) sblmo = Boscia.CubeSimpleBLMO(lbs, ubs, int_vars) # wrap the sblmo into a bound manager -lmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], n, int_vars) +lmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], int_vars, n) const A = let A = randn(n, n) diff --git a/examples/worst-case.jl b/examples/worst-case.jl index c27493aeb..d7a3ffd34 100644 --- a/examples/worst-case.jl +++ b/examples/worst-case.jl @@ -53,7 +53,7 @@ n = 10 sblmo = Boscia.CubeSimpleBLMO(lbs, ubs, int_vars) # wrap the sblmo into a bound manager - lmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], n, int_vars) + lmo = Boscia.ManagedBoundedLMO(sblmo, lbs[int_vars], ubs[int_vars], int_vars, n) function f(x) return 0.5 * sum((x .- diff_point) .^ 2) From d6abf23cc041adac4a43369a6f9ab6daab8f6bdd Mon Sep 17 00:00:00 2001 From: Deborah Hendrych Date: Mon, 6 Nov 2023 19:35:31 +0100 Subject: [PATCH 05/16] Print example settings. --- examples/strong_branching_portfolio.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index b75e593d5..9b64fc503 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -29,6 +29,13 @@ Ai = Ai' * Ai const Mi = (Ai + Ai') / 2 @assert isposdef(Mi) +@show ri +@show ai +@show Ωi +@show bi +@show Ai +@show Mi + function prepare_portfolio_lmo() o = SCIP.Optimizer() MOI.set(o, MOI.Silent(), false) From 227bf44180d0ccf139ac8fb09c17602f3d5fd974 Mon Sep 17 00:00:00 2001 From: Deborah Hendrych Date: Mon, 6 Nov 2023 20:58:54 +0100 Subject: [PATCH 06/16] Fixed data to track down issue. --- examples/strong_branching_portfolio.jl | 40 +++++++++++++++++--------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index 9b64fc503..17396a3f8 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -20,25 +20,39 @@ Random.seed!(seed) # TROUBLESOME SEED seed = 0x8750860d6fd5025f -> NEEDS TO BE CHECK AGAIN! n = 20 -const ri = rand(n) -const ai = rand(n) -const Ωi = rand(Float64) +#const ri = rand(n) +#const ai = rand(n) +#const Ωi = rand(Float64) +#const bi = sum(ai) +#Ai = randn(n, n) +#Ai = Ai' * Ai +#const Mi = (Ai + Ai') / 2 +#@assert isposdef(Mi) + +#@show ri +#@show ai +#@show Ωi +#@show bi +#@show Ai +#@show Mi + +const ri = [0.045054599902509596, 0.15640436665619184, 0.2735669741522424, 0.2784384724840858, 0.7273512458022291, 0.7259501747199306, 0.22719857001620958, 0.7488803015182965, 0.7551865762729075, 0.8729424803227761, 0.1031509613456203, 0.5883209711669155, 0.5222239085099922, 0.45356565475023625, 0.12071201005492083, 0.2826881085023156, 0.26781345864628303, 0.6719733143780509, 0.4972650694624705, 0.34719664179834164] + +const ai = [0.9180595602471104, 0.6223508120192558, 0.7826711851406587, 0.8877891199455334, 0.31014726178572927, 0.2399447346410375, 0.7568595790126875, 0.017927403665631836, 0.05683421070174455, 0.15282271111057755, 0.125154806480549, 0.06918870150741196, 0.3219811750202961, 0.949408167695982, 0.3547498287597832, 0.02808017754876091, 0.930299590021576, 0.0009707781039260954, 0.6897214878434292, 0.7538246122510148] + +const Ωi = 0.7014455397435948 +#bi = 8.968785903502694 const bi = sum(ai) -Ai = randn(n, n) -Ai = Ai' * Ai + +Ai = [21.067822898841943 -0.2456591665304344 0.41724237018201815 0.2239312963112271 -0.7373880046845093 -3.267709286092762 1.2558960614915409 -6.537124595164123 2.560502965591387 0.812267330132679 -9.606392059140921 -4.391021450539187 1.0922662708120585 0.24790820343248382 -1.8201734143546722 -1.8415302653951926 4.567113068825415 5.645481991144209 -2.3873485872566453 1.8015299584725635; -0.2456591665304344 20.007108977419858 -2.5536460373492655 5.386746979815513 -0.45695463200069586 5.1077700321396735 -2.3519215972671277 5.251859978684248 1.4839692307383068 -0.33174216510599464 0.11908657953473512 0.6716004021210218 0.9704233608273368 -6.9154323685373384 -4.833342524281925 -0.2642673928906647 5.629609027127837 6.297468737216921 4.120679687210085 12.27738844183925; 0.41724237018201815 -2.5536460373492655 26.251375897756276 4.732490313443435 -0.03188432344993197 3.9330809903829964 3.4379369530243302 1.9872826405433353 -9.14693567668028 1.3777248881934414 4.1375305929784805 2.620712773292841 -2.7469464954968563 -5.231991290099736 6.353298857440429 -0.955953934131732 8.08225555417372 -5.918405393623921 -6.096759128605076 -1.9361648561616194; 0.2239312963112271 5.386746979815513 4.732490313443435 25.590782695097285 -0.31324620373276135 9.244426427136773 8.255280707380486 -1.1454702860098893 3.9450651929238583 -0.9807217330998804 10.445630671621357 -5.416861940264175 1.0850574513395985 6.405258216592411 0.7226836884734482 -4.8838038803785455 -4.611551533620946 3.873245876877796 -6.980725332973074 10.201493534122653; -0.7373880046845093 -0.45695463200069586 -0.03188432344993197 -0.31324620373276135 27.9299036429962 8.68867111135701 -12.668975887413147 2.5211329932122455 2.7623200478482346 1.3480142672201076 -2.7003130970822617 10.26154233613517 4.71252610285813 -4.165112055049683 2.6690353726933287 2.5852742817386596 -0.06437943294211701 -0.6224829336869455 5.829240592848388 -1.9283235560642311; -3.267709286092762 5.1077700321396735 3.9330809903829964 9.244426427136773 8.68867111135701 16.539761343969953 -5.272052298662209 2.7061353420778134 8.821710432108043 -3.429483606674073 1.7535895899297458 4.044916031316452 3.4114820972570588 -5.40445109873675 5.097142722451032 -1.2374133950901256 1.944760684957939 2.850488218102691 1.6720203884477016 -0.4401050512934188; 1.2558960614915409 -2.3519215972671277 3.4379369530243302 8.255280707380486 -12.668975887413147 -5.272052298662209 32.05886607071271 -3.9153443574171445 0.597311808702748 -7.159939393209872 -0.12314777431526742 -13.67686715031358 -8.926154333134136 2.663285783794903 -6.19907990632074 -6.962150847403804 3.7699108227938423 -7.7567604353040815 -1.2567381540418687 8.84771792529003; -6.537124595164123 5.251859978684248 1.9872826405433353 -1.1454702860098893 2.5211329932122455 2.7061353420778134 -3.9153443574171445 18.39876360622575 3.665158869432717 1.9908664493145114 1.0029510365299954 4.832189958258888 -2.3288329628958997 0.1276673220863505 4.377010735421336 7.763425880289378 4.580656874218642 -0.591498789421499 8.102008910356536 4.534697004728115; 2.560502965591387 1.4839692307383068 -9.14693567668028 3.9450651929238583 2.7623200478482346 8.821710432108043 0.597311808702748 3.665158869432717 25.540378585492927 -7.64389396065181 -6.468799238951818 -3.04588024923645 -6.881731562872513 0.20525279177233202 -2.453794913853438 5.142171006779962 0.10012025630256935 3.272979478984822 7.525702636596447 0.9292970275171553; 0.812267330132679 -0.33174216510599464 1.3777248881934414 -0.9807217330998804 1.3480142672201076 -3.429483606674073 -7.159939393209872 1.9908664493145114 -7.64389396065181 17.770119811755308 3.2276326021259343 -0.45021511936117437 5.256501578652799 -2.483677462289625 -5.277695539374783 -10.030697060234619 1.5729721060304087 1.5609060749512498 -7.883238394580825 2.5061054391405833; -9.606392059140921 0.11908657953473512 4.1375305929784805 10.445630671621357 -2.7003130970822617 1.7535895899297458 -0.12314777431526742 1.0029510365299954 -6.468799238951818 3.2276326021259343 23.311829677236993 -3.588829979556081 0.6635847539879597 6.229360364819488 -0.8035993980326457 3.1191879904878586 -10.345306129667012 2.901762241411971 -10.83293173145159 7.625555131416707; -4.391021450539187 0.6716004021210218 2.620712773292841 -5.416861940264175 10.26154233613517 4.044916031316452 -13.67686715031358 4.832189958258888 -3.04588024923645 -0.45021511936117437 -3.588829979556081 19.82169467180281 4.073442728153711 -3.376027047776719 5.27635312754488 2.2021586127011497 4.602366235060449 -3.14763607501543 7.6731283676994115 -9.003655004313524; 1.0922662708120585 0.9704233608273368 -2.7469464954968563 1.0850574513395985 4.71252610285813 3.4114820972570588 -8.926154333134136 -2.3288329628958997 -6.881731562872513 5.256501578652799 0.6635847539879597 4.073442728153711 16.89214082514548 2.903567286178969 5.0849418958348735 0.515061950019791 -1.2044452507741277 1.3264038737633472 -6.113660031427819 -9.286940993467605; 0.24790820343248382 -6.9154323685373384 -5.231991290099736 6.405258216592411 -4.165112055049683 -5.40445109873675 2.663285783794903 0.1276673220863505 0.20525279177233202 -2.483677462289625 6.229360364819488 -3.376027047776719 2.903567286178969 35.61584093296939 -1.9494384494934036 13.921083869621652 -10.247364774410546 -7.406062816640134 -0.10711300217400721 -9.727649222050019; -1.8201734143546722 -4.833342524281925 6.353298857440429 0.7226836884734482 2.6690353726933287 5.097142722451032 -6.19907990632074 4.377010735421336 -2.453794913853438 -5.277695539374783 -0.8035993980326457 5.27635312754488 5.0849418958348735 -1.9494384494934036 28.85361889354387 0.7281434872766035 -9.486215961970576 0.14167249041049612 -7.047692104013578 -5.583710300280806; -1.8415302653951926 -0.2642673928906647 -0.955953934131732 -4.8838038803785455 2.5852742817386596 -1.2374133950901256 -6.962150847403804 7.763425880289378 5.142171006779962 -10.030697060234619 3.1191879904878586 2.2021586127011497 0.515061950019791 13.921083869621652 0.7281434872766035 36.15931261936261 -1.8337579067748282 -0.21715857519199916 7.095866868366173 -11.356399337040415; 4.567113068825415 5.629609027127837 8.08225555417372 -4.611551533620946 -0.06437943294211701 1.944760684957939 3.7699108227938423 4.580656874218642 0.10012025630256935 1.5729721060304087 -10.345306129667012 4.602366235060449 -1.2044452507741277 -10.247364774410546 -9.486215961970576 -1.8337579067748282 23.352985852121297 -4.0851885676116995 9.077805998772966 3.099810970073503; 5.645481991144209 6.297468737216921 -5.918405393623921 3.873245876877796 -0.6224829336869455 2.850488218102691 -7.7567604353040815 -0.591498789421499 3.272979478984822 1.5609060749512498 2.901762241411971 -3.14763607501543 1.3264038737633472 -7.406062816640134 0.14167249041049612 -0.21715857519199916 -4.0851885676116995 22.173849558437485 1.6985945415698833 5.991922716154; -2.3873485872566453 4.120679687210085 -6.096759128605076 -6.980725332973074 5.829240592848388 1.6720203884477016 -1.2567381540418687 8.102008910356536 7.525702636596447 -7.883238394580825 -10.83293173145159 7.6731283676994115 -6.113660031427819 -0.10711300217400721 -7.047692104013578 7.095866868366173 9.077805998772966 1.6985945415698833 25.63410001961338 -2.1631643217274314; 1.8015299584725635 12.27738844183925 -1.9361648561616194 10.201493534122653 -1.9283235560642311 -0.4401050512934188 8.84771792529003 4.534697004728115 0.9292970275171553 2.5061054391405833 7.625555131416707 -9.003655004313524 -9.286940993467605 -9.727649222050019 -5.583710300280806 -11.356399337040415 3.099810970073503 5.991922716154 -2.1631643217274314 35.87523667318088] +#Mi = [21.067822898841943 -0.2456591665304344 0.41724237018201815 0.2239312963112271 -0.7373880046845093 -3.267709286092762 1.2558960614915409 -6.537124595164123 2.560502965591387 0.812267330132679 -9.606392059140921 -4.391021450539187 1.0922662708120585 0.24790820343248382 -1.8201734143546722 -1.8415302653951926 4.567113068825415 5.645481991144209 -2.3873485872566453 1.8015299584725635; -0.2456591665304344 20.007108977419858 -2.5536460373492655 5.386746979815513 -0.45695463200069586 5.1077700321396735 -2.3519215972671277 5.251859978684248 1.4839692307383068 -0.33174216510599464 0.11908657953473512 0.6716004021210218 0.9704233608273368 -6.9154323685373384 -4.833342524281925 -0.2642673928906647 5.629609027127837 6.297468737216921 4.120679687210085 12.27738844183925; 0.41724237018201815 -2.5536460373492655 26.251375897756276 4.732490313443435 -0.03188432344993197 3.9330809903829964 3.4379369530243302 1.9872826405433353 -9.14693567668028 1.3777248881934414 4.1375305929784805 2.620712773292841 -2.7469464954968563 -5.231991290099736 6.353298857440429 -0.955953934131732 8.08225555417372 -5.918405393623921 -6.096759128605076 -1.9361648561616194; 0.2239312963112271 5.386746979815513 4.732490313443435 25.590782695097285 -0.31324620373276135 9.244426427136773 8.255280707380486 -1.1454702860098893 3.9450651929238583 -0.9807217330998804 10.445630671621357 -5.416861940264175 1.0850574513395985 6.405258216592411 0.7226836884734482 -4.8838038803785455 -4.611551533620946 3.873245876877796 -6.980725332973074 10.201493534122653; -0.7373880046845093 -0.45695463200069586 -0.03188432344993197 -0.31324620373276135 27.9299036429962 8.68867111135701 -12.668975887413147 2.5211329932122455 2.7623200478482346 1.3480142672201076 -2.7003130970822617 10.26154233613517 4.71252610285813 -4.165112055049683 2.6690353726933287 2.5852742817386596 -0.06437943294211701 -0.6224829336869455 5.829240592848388 -1.9283235560642311; -3.267709286092762 5.1077700321396735 3.9330809903829964 9.244426427136773 8.68867111135701 16.539761343969953 -5.272052298662209 2.7061353420778134 8.821710432108043 -3.429483606674073 1.7535895899297458 4.044916031316452 3.4114820972570588 -5.40445109873675 5.097142722451032 -1.2374133950901256 1.944760684957939 2.850488218102691 1.6720203884477016 -0.4401050512934188; 1.2558960614915409 -2.3519215972671277 3.4379369530243302 8.255280707380486 -12.668975887413147 -5.272052298662209 32.05886607071271 -3.9153443574171445 0.597311808702748 -7.159939393209872 -0.12314777431526742 -13.67686715031358 -8.926154333134136 2.663285783794903 -6.19907990632074 -6.962150847403804 3.7699108227938423 -7.7567604353040815 -1.2567381540418687 8.84771792529003; -6.537124595164123 5.251859978684248 1.9872826405433353 -1.1454702860098893 2.5211329932122455 2.7061353420778134 -3.9153443574171445 18.39876360622575 3.665158869432717 1.9908664493145114 1.0029510365299954 4.832189958258888 -2.3288329628958997 0.1276673220863505 4.377010735421336 7.763425880289378 4.580656874218642 -0.591498789421499 8.102008910356536 4.534697004728115; 2.560502965591387 1.4839692307383068 -9.14693567668028 3.9450651929238583 2.7623200478482346 8.821710432108043 0.597311808702748 3.665158869432717 25.540378585492927 -7.64389396065181 -6.468799238951818 -3.04588024923645 -6.881731562872513 0.20525279177233202 -2.453794913853438 5.142171006779962 0.10012025630256935 3.272979478984822 7.525702636596447 0.9292970275171553; 0.812267330132679 -0.33174216510599464 1.3777248881934414 -0.9807217330998804 1.3480142672201076 -3.429483606674073 -7.159939393209872 1.9908664493145114 -7.64389396065181 17.770119811755308 3.2276326021259343 -0.45021511936117437 5.256501578652799 -2.483677462289625 -5.277695539374783 -10.030697060234619 1.5729721060304087 1.5609060749512498 -7.883238394580825 2.5061054391405833; -9.606392059140921 0.11908657953473512 4.1375305929784805 10.445630671621357 -2.7003130970822617 1.7535895899297458 -0.12314777431526742 1.0029510365299954 -6.468799238951818 3.2276326021259343 23.311829677236993 -3.588829979556081 0.6635847539879597 6.229360364819488 -0.8035993980326457 3.1191879904878586 -10.345306129667012 2.901762241411971 -10.83293173145159 7.625555131416707; -4.391021450539187 0.6716004021210218 2.620712773292841 -5.416861940264175 10.26154233613517 4.044916031316452 -13.67686715031358 4.832189958258888 -3.04588024923645 -0.45021511936117437 -3.588829979556081 19.82169467180281 4.073442728153711 -3.376027047776719 5.27635312754488 2.2021586127011497 4.602366235060449 -3.14763607501543 7.6731283676994115 -9.003655004313524; 1.0922662708120585 0.9704233608273368 -2.7469464954968563 1.0850574513395985 4.71252610285813 3.4114820972570588 -8.926154333134136 -2.3288329628958997 -6.881731562872513 5.256501578652799 0.6635847539879597 4.073442728153711 16.89214082514548 2.903567286178969 5.0849418958348735 0.515061950019791 -1.2044452507741277 1.3264038737633472 -6.113660031427819 -9.286940993467605; 0.24790820343248382 -6.9154323685373384 -5.231991290099736 6.405258216592411 -4.165112055049683 -5.40445109873675 2.663285783794903 0.1276673220863505 0.20525279177233202 -2.483677462289625 6.229360364819488 -3.376027047776719 2.903567286178969 35.61584093296939 -1.9494384494934036 13.921083869621652 -10.247364774410546 -7.406062816640134 -0.10711300217400721 -9.727649222050019; -1.8201734143546722 -4.833342524281925 6.353298857440429 0.7226836884734482 2.6690353726933287 5.097142722451032 -6.19907990632074 4.377010735421336 -2.453794913853438 -5.277695539374783 -0.8035993980326457 5.27635312754488 5.0849418958348735 -1.9494384494934036 28.85361889354387 0.7281434872766035 -9.486215961970576 0.14167249041049612 -7.047692104013578 -5.583710300280806; -1.8415302653951926 -0.2642673928906647 -0.955953934131732 -4.8838038803785455 2.5852742817386596 -1.2374133950901256 -6.962150847403804 7.763425880289378 5.142171006779962 -10.030697060234619 3.1191879904878586 2.2021586127011497 0.515061950019791 13.921083869621652 0.7281434872766035 36.15931261936261 -1.8337579067748282 -0.21715857519199916 7.095866868366173 -11.356399337040415; 4.567113068825415 5.629609027127837 8.08225555417372 -4.611551533620946 -0.06437943294211701 1.944760684957939 3.7699108227938423 4.580656874218642 0.10012025630256935 1.5729721060304087 -10.345306129667012 4.602366235060449 -1.2044452507741277 -10.247364774410546 -9.486215961970576 -1.8337579067748282 23.352985852121297 -4.0851885676116995 9.077805998772966 3.099810970073503; 5.645481991144209 6.297468737216921 -5.918405393623921 3.873245876877796 -0.6224829336869455 2.850488218102691 -7.7567604353040815 -0.591498789421499 3.272979478984822 1.5609060749512498 2.901762241411971 -3.14763607501543 1.3264038737633472 -7.406062816640134 0.14167249041049612 -0.21715857519199916 -4.0851885676116995 22.173849558437485 1.6985945415698833 5.991922716154; -2.3873485872566453 4.120679687210085 -6.096759128605076 -6.980725332973074 5.829240592848388 1.6720203884477016 -1.2567381540418687 8.102008910356536 7.525702636596447 -7.883238394580825 -10.83293173145159 7.6731283676994115 -6.113660031427819 -0.10711300217400721 -7.047692104013578 7.095866868366173 9.077805998772966 1.6985945415698833 25.63410001961338 -2.1631643217274314; 1.8015299584725635 12.27738844183925 -1.9361648561616194 10.201493534122653 -1.9283235560642311 -0.4401050512934188 8.84771792529003 4.534697004728115 0.9292970275171553 2.5061054391405833 7.625555131416707 -9.003655004313524 -9.286940993467605 -9.727649222050019 -5.583710300280806 -11.356399337040415 3.099810970073503 5.991922716154 -2.1631643217274314 35.87523667318088] + const Mi = (Ai + Ai') / 2 @assert isposdef(Mi) -@show ri -@show ai -@show Ωi -@show bi -@show Ai -@show Mi - function prepare_portfolio_lmo() o = SCIP.Optimizer() - MOI.set(o, MOI.Silent(), false) + MOI.set(o, MOI.Silent(), true) MOI.empty!(o) x = MOI.add_variables(o, n) I = collect(1:n) From 3508d003b95fec0d8957a8a2282878ed4e19dacd Mon Sep 17 00:00:00 2001 From: Deborah Hendrych Date: Mon, 6 Nov 2023 22:02:08 +0100 Subject: [PATCH 07/16] Print Branching Optimizer logs. --- examples/strong_branching_portfolio.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index 17396a3f8..8da817b38 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -93,7 +93,7 @@ end blmo = Boscia.MathOptBLMO(HiGHS.Optimizer()) branching_strategy = Boscia.PartialStrongBranching(10, 1e-3, blmo) - MOI.set(branching_strategy.bounded_lmo.o, MOI.Silent(), true) + MOI.set(branching_strategy.bounded_lmo.o, MOI.Silent(), false) lmo = prepare_portfolio_lmo() x, _, result_strong_branching = From e1e48423e8b721c9f03e0fe0f275d0c4f1f033e7 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 11:45:39 +0100 Subject: [PATCH 08/16] Use SCIP as branching optimizer. --- examples/strong_branching_portfolio.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index 8da817b38..3365284b0 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -91,9 +91,10 @@ end @test dot(ai, x) <= bi + 1e-6 @test f(x) <= f(result_baseline[:raw_solution]) + 1e-6 - blmo = Boscia.MathOptBLMO(HiGHS.Optimizer()) + # blmo = Boscia.MathOptBLMO(HiGHS.Optimizer()) + blmo = Boscia.MathOptBLMO(SCIP.Optimizer()) branching_strategy = Boscia.PartialStrongBranching(10, 1e-3, blmo) - MOI.set(branching_strategy.bounded_lmo.o, MOI.Silent(), false) + MOI.set(branching_strategy.bounded_lmo.o, MOI.Silent(), true) lmo = prepare_portfolio_lmo() x, _, result_strong_branching = From bc8cf790d909a7ee5d1fbb5621c2f84999b87f65 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 12:30:22 +0100 Subject: [PATCH 09/16] Print the opt problem where HiGHS crashes. --- examples/strong_branching_portfolio.jl | 4 ++-- src/MOI_bounded_oracle.jl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index 3365284b0..ba8616b02 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -91,8 +91,8 @@ end @test dot(ai, x) <= bi + 1e-6 @test f(x) <= f(result_baseline[:raw_solution]) + 1e-6 - # blmo = Boscia.MathOptBLMO(HiGHS.Optimizer()) - blmo = Boscia.MathOptBLMO(SCIP.Optimizer()) + blmo = Boscia.MathOptBLMO(HiGHS.Optimizer()) + #blmo = Boscia.MathOptBLMO(SCIP.Optimizer()) branching_strategy = Boscia.PartialStrongBranching(10, 1e-3, blmo) MOI.set(branching_strategy.bounded_lmo.o, MOI.Silent(), true) diff --git a/src/MOI_bounded_oracle.jl b/src/MOI_bounded_oracle.jl index 378d7237f..06b2b708c 100644 --- a/src/MOI_bounded_oracle.jl +++ b/src/MOI_bounded_oracle.jl @@ -36,6 +36,7 @@ Is implemented in the FrankWolfe package in file "moi_oracle.jl". """ function Boscia.compute_extreme_point(blmo::MathOptBLMO, d; kwargs...) lmo = convert(FrankWolfe.MathOptLMO, blmo) + print(lmo.o) v = FrankWolfe.compute_extreme_point(lmo, d; kwargs) @assert blmo isa MathOptBLMO return v From cf605239ebcfb4e43602ae3b2346025094324b5d Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 12:32:16 +0100 Subject: [PATCH 10/16] Print direction. --- src/MOI_bounded_oracle.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MOI_bounded_oracle.jl b/src/MOI_bounded_oracle.jl index 06b2b708c..24a2a6ba7 100644 --- a/src/MOI_bounded_oracle.jl +++ b/src/MOI_bounded_oracle.jl @@ -36,6 +36,7 @@ Is implemented in the FrankWolfe package in file "moi_oracle.jl". """ function Boscia.compute_extreme_point(blmo::MathOptBLMO, d; kwargs...) lmo = convert(FrankWolfe.MathOptLMO, blmo) + @show d print(lmo.o) v = FrankWolfe.compute_extreme_point(lmo, d; kwargs) @assert blmo isa MathOptBLMO From da444923f3c9605b4163016623596e7ef2f44896 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 15:21:56 +0100 Subject: [PATCH 11/16] Reset example with random data. --- examples/strong_branching_portfolio.jl | 39 ++++++-------------------- src/MOI_bounded_oracle.jl | 2 -- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index ba8616b02..cbe339124 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -11,42 +11,19 @@ import HiGHS # For bug hunting: -seed = rand(UInt64) -seed = 0xd038b7eafdcb28c1 -@show seed -#seed = 0xeadb922ca734998b -Random.seed!(seed) +#seed = rand(UInt64) +#@show seed +#Random.seed!(seed) # TROUBLESOME SEED seed = 0x8750860d6fd5025f -> NEEDS TO BE CHECK AGAIN! n = 20 -#const ri = rand(n) -#const ai = rand(n) -#const Ωi = rand(Float64) -#const bi = sum(ai) -#Ai = randn(n, n) -#Ai = Ai' * Ai -#const Mi = (Ai + Ai') / 2 -#@assert isposdef(Mi) - -#@show ri -#@show ai -#@show Ωi -#@show bi -#@show Ai -#@show Mi - -const ri = [0.045054599902509596, 0.15640436665619184, 0.2735669741522424, 0.2784384724840858, 0.7273512458022291, 0.7259501747199306, 0.22719857001620958, 0.7488803015182965, 0.7551865762729075, 0.8729424803227761, 0.1031509613456203, 0.5883209711669155, 0.5222239085099922, 0.45356565475023625, 0.12071201005492083, 0.2826881085023156, 0.26781345864628303, 0.6719733143780509, 0.4972650694624705, 0.34719664179834164] - -const ai = [0.9180595602471104, 0.6223508120192558, 0.7826711851406587, 0.8877891199455334, 0.31014726178572927, 0.2399447346410375, 0.7568595790126875, 0.017927403665631836, 0.05683421070174455, 0.15282271111057755, 0.125154806480549, 0.06918870150741196, 0.3219811750202961, 0.949408167695982, 0.3547498287597832, 0.02808017754876091, 0.930299590021576, 0.0009707781039260954, 0.6897214878434292, 0.7538246122510148] - -const Ωi = 0.7014455397435948 -#bi = 8.968785903502694 +const ri = rand(n) +const ai = rand(n) +const Ωi = rand(Float64) const bi = sum(ai) - -Ai = [21.067822898841943 -0.2456591665304344 0.41724237018201815 0.2239312963112271 -0.7373880046845093 -3.267709286092762 1.2558960614915409 -6.537124595164123 2.560502965591387 0.812267330132679 -9.606392059140921 -4.391021450539187 1.0922662708120585 0.24790820343248382 -1.8201734143546722 -1.8415302653951926 4.567113068825415 5.645481991144209 -2.3873485872566453 1.8015299584725635; -0.2456591665304344 20.007108977419858 -2.5536460373492655 5.386746979815513 -0.45695463200069586 5.1077700321396735 -2.3519215972671277 5.251859978684248 1.4839692307383068 -0.33174216510599464 0.11908657953473512 0.6716004021210218 0.9704233608273368 -6.9154323685373384 -4.833342524281925 -0.2642673928906647 5.629609027127837 6.297468737216921 4.120679687210085 12.27738844183925; 0.41724237018201815 -2.5536460373492655 26.251375897756276 4.732490313443435 -0.03188432344993197 3.9330809903829964 3.4379369530243302 1.9872826405433353 -9.14693567668028 1.3777248881934414 4.1375305929784805 2.620712773292841 -2.7469464954968563 -5.231991290099736 6.353298857440429 -0.955953934131732 8.08225555417372 -5.918405393623921 -6.096759128605076 -1.9361648561616194; 0.2239312963112271 5.386746979815513 4.732490313443435 25.590782695097285 -0.31324620373276135 9.244426427136773 8.255280707380486 -1.1454702860098893 3.9450651929238583 -0.9807217330998804 10.445630671621357 -5.416861940264175 1.0850574513395985 6.405258216592411 0.7226836884734482 -4.8838038803785455 -4.611551533620946 3.873245876877796 -6.980725332973074 10.201493534122653; -0.7373880046845093 -0.45695463200069586 -0.03188432344993197 -0.31324620373276135 27.9299036429962 8.68867111135701 -12.668975887413147 2.5211329932122455 2.7623200478482346 1.3480142672201076 -2.7003130970822617 10.26154233613517 4.71252610285813 -4.165112055049683 2.6690353726933287 2.5852742817386596 -0.06437943294211701 -0.6224829336869455 5.829240592848388 -1.9283235560642311; -3.267709286092762 5.1077700321396735 3.9330809903829964 9.244426427136773 8.68867111135701 16.539761343969953 -5.272052298662209 2.7061353420778134 8.821710432108043 -3.429483606674073 1.7535895899297458 4.044916031316452 3.4114820972570588 -5.40445109873675 5.097142722451032 -1.2374133950901256 1.944760684957939 2.850488218102691 1.6720203884477016 -0.4401050512934188; 1.2558960614915409 -2.3519215972671277 3.4379369530243302 8.255280707380486 -12.668975887413147 -5.272052298662209 32.05886607071271 -3.9153443574171445 0.597311808702748 -7.159939393209872 -0.12314777431526742 -13.67686715031358 -8.926154333134136 2.663285783794903 -6.19907990632074 -6.962150847403804 3.7699108227938423 -7.7567604353040815 -1.2567381540418687 8.84771792529003; -6.537124595164123 5.251859978684248 1.9872826405433353 -1.1454702860098893 2.5211329932122455 2.7061353420778134 -3.9153443574171445 18.39876360622575 3.665158869432717 1.9908664493145114 1.0029510365299954 4.832189958258888 -2.3288329628958997 0.1276673220863505 4.377010735421336 7.763425880289378 4.580656874218642 -0.591498789421499 8.102008910356536 4.534697004728115; 2.560502965591387 1.4839692307383068 -9.14693567668028 3.9450651929238583 2.7623200478482346 8.821710432108043 0.597311808702748 3.665158869432717 25.540378585492927 -7.64389396065181 -6.468799238951818 -3.04588024923645 -6.881731562872513 0.20525279177233202 -2.453794913853438 5.142171006779962 0.10012025630256935 3.272979478984822 7.525702636596447 0.9292970275171553; 0.812267330132679 -0.33174216510599464 1.3777248881934414 -0.9807217330998804 1.3480142672201076 -3.429483606674073 -7.159939393209872 1.9908664493145114 -7.64389396065181 17.770119811755308 3.2276326021259343 -0.45021511936117437 5.256501578652799 -2.483677462289625 -5.277695539374783 -10.030697060234619 1.5729721060304087 1.5609060749512498 -7.883238394580825 2.5061054391405833; -9.606392059140921 0.11908657953473512 4.1375305929784805 10.445630671621357 -2.7003130970822617 1.7535895899297458 -0.12314777431526742 1.0029510365299954 -6.468799238951818 3.2276326021259343 23.311829677236993 -3.588829979556081 0.6635847539879597 6.229360364819488 -0.8035993980326457 3.1191879904878586 -10.345306129667012 2.901762241411971 -10.83293173145159 7.625555131416707; -4.391021450539187 0.6716004021210218 2.620712773292841 -5.416861940264175 10.26154233613517 4.044916031316452 -13.67686715031358 4.832189958258888 -3.04588024923645 -0.45021511936117437 -3.588829979556081 19.82169467180281 4.073442728153711 -3.376027047776719 5.27635312754488 2.2021586127011497 4.602366235060449 -3.14763607501543 7.6731283676994115 -9.003655004313524; 1.0922662708120585 0.9704233608273368 -2.7469464954968563 1.0850574513395985 4.71252610285813 3.4114820972570588 -8.926154333134136 -2.3288329628958997 -6.881731562872513 5.256501578652799 0.6635847539879597 4.073442728153711 16.89214082514548 2.903567286178969 5.0849418958348735 0.515061950019791 -1.2044452507741277 1.3264038737633472 -6.113660031427819 -9.286940993467605; 0.24790820343248382 -6.9154323685373384 -5.231991290099736 6.405258216592411 -4.165112055049683 -5.40445109873675 2.663285783794903 0.1276673220863505 0.20525279177233202 -2.483677462289625 6.229360364819488 -3.376027047776719 2.903567286178969 35.61584093296939 -1.9494384494934036 13.921083869621652 -10.247364774410546 -7.406062816640134 -0.10711300217400721 -9.727649222050019; -1.8201734143546722 -4.833342524281925 6.353298857440429 0.7226836884734482 2.6690353726933287 5.097142722451032 -6.19907990632074 4.377010735421336 -2.453794913853438 -5.277695539374783 -0.8035993980326457 5.27635312754488 5.0849418958348735 -1.9494384494934036 28.85361889354387 0.7281434872766035 -9.486215961970576 0.14167249041049612 -7.047692104013578 -5.583710300280806; -1.8415302653951926 -0.2642673928906647 -0.955953934131732 -4.8838038803785455 2.5852742817386596 -1.2374133950901256 -6.962150847403804 7.763425880289378 5.142171006779962 -10.030697060234619 3.1191879904878586 2.2021586127011497 0.515061950019791 13.921083869621652 0.7281434872766035 36.15931261936261 -1.8337579067748282 -0.21715857519199916 7.095866868366173 -11.356399337040415; 4.567113068825415 5.629609027127837 8.08225555417372 -4.611551533620946 -0.06437943294211701 1.944760684957939 3.7699108227938423 4.580656874218642 0.10012025630256935 1.5729721060304087 -10.345306129667012 4.602366235060449 -1.2044452507741277 -10.247364774410546 -9.486215961970576 -1.8337579067748282 23.352985852121297 -4.0851885676116995 9.077805998772966 3.099810970073503; 5.645481991144209 6.297468737216921 -5.918405393623921 3.873245876877796 -0.6224829336869455 2.850488218102691 -7.7567604353040815 -0.591498789421499 3.272979478984822 1.5609060749512498 2.901762241411971 -3.14763607501543 1.3264038737633472 -7.406062816640134 0.14167249041049612 -0.21715857519199916 -4.0851885676116995 22.173849558437485 1.6985945415698833 5.991922716154; -2.3873485872566453 4.120679687210085 -6.096759128605076 -6.980725332973074 5.829240592848388 1.6720203884477016 -1.2567381540418687 8.102008910356536 7.525702636596447 -7.883238394580825 -10.83293173145159 7.6731283676994115 -6.113660031427819 -0.10711300217400721 -7.047692104013578 7.095866868366173 9.077805998772966 1.6985945415698833 25.63410001961338 -2.1631643217274314; 1.8015299584725635 12.27738844183925 -1.9361648561616194 10.201493534122653 -1.9283235560642311 -0.4401050512934188 8.84771792529003 4.534697004728115 0.9292970275171553 2.5061054391405833 7.625555131416707 -9.003655004313524 -9.286940993467605 -9.727649222050019 -5.583710300280806 -11.356399337040415 3.099810970073503 5.991922716154 -2.1631643217274314 35.87523667318088] -#Mi = [21.067822898841943 -0.2456591665304344 0.41724237018201815 0.2239312963112271 -0.7373880046845093 -3.267709286092762 1.2558960614915409 -6.537124595164123 2.560502965591387 0.812267330132679 -9.606392059140921 -4.391021450539187 1.0922662708120585 0.24790820343248382 -1.8201734143546722 -1.8415302653951926 4.567113068825415 5.645481991144209 -2.3873485872566453 1.8015299584725635; -0.2456591665304344 20.007108977419858 -2.5536460373492655 5.386746979815513 -0.45695463200069586 5.1077700321396735 -2.3519215972671277 5.251859978684248 1.4839692307383068 -0.33174216510599464 0.11908657953473512 0.6716004021210218 0.9704233608273368 -6.9154323685373384 -4.833342524281925 -0.2642673928906647 5.629609027127837 6.297468737216921 4.120679687210085 12.27738844183925; 0.41724237018201815 -2.5536460373492655 26.251375897756276 4.732490313443435 -0.03188432344993197 3.9330809903829964 3.4379369530243302 1.9872826405433353 -9.14693567668028 1.3777248881934414 4.1375305929784805 2.620712773292841 -2.7469464954968563 -5.231991290099736 6.353298857440429 -0.955953934131732 8.08225555417372 -5.918405393623921 -6.096759128605076 -1.9361648561616194; 0.2239312963112271 5.386746979815513 4.732490313443435 25.590782695097285 -0.31324620373276135 9.244426427136773 8.255280707380486 -1.1454702860098893 3.9450651929238583 -0.9807217330998804 10.445630671621357 -5.416861940264175 1.0850574513395985 6.405258216592411 0.7226836884734482 -4.8838038803785455 -4.611551533620946 3.873245876877796 -6.980725332973074 10.201493534122653; -0.7373880046845093 -0.45695463200069586 -0.03188432344993197 -0.31324620373276135 27.9299036429962 8.68867111135701 -12.668975887413147 2.5211329932122455 2.7623200478482346 1.3480142672201076 -2.7003130970822617 10.26154233613517 4.71252610285813 -4.165112055049683 2.6690353726933287 2.5852742817386596 -0.06437943294211701 -0.6224829336869455 5.829240592848388 -1.9283235560642311; -3.267709286092762 5.1077700321396735 3.9330809903829964 9.244426427136773 8.68867111135701 16.539761343969953 -5.272052298662209 2.7061353420778134 8.821710432108043 -3.429483606674073 1.7535895899297458 4.044916031316452 3.4114820972570588 -5.40445109873675 5.097142722451032 -1.2374133950901256 1.944760684957939 2.850488218102691 1.6720203884477016 -0.4401050512934188; 1.2558960614915409 -2.3519215972671277 3.4379369530243302 8.255280707380486 -12.668975887413147 -5.272052298662209 32.05886607071271 -3.9153443574171445 0.597311808702748 -7.159939393209872 -0.12314777431526742 -13.67686715031358 -8.926154333134136 2.663285783794903 -6.19907990632074 -6.962150847403804 3.7699108227938423 -7.7567604353040815 -1.2567381540418687 8.84771792529003; -6.537124595164123 5.251859978684248 1.9872826405433353 -1.1454702860098893 2.5211329932122455 2.7061353420778134 -3.9153443574171445 18.39876360622575 3.665158869432717 1.9908664493145114 1.0029510365299954 4.832189958258888 -2.3288329628958997 0.1276673220863505 4.377010735421336 7.763425880289378 4.580656874218642 -0.591498789421499 8.102008910356536 4.534697004728115; 2.560502965591387 1.4839692307383068 -9.14693567668028 3.9450651929238583 2.7623200478482346 8.821710432108043 0.597311808702748 3.665158869432717 25.540378585492927 -7.64389396065181 -6.468799238951818 -3.04588024923645 -6.881731562872513 0.20525279177233202 -2.453794913853438 5.142171006779962 0.10012025630256935 3.272979478984822 7.525702636596447 0.9292970275171553; 0.812267330132679 -0.33174216510599464 1.3777248881934414 -0.9807217330998804 1.3480142672201076 -3.429483606674073 -7.159939393209872 1.9908664493145114 -7.64389396065181 17.770119811755308 3.2276326021259343 -0.45021511936117437 5.256501578652799 -2.483677462289625 -5.277695539374783 -10.030697060234619 1.5729721060304087 1.5609060749512498 -7.883238394580825 2.5061054391405833; -9.606392059140921 0.11908657953473512 4.1375305929784805 10.445630671621357 -2.7003130970822617 1.7535895899297458 -0.12314777431526742 1.0029510365299954 -6.468799238951818 3.2276326021259343 23.311829677236993 -3.588829979556081 0.6635847539879597 6.229360364819488 -0.8035993980326457 3.1191879904878586 -10.345306129667012 2.901762241411971 -10.83293173145159 7.625555131416707; -4.391021450539187 0.6716004021210218 2.620712773292841 -5.416861940264175 10.26154233613517 4.044916031316452 -13.67686715031358 4.832189958258888 -3.04588024923645 -0.45021511936117437 -3.588829979556081 19.82169467180281 4.073442728153711 -3.376027047776719 5.27635312754488 2.2021586127011497 4.602366235060449 -3.14763607501543 7.6731283676994115 -9.003655004313524; 1.0922662708120585 0.9704233608273368 -2.7469464954968563 1.0850574513395985 4.71252610285813 3.4114820972570588 -8.926154333134136 -2.3288329628958997 -6.881731562872513 5.256501578652799 0.6635847539879597 4.073442728153711 16.89214082514548 2.903567286178969 5.0849418958348735 0.515061950019791 -1.2044452507741277 1.3264038737633472 -6.113660031427819 -9.286940993467605; 0.24790820343248382 -6.9154323685373384 -5.231991290099736 6.405258216592411 -4.165112055049683 -5.40445109873675 2.663285783794903 0.1276673220863505 0.20525279177233202 -2.483677462289625 6.229360364819488 -3.376027047776719 2.903567286178969 35.61584093296939 -1.9494384494934036 13.921083869621652 -10.247364774410546 -7.406062816640134 -0.10711300217400721 -9.727649222050019; -1.8201734143546722 -4.833342524281925 6.353298857440429 0.7226836884734482 2.6690353726933287 5.097142722451032 -6.19907990632074 4.377010735421336 -2.453794913853438 -5.277695539374783 -0.8035993980326457 5.27635312754488 5.0849418958348735 -1.9494384494934036 28.85361889354387 0.7281434872766035 -9.486215961970576 0.14167249041049612 -7.047692104013578 -5.583710300280806; -1.8415302653951926 -0.2642673928906647 -0.955953934131732 -4.8838038803785455 2.5852742817386596 -1.2374133950901256 -6.962150847403804 7.763425880289378 5.142171006779962 -10.030697060234619 3.1191879904878586 2.2021586127011497 0.515061950019791 13.921083869621652 0.7281434872766035 36.15931261936261 -1.8337579067748282 -0.21715857519199916 7.095866868366173 -11.356399337040415; 4.567113068825415 5.629609027127837 8.08225555417372 -4.611551533620946 -0.06437943294211701 1.944760684957939 3.7699108227938423 4.580656874218642 0.10012025630256935 1.5729721060304087 -10.345306129667012 4.602366235060449 -1.2044452507741277 -10.247364774410546 -9.486215961970576 -1.8337579067748282 23.352985852121297 -4.0851885676116995 9.077805998772966 3.099810970073503; 5.645481991144209 6.297468737216921 -5.918405393623921 3.873245876877796 -0.6224829336869455 2.850488218102691 -7.7567604353040815 -0.591498789421499 3.272979478984822 1.5609060749512498 2.901762241411971 -3.14763607501543 1.3264038737633472 -7.406062816640134 0.14167249041049612 -0.21715857519199916 -4.0851885676116995 22.173849558437485 1.6985945415698833 5.991922716154; -2.3873485872566453 4.120679687210085 -6.096759128605076 -6.980725332973074 5.829240592848388 1.6720203884477016 -1.2567381540418687 8.102008910356536 7.525702636596447 -7.883238394580825 -10.83293173145159 7.6731283676994115 -6.113660031427819 -0.10711300217400721 -7.047692104013578 7.095866868366173 9.077805998772966 1.6985945415698833 25.63410001961338 -2.1631643217274314; 1.8015299584725635 12.27738844183925 -1.9361648561616194 10.201493534122653 -1.9283235560642311 -0.4401050512934188 8.84771792529003 4.534697004728115 0.9292970275171553 2.5061054391405833 7.625555131416707 -9.003655004313524 -9.286940993467605 -9.727649222050019 -5.583710300280806 -11.356399337040415 3.099810970073503 5.991922716154 -2.1631643217274314 35.87523667318088] - +Ai = randn(n, n) +Ai = Ai' * Ai const Mi = (Ai + Ai') / 2 @assert isposdef(Mi) diff --git a/src/MOI_bounded_oracle.jl b/src/MOI_bounded_oracle.jl index 24a2a6ba7..378d7237f 100644 --- a/src/MOI_bounded_oracle.jl +++ b/src/MOI_bounded_oracle.jl @@ -36,8 +36,6 @@ Is implemented in the FrankWolfe package in file "moi_oracle.jl". """ function Boscia.compute_extreme_point(blmo::MathOptBLMO, d; kwargs...) lmo = convert(FrankWolfe.MathOptLMO, blmo) - @show d - print(lmo.o) v = FrankWolfe.compute_extreme_point(lmo, d; kwargs) @assert blmo isa MathOptBLMO return v From 0daa6cc9d3a8e28355b42eba4e84481d14da3835 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 15:22:17 +0100 Subject: [PATCH 12/16] No tests for Mac + Julia 1.6. --- .github/workflows/ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f889f74b..e232b5ba2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,16 @@ jobs: strategy: fail-fast: false matrix: - version: ['1.6', '1'] - os: [ubuntu-latest, macOS-latest] - arch: [x64] + include: + - version: '1' + os: ubuntu-latest + arch: x64 + - version: '1.6' + os: ubuntu-latest + arch: x64 + - version: '1' + os: mac-latest + arch: x64 steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 From 33ee1b1fc209d2def48259415b681b2aa81c2be2 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 15:55:22 +0100 Subject: [PATCH 13/16] Print message on assert. --- src/node.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.jl b/src/node.jl index c241fee82..e4386c70b 100644 --- a/src/node.jl +++ b/src/node.jl @@ -300,7 +300,7 @@ function Bonobo.evaluate_node!(tree::Bonobo.BnBTree, node::FrankWolfeNode) elseif node.id == 1 @debug "Lower bound of root node: $(lower_bound)" @debug "Current incumbent: $(tree.incumbent)" - @assert lower_bound <= tree.incumbent + 1e-5 + @assert lower_bound <= tree.incumbent + 1e-5 "lower_bound <= tree.incumbent + 1e-5 : $(lower_bound) <= $(tree.incumbent +1e-5)" end return lower_bound, NaN From e61ce783729bbd37008fe6224802cfa30be2bf5e Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 15:56:24 +0100 Subject: [PATCH 14/16] Delete comment. --- examples/strong_branching_portfolio.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/strong_branching_portfolio.jl b/examples/strong_branching_portfolio.jl index cbe339124..577848163 100644 --- a/examples/strong_branching_portfolio.jl +++ b/examples/strong_branching_portfolio.jl @@ -69,7 +69,6 @@ end @test f(x) <= f(result_baseline[:raw_solution]) + 1e-6 blmo = Boscia.MathOptBLMO(HiGHS.Optimizer()) - #blmo = Boscia.MathOptBLMO(SCIP.Optimizer()) branching_strategy = Boscia.PartialStrongBranching(10, 1e-3, blmo) MOI.set(branching_strategy.bounded_lmo.o, MOI.Silent(), true) From 6f8b4aff473a385f56c98a4f8c0011946d6c88f8 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 16:01:10 +0100 Subject: [PATCH 15/16] Minor change. --- src/node.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.jl b/src/node.jl index e4386c70b..9df2b3c1b 100644 --- a/src/node.jl +++ b/src/node.jl @@ -300,7 +300,7 @@ function Bonobo.evaluate_node!(tree::Bonobo.BnBTree, node::FrankWolfeNode) elseif node.id == 1 @debug "Lower bound of root node: $(lower_bound)" @debug "Current incumbent: $(tree.incumbent)" - @assert lower_bound <= tree.incumbent + 1e-5 "lower_bound <= tree.incumbent + 1e-5 : $(lower_bound) <= $(tree.incumbent +1e-5)" + @assert lower_bound <= tree.incumbent + 1e-5 "lower_bound <= tree.incumbent + 1e-5 : $(lower_bound) <= $(tree.incumbent)" end return lower_bound, NaN From a72f597c2ee95415069c623b808720f1d260cca3 Mon Sep 17 00:00:00 2001 From: Hendrych Date: Tue, 7 Nov 2023 17:36:39 +0100 Subject: [PATCH 16/16] Minor change. --- src/interface.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interface.jl b/src/interface.jl index 37704a494..03e8aaa7b 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -134,7 +134,7 @@ function solve( else @assert FrankWolfe.active_set_validate(active_set) for a in active_set.atoms - @assert is_linear_feasible(blmo.o, a) + @assert is_linear_feasible(blmo, a) end v = active_set.atoms[1] end