Reading preferences
Concept

Constraints and Decisions

Separate feasible assignments from preferences and uncertain outcomes.

artificial intelligence, constraints, decision making

What makes a schedule possible?

A constraint satisfaction problem (CSP) has variables, their allowed domains, and rules that valid assignments must obey. Consider two classes A and B sharing a room. Each may use morning or afternoon, but they cannot use the same time.

Assign and check

  1. Both classes start with domain {morning, afternoon}.
  2. Assign A to morning. The shared-room rule removes morning from B's options.
  3. Assign B to afternoon. Both assignments satisfy the constraint. If B had no remaining option, backtrack and try another choice for A.

See the reasoning

Narrow a timetable domain

See how the shared-room constraint affects the remaining choice. This is a prepared demonstration, not live code execution.

Start with domains

Two classes and two time slots
  1. Class AMorning or afternoonCurrent focus
  2. Class BMorning or afternoon

Both classes initially have two candidate times.

Feasibility is not preference

A hard constraint rules out a schedule; a soft preference ranks feasible schedules, such as preferring a morning class. Constraint propagation can remove impossible values early, while backtracking explores alternatives. Neither guarantees a quick answer for every large problem.

Decision-making can also involve uncertainty. Suppose an outdoor event has value 10 if dry and 0 if wet, with a stated dry probability of 0.6. Its expected value is 6. An indoor alternative worth 5 either way has expected value 5. This comparison depends on the probability and values being appropriate; fairness, risk and impacts not represented by that simple number still need consideration.

Reflect on the concept

Four fixed questions to reinforce the reasoning. Answers are not saved or scored.

1. What is a variable in the timetable example?
2. What does a domain contain?
3. What does a hard constraint do?
4. How can a decision compare uncertain outcomes?

References and further reading