Diagnosing an infeasible model can be tricky. Sometimes solvers provide useful information like conflict reports and the constraints involved in the infeasibility - for these to be useful, we have to be able to relate the reported constraint with a constraint in our model. This currently works well for reugular constraints which can be named. However, variable bounds and integrality constraints, to the best of my knowledge are not named and when these are the cause of/involved in an infeasibility, it is difficult to dagnose. If we could name these constraints, it would be great. Is it / could it be possible?
Naming variable bound and integrality constraints in Jump
Variables have names. A reference like “integrality constraint on variable XYZ” should be sufficient, right?
Do you have an example in which the integrality or bound constraint not being named is a problem?
I don’t really understand where it would show up as an issue.
julia> using JuMP, Gurobi julia> model = Model(Gurobi.Optimizer) A JuMP Model Feasibility problem with: Variables: 0 Model mode: AUTOMATIC CachingOptimizer state: EMPTY_OPTIMIZER Solver name: Gurobi julia> @variable(model, x >= 1) x julia> @constraint(model, c, x <= 0) c : x ≤ 0.0 julia> optimize!(model) Gurobi Optimizer version 10.0.0 build v10.0.0rc2 (mac64[x86]) CPU model: Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz Thread count: 4 physical cores, 8 logical processors, using up to 8 threads Optimize a model with 1 rows, 1 columns and 1 nonzeros Model fingerprint: 0x3adb76f2 Coefficient statistics: Matrix range [1e+00, 1e+00] Objective range [0e+00, 0e+00] Bounds range [1e+00, 1e+00] RHS range [0e+00, 0e+00] Presolve removed 0 rows and 1 columns Presolve time: 0.00s Solved in 0 iterations and 0.00 seconds (0.00 work units) Infeasible model User-callback calls 19, time in user-callback 0.00 sec julia> compute_conflict!(model) IIS computed: 1 constraints and 1 bounds IIS runtime: 0.00 seconds (0.00 work units) julia> new_model, ref_map = copy_conflict(model); julia> print(new_model) Feasibility Subject to c : x ≤ 0.0 x ≥ 1.0