Skip to content

KSparseBallLMO#268

Open
LJS42 wants to merge 43 commits into
ZIB-IOL:mainfrom
LJS42:extandLMO
Open

KSparseBallLMO#268
LJS42 wants to merge 43 commits into
ZIB-IOL:mainfrom
LJS42:extandLMO

Conversation

@LJS42

@LJS42 LJS42 commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

1.Extend the Polytope LMOs from FW to Boscia: KNormBallLMO, DiamondLMO (generalisation of the L1-norm ball), KSparseLMO
2.For the DiamondLMO, the L1 norm version is the only implemented,a diamond constraint can be inputed, but the result will most likely be incorrect because it implements L1 norm. haven't figured out how to implement a diamond constraint yet.

@codecov

codecov Bot commented Nov 26, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.48649% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.53%. Comparing base (ee5cc6c) to head (f1efb79).
⚠️ Report is 132 commits behind head on main.

Files with missing lines Patch % Lines
src/polytope_blmos.jl 86.48% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #268      +/-   ##
==========================================
- Coverage   86.23%   82.53%   -3.71%     
==========================================
  Files          17       22       +5     
  Lines        1482     2971    +1489     
==========================================
+ Hits         1278     2452    +1174     
- Misses        204      519     +315     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LJS42

LJS42 commented Dec 3, 2025

Copy link
Copy Markdown
Contributor Author

There is only DiamondLMO(L1) and KsparseLMO

@LJS42 LJS42 changed the title Extand BLMO KNormBallLMO Dec 17, 2025
@LJS42 LJS42 changed the title KNormBallLMO KSparseBallLMO Dec 17, 2025
@LJS42

LJS42 commented Dec 17, 2025

Copy link
Copy Markdown
Contributor Author

Now is only Ksparse

Comment thread src/polytope_blmos.jl Outdated
Comment on lines +731 to +734
struct KSparseBLMO <: FrankWolfe.LinearMinimizationOracle
K::Int
right_hand_side::Float64
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not necessary.

Comment thread src/polytope_blmos.jl Outdated
Comment on lines +736 to +744
function bounded_compute_extreme_point(
lmo::KSparseBLMO,
direction,
lb,
ub,
int_vars;
v=nothing,
kwargs...,
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

function bounded_compute_extreme_point(
lmo::FrankWolfe.KSparseLMO{T},
direction,
lb,
ub,
int_vars;
v=nothing,
kwargs...
)
..
end

Comment thread src/polytope_blmos.jl
Comment thread test/heuristics.jl Outdated
Comment on lines +222 to +226

n = 20
sparsity = 0.3
x_sol = [rand() < sparsity ? 0 : rand(1:floor(Int, n / 4)) for _ in 1:n]
n_int = 17

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove not needed.

Comment thread src/polytope_blmos.jl
Comment thread test/MOI_polytope.jl Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would rename the file to "custom_lmo_testing.jl".

Comment thread test/MOI_polytope.jl Outdated
using FrankWolfe


@testset "LMO vs MOI on the same feasible region" begin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Specify the feasible region as we are going to add tests for all custom LMOs.

Comment thread test/MOI_polytope.jl Outdated
Comment on lines +24 to +26
# --- MOI ---
model = MOI.instantiate(HiGHS.Optimizer)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the model would be easier to read if you use JuMP. MOI is essentially the back-end of JuMP.

Comment thread test/MOI_polytope.jl Outdated

v_moi = [MOI.get(model, MOI.VariablePrimal(), v[i]) for i in 1:n]

# compare objective values (not pointwise equality!)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You do want to verify that you get the same point. This should check entry-wise equality.

Comment thread src/polytope_blmos.jl
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