liveBook · Manning

Hard constraint

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

A hard constraint is a constraint that every acceptable solution must satisfy.

A hard constraint is a rule that every acceptable solution must satisfy. It defines feasibility alongside decision variables and objective functions; violating it makes a solution unacceptable rather than merely less desirable. section 1.3.3 section 2.1

Typical hard constraints include:

  • Preventing two lectures from occupying the same room at the same time. section 1.3.3
  • Preventing a teacher from delivering multiple lectures simultaneously. section 1.3.3
  • Forbidding selected routing options, such as ferries, toll roads, or highways. section 1.3.3
  • Requiring physical and virtual ticket sales to total exactly 10,000. section 2.1.3

Hard constraints may be equalities or inequalities and can restrict the feasible search space. Soft constraints differ because they are desirable but optional, commonly represented through rewards or penalties in the objective function. section 1.3.3 section 2.1.3

Ticket pricing with an equality constraint

A ticket-pricing problem can first optimize profit over prices from $0 to $250. After adding physical and virtual attendance, the requirement x + y = 10,000 becomes a hard equality constraint; Lagrange multipliers solve the constrained formulation. section 2.1.3

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Explains feasibility, equality and inequality forms, and contrasts penalties for soft constraints without developing general solver theory.
Examples
Uses school timetabling, navigation preferences, cargo-bike capacity, and ticket sales totaling exactly 10,000.
What it assumes
Assumes decision variables and objective functions while distinguishing hard constraints from soft preferences.
What you can do after
Evaluate whether a candidate solution is feasible and formulate equality or inequality restrictions for optimization.
How it connects
Connects hard constraints with constrained optimization, feasible search spaces, decision variables, objective functions, and soft constraints.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.