courses:hcai:lab_csp

  • Reading:
    • AIMA: Chapter 5, Sections 5.1-5.3. Focus on CSP formulation, variables, domains, constraints, assignments and solutions, propagation, backtracking, and search heuristics.
    • MiniZinc Handbook: Sections 2.1.1 and 2.1.5. Learn the basic roles of parameters, decision variables, constraints, and solve. MiniZinc will not be covered in the entry quiz or Q&A, but these basics are required to work efficiently during the laboratory.
  • Technical preparation:
    • Open today's notebook and run all setup cells and the code cell in Installation check to verify that MiniZinc works in your environment. The output should be a dictionary containing values for `x` and `y`, for example `{'x': 10, 'y': 2}`. The exact values may differ, but they must satisfy `x + y = 12` and `x > y`.

Entry quiz

  1. A solver returns a valid schedule, but two talks occupy the same room at the same time. Is the solver wrong?
  2. Three talks must use different slots. One is fixed to slot 1, and another cannot use slot 3. Does the solver need to search?
  3. One unassigned variable has two legal values, while another has five. Which should the solver assign first?
  4. One schedule avoids track conflicts, while another better respects preferred times. Which schedule is better?

Notebook: HCAI_Lab_Constraint_Satisfaction_Problems.ipynb (Work in Google Colab or download the .ipynb file to local environment)

Work in groups of 2-4. Every group member must be able to explain the results.

Work in groups of 2-4 on the Balanced Academic Curriculum Problem using the provided Starter Notebook.

Assign courses to academic periods while respecting prerequisites and limits on the number of courses and credits in each period. Begin by completing the missing hard constraints and use the supplied validator to check your curriculum. Then optimize the schedule by minimizing the highest period load.

Improve your model through controlled experiments with redundant constraints, search strategies, variable representations, or alternative objectives. Compare at least two meanings of a balanced curriculum and keep one successful and one unsuccessful experiment.

Do not inspect or reuse the solutions published in the CSPLib repository before completing the challenge. Your group should be ready to explain its constraints and make a small live modification.

Start the challenge during the lab and continue it as part of the self-study regarding classes. Selected groups may share their curricula and modelling choices at the next lab, and effective solutions may receive bonus points.

  • LogicPuzzleX – Watch propagation, forward checking, MRV, arc consistency, and backtracking solve the same Sudoku. You can also race the algorithms or request explanations of individual deductions.
  • Interactive CSP Solvers – Solve N-Queens yourself, then watch recursive backtracking and forward checking explore the board.
  • Logic Pad – Play and create colourful grid-based logic puzzles. Its hint system can explain deductions instead of only revealing the answer.
  • Constraint-Generated Puzzle Games – Play Sudoku, Nonogram, Queens, Tents, Loopy, and other puzzles, then inspect compact constraint models used to generate and verify them.
  • CSPLib – Explore classic CSP specifications, datasets, models, and known results from scheduling, design, allocation, puzzles, and industrial applications.
  • MiniZinc Challenge – See how modern constraint solvers compete on common satisfaction and optimisation benchmarks, including feasibility, solution quality, and proof of optimality.
  • XCSP3 Competition – Compare solver results, traces, and benchmark instances across CSP and constraint-optimisation categories.
  • Constraint Programming in Practice – A retrospective on real applications and the gap between elegant benchmark models and decision-support systems used in practice.
  • Airport Ground-Staff Scheduling – A real case combining personnel rostering and task assignment, showing why separately solving connected planning problems may produce inferior schedules.
  • courses/hcai/lab_csp.txt
  • Last modified: 9 days ago
  • by kkt