Back to AI Math Mind Map
中文·English
📐 AI MathID: convex-kkt

Convex Optimization & KKT

凸优化与 KKT
🎯Core Definition
Convex optimization studies problems whose objective and feasible set are both convex (f(θx1+(1θ)x2)θf(x1)+(1θ)f(x2)f(\theta x_1 + (1-\theta)x_2) \le \theta f(x_1) + (1-\theta)f(x_2) for all θ[0,1]\theta \in [0,1], so any local optimum is global). A constrained problem minxf(x)\min_x f(x) s.t. hi(x)=0, gj(x)0h_i(x) = 0,\ g_j(x) \le 0 is converted to unconstrained form via the Lagrangian L(x,λ,μ)=f(x)+iλihi(x)+jμjgj(x)L(x, \lambda, \mu) = f(x) + \sum_i \lambda_i h_i(x) + \sum_j \mu_j g_j(x), where inequality multipliers must satisfy μj0\mu_j \ge 0 (dual feasibility) so that violations are penalized rather than rewarded. The KKT conditions — necessary, and sufficient under convexity + Slater's condition — are: ① stationarity xL=f+iλihi+jμjgj=0\nabla_x L = \nabla f + \sum_i \lambda_i\nabla h_i + \sum_j \mu_j\nabla g_j = 0; ② primal feasibility hi(x)=0, gj(x)0h_i(x) = 0,\ g_j(x) \le 0; ③ dual feasibility μj0\mu_j \ge 0; ④ complementary slackness μjgj(x)=0\mu_j g_j(x) = 0. Intuition: an inactive constraint (gj<0g_j < 0, solution strictly inside the feasible set) forces μj=0\mu_j = 0, while μj>0\mu_j > 0 means the constraint is active (gj=0g_j = 0) and pins the solution to the boundary.
💡Use Cases
SVM duality derivations, norm-constrained regularization (e.g. the ball form of L1), constrained policy optimization, and any interview follow-up on solving constrained problems. Classic example: min12(x2)2\min \frac{1}{2}(x-2)^2 s.t. x1x \le 1. KKT: x2+μ=0x - 2 + \mu = 0, x1x \le 1, μ0\mu \ge 0, μ(x1)=0\mu(x-1) = 0. If μ=0\mu = 0 then x=2x = 2 violates the constraint, so x=1x = 1 and μ=1\mu = 1 — the unconstrained optimum 2 lies outside the feasible set, so the solution is pushed onto the boundary.
Key Problems Solved
constrained optimization becomes an algebraic system without explicitly sweeping the feasible boundary; duality gives weak duality minxmaxμ0Lmaxμ0minxL\min_x \max_{\mu\ge0} L \ge \max_{\mu\ge0} \min_x L, and under Slater's condition (an interior feasible point exists) strong duality f=df^* = d^* holds, letting models like SVM be solved via the dual and making KKT necessary-and-sufficient for optimality.
🎯5 High-Frequency Exam Points
1
Write the Lagrangian L=f+iλihi+jμjgjL = f + \sum_i\lambda_i h_i + \sum_j\mu_j g_j and all four KKT conditions (stationarity / primal / dual / complementary slackness) with intuition for each.
2
Intuition of complementary slackness μjgj=0\mu_j g_j = 0: why must μj=0\mu_j = 0 when the constraint is inactive? Give an example where the constraint is active on the boundary.
3
Solve min12(x2)2\min \frac{1}{2}(x-2)^2 s.t. x1x \le 1 via KKT: write all equations, discuss the μ=0\mu = 0 branch, and solve.
4
When are KKT conditions necessary and sufficient? What is the relation between Slater's condition and strong duality f=df^* = d^*?
5
In hard-margin SVM duality, which constraints are active? How do support vectors connect to complementary slackness μjgj=0\mu_j g_j = 0?
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "Convex Optimization & KKT"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardAdam/AdamW MathNext CardNewton's Method

🔗 More AI Math Knowledge Cards

Bayesian InferenceBias-Variance DecompositionBootstrapCausal Inference (Rubin)