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
