Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/iis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Base.@kwdef mutable struct Optimizer
#
# iis attributes
time_limit::Float64 = Inf
verbose::Bool = false
verbose::Bool = true
skip_feasibility_check::Bool = false
stop_if_infeasible_bounds::Bool = true
stop_if_infeasible_ranges::Bool = true
Expand Down Expand Up @@ -258,7 +258,7 @@ function MOI.compute_conflict!(optimizer::Optimizer)
println("Starting bound analysis.")
end
bounds_consistent, variables, lb_con, ub_con =
_bound_infeasibility!(optimizer, T)
@time _bound_infeasibility!(optimizer, T)
bound_infeasibilities = length(optimizer.results)
if optimizer.verbose
println(
Expand All @@ -281,7 +281,7 @@ function MOI.compute_conflict!(optimizer::Optimizer)
println("Starting range analysis.")
end
range_consistent =
_range_infeasibility!(optimizer, T, variables, lb_con, ub_con)
@time _range_infeasibility!(optimizer, T, variables, lb_con, ub_con)
range_infeasibilities = length(optimizer.results) - bound_infeasibilities
if optimizer.verbose
println(
Expand All @@ -291,6 +291,7 @@ function MOI.compute_conflict!(optimizer::Optimizer)
if length(optimizer.results) > 0
optimizer.status = MOI.CONFLICT_FOUND
end
return

if (!range_consistent && optimizer.stop_if_infeasible_ranges) ||
!_in_time(optimizer)
Expand Down
18 changes: 11 additions & 7 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,30 @@ function _elastic_filter(optimizer::Optimizer)

de_elastisized = []

changed_obj = false

# all (affine, non-bound) constraints are relaxed at this point
# we will try to set positive slacks to zero until the model infeasible
# the constraints of the fixed slacks are a IIS candidate
# we will try to set positive slacks to zero until the model becomes
# infeasible. The constraints of the fixed slacks then form a IIS candidate.

for i in 1:max_iterations
if !_in_time(optimizer)
return nothing
end
if optimizer.verbose
println("Solving iteration $i...")
end
MOI.optimize!(model)
if optimizer.verbose
println("Iteration $i solved.")
end
status = MOI.get(model, MOI.TerminationStatus())
if status in ( # possibily primal unbounded statuses
MOI.INFEASIBLE_OR_UNBOUNDED,
MOI.DUAL_INFEASIBLE,
MOI.ALMOST_DUAL_INFEASIBLE,
)
#
if optimizer.verbose
@warn("Termination status is $status")
end
end
if status in
(MOI.INFEASIBLE, MOI.ALMOST_INFEASIBLE, MOI.LOCALLY_INFEASIBLE)
Expand Down Expand Up @@ -143,8 +149,6 @@ function _elastic_filter(optimizer::Optimizer)
# consider deleting all no iis constraints
# be careful with intervals

obj_type = MOI.get(model, MOI.ObjectiveFunctionType())
obj_func = MOI.get(model, MOI.ObjectiveFunction{obj_type}())
obj_sense = MOI.get(model, MOI.ObjectiveSense())

candidates = MOI.ConstraintIndex[]
Expand Down
Loading