Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Recipe

Solve a constrained problem with a log barrier

Use when: you have inequality constraints, a strictly feasible starting point is available, and you want every iterate to stay feasible along the way

Goal: a central path of strictly feasible points converging to the constrained optimum as μ shrinks

Taught in Barrier methods and the central path

  1. 1

    For each inequality constraint g_i(x)\le0, add -\mu\ln(-g_i(x)) to the objective.

    Example

    For \min x^2+y^2 s.t. 4-x-y\le0: B(x,y;\mu)=x^2+y^2-\mu\ln(x+y-4).

    Why: the log term is finite only where every constraint is strictly satisfied, so it's automatically undefined outside the feasible region.

  2. 2

    Locate any x_0 with g_i(x_0)<0 for every constraint, before running any solver at all.

    Why: B isn't even defined outside the feasible region, so there is no fallback if you start on the wrong side.

  3. 3

    Run an unconstrained solver on B(x;\mu_k), warm-started from the previous x(\mu_{k-1}).

    Why: the barrier term keeps every step of this solve inside the feasible region automatically.

  4. 4

    Set \mu_{k+1}=\beta\mu_k for a shrink factor \beta\in(0,1) (often around 0.1–0.5), and repeat until \mu_k is small enough.

    • \mu_k is still large relative to your tolerance — repeat the previous step.
    • \mu_k is small enough — stop; x(\mu_k) is your answer, and it is genuinely feasible.

    Why: shrinking μ too aggressively can overshoot past where the warm start is still a good guess, the same stiffness tension as growing ρ too fast in Section 2's recipe.

Common mistakes

  • Starting from an infeasible or boundary point, where B isn't even defined.
  • Shrinking μ so fast that each new subproblem's minimizer is far from the last one, defeating the warm start.
  • Forgetting that, unlike a penalty method's answer, a barrier iterate really is feasible at every μ, not just in the limit.