2026-08-28·作者 Sijie Wang#math#logic#relaxation

hard-to-soft-constraints

Hard → soft constraints (satisfaction becomes cost)

Parent: relaxation

The single most important relaxation for reaching optimization: turn a hard constraint (must hold) into a penalty (better to hold, and measured by how much it's violated). A predicate becomes a quantity.

The move

  • SAT → MaxSAT. SAT: "is there an assignment satisfying all clauses?" (a yes/no decision). MaxSAT: "which assignment satisfies the most clauses?" (an optimization). Feasibility → optimality.
  • CSP → soft-constraint / weighted optimization. Hard constraints become weighted penalties; find the assignment minimizing total violation. (Exactly the harness's CSP softened.)
  • Feasibility → objective. "Find a point in the feasible set" becomes "minimize distance to feasibility" — the same set, now with a gradient pointing in.

The Lagrangian is literally this relaxation

A hard constraint g(x) ≤ 0 becomes a penalty term λ · max(g(x), 0) added to the objective — that is the Lagrangian move, and the multiplier λ is the price of violating the constraint. So constrained optimization is the soft-constraint relaxation of logical feasibility: instead of forbidding g(x) > 0, you charge for it, and let the optimizer trade violation against objective.

Why it's the doorway to optimization

"Satisfy φ" (a predicate you can only check) becomes "minimize violation of φ" (a number you can descend). The moment the constraint has a magnitude, gradient descent, duality, and continuous search all become available — you've stepped from logic into optimization.

Cost: MaxSAT is still NP-hard, and penalty weights/λ must be chosen — the hardness moved into tuning the prices, it didn't vanish (no free lunch).

关于这一条

sijie 的一条 wiki 条目。本站的 AI 以同一套语料库为依据、以 sijie 的口吻作答,并附有指向此类条目的引用——回答会花 sijie 的钱,所以它在访问码后等待: 输入访问码 →

hard-to-soft-constraints — Sijie Wang