@@ -19,6 +19,8 @@ def _solve_least_core_linear_program(
1919 b_eq : NDArray [np .float_ ],
2020 A_lb : NDArray [np .float_ ],
2121 b_lb : NDArray [np .float_ ],
22+ * ,
23+ epsilon : float = 0.0 ,
2224 ** options ,
2325) -> Tuple [Optional [NDArray [np .float_ ]], Optional [float ]]:
2426 """Solves the Least Core's linear program using cvxopt.
@@ -44,6 +46,7 @@ def _solve_least_core_linear_program(
4446 coefficients of a linear inequality constraint on ``x``.
4547 :param b_lb: The inequality constraint vector. Each element represents a
4648 lower bound on the corresponding value of ``A_lb @ x``.
49+ :param epsilon: Relaxation value by which the subset utility is decreased.
4750 :param options: Keyword arguments that will be used to select a solver
4851 and to configure it. For all possible options, refer to `cvxpy's documentation
4952 <https://www.cvxpy.org/tutorial/advanced/index.html#setting-solver-options>`_
@@ -54,11 +57,13 @@ def _solve_least_core_linear_program(
5457
5558 x = cp .Variable (n_variables )
5659 e = cp .Variable ()
60+ epsilon_parameter = cp .Parameter (name = "epsilon" , nonneg = True , value = epsilon )
61+
5762 objective = cp .Minimize (e )
5863 constraints = [
5964 e >= 0 ,
6065 A_eq @ x == b_eq ,
61- A_lb @ x + e * np .ones (len (A_lb )) >= b_lb ,
66+ ( A_lb @ x + e * np .ones (len (A_lb ))) >= ( b_lb - epsilon_parameter ) ,
6267 ]
6368 problem = cp .Problem (objective , constraints )
6469
@@ -105,6 +110,7 @@ def _solve_egalitarian_least_core_quadratic_program(
105110 b_eq : NDArray [np .float_ ],
106111 A_lb : NDArray [np .float_ ],
107112 b_lb : NDArray [np .float_ ],
113+ epsilon : float = 0.0 ,
108114 ** options ,
109115) -> Optional [NDArray [np .float_ ]]:
110116 """Solves the egalitarian Least Core's quadratic program using cvxopt.
@@ -131,6 +137,7 @@ def _solve_egalitarian_least_core_quadratic_program(
131137 coefficients of a linear inequality constraint on ``x``.
132138 :param b_lb: The inequality constraint vector. Each element represents a
133139 lower bound on the corresponding value of ``A_lb @ x``.
140+ :param epsilon: Relaxation value by which the subset utility is decreased.
134141 :param options: Keyword arguments that will be used to select a solver
135142 and to configure it. Refer to the following page for all possible options:
136143 https://www.cvxpy.org/tutorial/advanced/index.html#setting-solver-options
@@ -143,10 +150,12 @@ def _solve_egalitarian_least_core_quadratic_program(
143150 n_variables = A_eq .shape [1 ]
144151
145152 x = cp .Variable (n_variables )
153+ epsilon_parameter = cp .Parameter (name = "epsilon" , nonneg = True , value = epsilon )
154+
146155 objective = cp .Minimize (cp .norm2 (x ))
147156 constraints = [
148157 A_eq @ x == b_eq ,
149- A_lb @ x + subsidy * np .ones (len (A_lb )) >= b_lb ,
158+ ( A_lb @ x + subsidy * np .ones (len (A_lb ))) >= ( b_lb - epsilon_parameter ) ,
150159 ]
151160 problem = cp .Problem (objective , constraints )
152161
0 commit comments