File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
docs/src/submodules/Utilities Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,36 @@ $$ \begin{aligned}
315
315
In IJulia, calling ` print ` or ending a cell with
316
316
[ ` Utilities.latex_formulation ` ] ( @ref ) will render the model in LaTeX.
317
317
318
+ ## Utilities.FeasibilityRelaxation
319
+
320
+ Set the [ ` Utilities.FeasibilityRelaxation ` ] ( @ref ) attribute to relax the
321
+ problem by adding penalized slack variables to the constraints. This is helpful
322
+ when debugging sources of infeasible models.
323
+
324
+ ``` jldoctest
325
+ julia> model = MOI.Utilities.Model{Float64}();
326
+
327
+ julia> x = MOI.add_variable(model);
328
+
329
+ julia> MOI.set(model, MOI.VariableName(), x, "x")
330
+
331
+ julia> c = MOI.add_constraint(model, 1.0 * x, MOI.LessThan(2.0));
332
+
333
+ julia> MOI.set(model, MOI.Utilities.FeasibilityRelaxation(Dict(c => 2.0)))
334
+
335
+ julia> print(model)
336
+ Minimize ScalarAffineFunction{Float64}:
337
+ 0.0 + 2.0 v[2]
338
+
339
+ Subject to:
340
+
341
+ ScalarAffineFunction{Float64}-in-LessThan{Float64}
342
+ 0.0 + 1.0 x - 1.0 v[2] <= 2.0
343
+
344
+ VariableIndex-in-GreaterThan{Float64}
345
+ v[2] >= 0.0
346
+ ```
347
+
318
348
## Utilities.MatrixOfConstraints
319
349
320
350
The constraints of [ ` Utilities.Model ` ] ( @ref ) are stored as a vector of tuples
Original file line number Diff line number Diff line change @@ -90,6 +90,12 @@ Utilities.identity_index_map
90
90
Utilities.ModelFilter
91
91
```
92
92
93
+ ## Feasibility relaxation
94
+
95
+ ``` @docs
96
+ Utilities.FeasibilityRelaxation
97
+ ```
98
+
93
99
## MatrixOfConstraints
94
100
95
101
``` @docs
You can’t perform that action at this time.
0 commit comments