CLeARoboticsLab / MixedComplementarityProblems.jl

A custom interior point solver for mixed complementarity problems.
BSD 3-Clause "New" or "Revised" License
10 stars 3 forks source link

Terminate earlier on failures? #7

Closed lassepe closed 1 month ago

lassepe commented 1 month ago

A slightly modified version of the toy example in the README currently causes many linesearch-failures before the solver gives up. The underpinning problem seems to be that the inner loop breaks early and then the outer-loop concludes that the sub-problem was easy to solve, causing it to tighten \epsilon further.

Reproducer:

using MixedComplementarityProblems

M = [0 1; -1 0]
A = [1 0; 0 1]
b = [1; 1]
θ = rand(2)

G(x, y; θ) = M * x - θ - A' * y
H(x, y; θ) = A * x - b

mcp = MixedComplementarityProblems.PrimalDualMCP(
    G,
    H;
    unconstrained_dimension = size(M, 1),
    constrained_dimension = length(b),
    parameter_dimension = size(M, 1),
)
sol = MixedComplementarityProblems.solve(MixedComplementarityProblems.InteriorPoint(), mcp, θ)
dfridovi commented 1 month ago

@lassepe nice catch! Thoughts on the PR?