1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
6// http://www.apache.org/licenses/LICENSE-2.0
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
14// Messages for representing subsets of a models constraints, and for computing
15// infeasible subsystems of a model. Cf. "Irreducible Inconsistent subsystems"
16// (IIS), which are useful for debugging/diagnosing model infeasibility.
19package operations_research.math_opt;
21import "ortools/math_opt/result.proto";
23option java_package = "com.google.ortools.mathopt";
24option java_multiple_files = true;
26// Represents a subset of the constraints (including variable bounds and
27// integrality) of a `ModelProto`.
28message ModelSubsetProto {
34 // Keys are variable IDs, and must be in [0, max(int64)). Values indicate
35 // which of the lower and upper variable bounds are included in the subsystem.
36 map<int64, Bounds> variable_bounds = 1;
38 // Variable IDs. Values must be in [0, max(int64)) and strictly increasing.
39 repeated int64 variable_integrality = 2;
41 // Keys are linear constraint IDs, and must be in [0, max(int64)). Values
42 // indicate which of the lower and upper bounds on the linear constraint are
43 // included in the subsystem.
44 map<int64, Bounds> linear_constraints = 3;
46 // Keys are quadratic constraint IDs, and must be in [0, max(int64)). Values
47 // indicate which of the lower and upper bounds on the quadratic constraint
48 // are included in the subsystem.
49 map<int64, Bounds> quadratic_constraints = 4;
51 // Second-order cone constraint IDs. Values must be in [0, max(int64)) and
52 // strictly increasing.
53 repeated int64 second_order_cone_constraints = 5;
55 // SOS1 constraint IDs. Values must be in [0, max(int64)) and strictly
57 repeated int64 sos1_constraints = 6;
59 // SOS2 constraint IDs. Values must be in [0, max(int64)) and strictly
61 repeated int64 sos2_constraints = 7;
63 // Indicator constraint IDs. Values must be in [0, max(int64)) and strictly
65 repeated int64 indicator_constraints = 8;
68message ComputeInfeasibleSubsystemResultProto {
69 // The primal feasibility status of the model, as determined by the solver.
70 FeasibilityStatusProto feasibility = 1;
72 // An infeasible subsystem of the input model. Set if `feasibility` is
73 // INFEASIBLE and empty otherwise. The IDs correspond to those constraints
74 // included in the infeasible subsystem. Submessages with `Bounds` values
75 // indicate which side of a potentially ranged constraint are included in the
76 // subsystem: lower bound, upper bound, or both.
77 ModelSubsetProto infeasible_subsystem = 2;
79 // True if the solver has certified that the returned subsystem is minimal
80 // (the instance is feasible if any additional constraint is removed). Note
81 // that, due to problem transformations MathOpt applies or idiosyncrasies of
82 // the solvers contract, the returned infeasible subsystem may not actually be