Settings¶
Solve Method Parameters¶
The DCCP solver accepts various parameters to control the algorithm behavior:
Name |
Type |
Description |
Allowed values |
Default value |
---|---|---|---|---|
|
|
Maximum number of iterations in the CCP algorithm |
\((1, \infty)\) |
100 |
|
|
Maximum number of damping iterations when convergence fails |
\((1, \infty)\) |
10 |
|
|
Initial value for tau parameter (trades off constraints vs objective) |
\((0, \infty)\) |
0.005 |
|
|
Rate at which tau increases during the algorithm |
\((1, \infty)\) |
1.2 |
|
|
Upper bound for tau parameter |
\((0, \infty)\) |
1e8 |
|
|
Number of random projections for variable initialization |
\((1, \infty)\) |
1 |
|
|
Number of random restarts for the CCP algorithm |
\((1, \infty)\) |
1 |
|
|
Maximum slack variable value for convergence |
\((0, \infty)\) |
1e-3 |
|
|
Convergence tolerance for objective value changes |
\((0, \infty)\) |
1e-5 |
|
|
Standard deviation for random variable initialization |
\((0, \infty)\) |
10.0 |
|
|
Random seed for reproducible results |
\(\mathbb{Z} \cup \{\text{None}\}\) |
None |
|
|
Whether to verify DCCP compliance before solving. Enables solving problems with |
\(\{0, 1\}\) |
1 |
Parameter Usage¶
You can pass these parameters to the solve method like so:
import cvxpy as cp
import dccp
# create your problem
x = cp.Variable(2)
problem = cp.Problem(cp.Maximize(cp.norm(x, 2)), [cp.norm(x, 1) <= 1])
# solve with custom parameters
result = problem.solve(
method='dccp',
max_iter=200,
tau_ini=0.01,
k_ccp=5,
seed=42
)