-
Notifications
You must be signed in to change notification settings - Fork 4
Integer programming solver #143
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
Conversation
…to nzy/PointSlicer
…to nzy/PointSlicer
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #143 +/- ##
==========================================
+ Coverage 93.64% 93.84% +0.19%
==========================================
Files 38 39 +1
Lines 1590 1640 +50
==========================================
+ Hits 1489 1539 +50
Misses 101 101 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
GiggleLiu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are not included.
Project.toml
Outdated
| Graphs = "1" | ||
| InteractiveUtils = "1" | ||
| JuMP = "1" | ||
| LinearAlgebra = "1.11.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| LinearAlgebra = "1.11.0" | |
| LinearAlgebra = "1" |
| @testset "solvers" begin | ||
| include("solvers.jl") | ||
| end | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IPSolverExt.jl should be included.
ext/IPSolverExt.jl
Outdated
| return round.(Int, JuMP.value.(x)) | ||
| end | ||
|
|
||
| function minimal_constraints(nflavor::Int, set::Vector) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is not tested.
ext/IPSolverExt.jl
Outdated
| JuMP.optimize!(model) | ||
|
|
||
| # Return the solution if feasible | ||
| if JuMP.termination_status(model) == JuMP.MOI.OPTIMAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use @assert is_solved_and_feasible(model) "error message..."?
ext/IPSolverExt.jl
Outdated
| end | ||
| end | ||
|
|
||
| obj_sum = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unstable type.
ext/IPSolverExt.jl
Outdated
| end | ||
|
|
||
| obj_sum = 0 | ||
| for obj in objs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objectives can have more than one variables. The current code will scilently break for Spinglass.
ext/IPSolverExt.jl
Outdated
| # Returns | ||
| - `Vector{Int}`: The indices of the subsets to choose. | ||
| """ | ||
| function minimal_set_cover(coverset::Vector{Int}, subsets::Vector{Vector{Int}}, optimizer, verbose::Bool=false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need it anymore. Maybe we can dispatch it to set covering problem solver.
Each integer programming constrain removes one infeasible local configuration.