Constraint Programming for Timetabling

Similar documents
Minimal Perturbation Problem in Course Timetabling

Iterative Forward Search: Combining Local Search with Maintaining Arc Consistency and a Conflict-based Statistics

Conflict-based Statistics

4.1 Interval Scheduling

Constraint Satisfaction Problems. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe

A New Approach to Modeling and Solving Minimal Perturbation Problems

Constraint Satisfaction

Announcements. Reminder: CSPs. Today. Example: N-Queens. Example: Map-Coloring. Introduction to Artificial Intelligence

Constraint Satisfaction Problems

INCOMPLETE DEPTH-FIRST SEARCH TECHNIQUES: A SHORT SURVEY

General Methods and Search Algorithms

Chronological Backtracking Conflict Directed Backjumping Dynamic Backtracking Branching Strategies Branching Heuristics Heavy Tail Behavior

Outline. Best-first search

CS 188: Artificial Intelligence Fall 2008

Announcements. CS 188: Artificial Intelligence Fall Large Scale: Problems with A* What is Search For? Example: N-Queens

CS 188: Artificial Intelligence Fall 2011

Constraint Satisfaction Problems

Announcements. CS 188: Artificial Intelligence Spring Today. A* Review. Consistency. A* Graph Search Gone Wrong

Constraint (Logic) Programming

Lecture 6: Constraint Satisfaction Problems (CSPs)

ARTIFICIAL INTELLIGENCE (CS 370D)

Constraint Satisfaction Problems

10/11/2017. Constraint Satisfaction Problems II. Review: CSP Representations. Heuristic 1: Most constrained variable

Today. CS 188: Artificial Intelligence Fall Example: Boolean Satisfiability. Reminder: CSPs. Example: 3-SAT. CSPs: Queries.

Constraint Satisfaction Problems (CSPs)

CS 188: Artificial Intelligence Spring Announcements

Recap Hill Climbing Randomized Algorithms SLS for CSPs. Local Search. CPSC 322 Lecture 12. January 30, 2006 Textbook 3.8

Announcements. Homework 4. Project 3. Due tonight at 11:59pm. Due 3/8 at 4:00pm

CSE 473: Artificial Intelligence

Constraint Satisfaction Problems

Announcements. CS 188: Artificial Intelligence Fall Reminder: CSPs. Today. Example: 3-SAT. Example: Boolean Satisfiability.

CS 188: Artificial Intelligence Fall 2008

What is Search For? CSE 473: Artificial Intelligence. Example: N-Queens. Example: N-Queens. Example: Map-Coloring 4/7/17

Lecture 18. Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1

Constraint Satisfaction Problems. A Quick Overview (based on AIMA book slides)

Announcements. CS 188: Artificial Intelligence Spring Production Scheduling. Today. Backtracking Search Review. Production Scheduling

Constraint Satisfaction Problems

On Using Graph Coloring to Create University Timetables with Essential and Preferential Conditions

CS 188: Artificial Intelligence. Recap: Search

CS 188: Artificial Intelligence Spring Announcements

Constraint Satisfaction Problems

Mathematical Programming Formulations, Constraint Programming

Constraint Satisfaction Problems

Moving to a different formalism... SEND + MORE MONEY

Satisfiability. Michail G. Lagoudakis. Department of Computer Science Duke University Durham, NC SATISFIABILITY

Constraint Satisfaction Problems

Module 4. Constraint satisfaction problems. Version 2 CSE IIT, Kharagpur

CS 188: Artificial Intelligence Spring Today

The Iterative Multi-Agent Method for Solving Complex Search Problems

Video in DSpace. Vlastimil Krejčíř, DSpace User Group Meeting, Bergen 2006

Constraint Programming

6.034 Quiz 1, Spring 2004 Solutions

Constraint Satisfaction Problems. Chapter 6

Example: Map coloring

Constraint Satisfaction Problems. Chapter 6

Validating Plans with Durative Actions via Integrating Boolean and Numerical Constraints

An Improved Upper Bound for the Sum-free Subset Constant

Comprehensive approach to University Timetabling Problem

Outline. Best-first search

CS W4701 Artificial Intelligence

Course Summary! What have we learned and what are we expected to know?

Search. Krzysztof Kuchcinski. Department of Computer Science Lund Institute of Technology Sweden.

Space of Search Strategies. CSE 573: Artificial Intelligence. Constraint Satisfaction. Recap: Search Problem. Example: Map-Coloring 11/30/2012

A fuzzy constraint assigns every possible tuple in a relation a membership degree. The function

Admin. Quick search recap. Constraint Satisfaction Problems (CSPs)! Intro Example: 8-Queens. Where should I put the queens in columns 3 and 4?

Constraint Satisfaction. AI Slides (5e) c Lin

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

Artificial Intelligence Constraint Satisfaction Problems

Constraint satisfaction search. Combinatorial optimization search.

Constraint Satisfaction Problems

Comments about assign 1. Quick search recap. Constraint Satisfaction Problems (CSPs) Search uninformed BFS, DFS, IDS. Adversarial search

3 No-Wait Job Shops with Variable Processing Times

Spezielle Themen der Künstlichen Intelligenz

CMU-Q Lecture 6: Planning Graph GRAPHPLAN. Teacher: Gianni A. Di Caro

Lars Schmidt-Thieme, Information Systems and Machine Learning Lab (ISMLL), University of Hildesheim, Germany, Course on Artificial Intelligence,

On Degree Properties of Crossing-critical Families of Graphs

CS 188: Artificial Intelligence Fall 2011

Announcements. CS 188: Artificial Intelligence Spring Today. Example: Map-Coloring. Example: Cryptarithmetic.

Planar Emulators Conjecture Is Nearly True for Cubic Graphs

Artificial Intelligence

Artificial Intelligence

CONSTRAINT SATISFACTION

Artificial Intelligence

CS 188: Artificial Intelligence. What is Search For? Constraint Satisfaction Problems. Constraint Satisfaction Problems

Constraint Satisfaction Problems (CSPs) Introduction and Backtracking Search

Artificial Intelligence

Example: Map-Coloring. Constraint Satisfaction Problems Western Australia. Example: Map-Coloring contd. Outline. Constraint graph

1st International Workshop on Local Search Techniques in Constraint Satisfaction

Foundations of Artificial Intelligence

Recap: Search Problem. CSE 473: Artificial Intelligence. Space of Search Strategies. Constraint Satisfaction. Example: N-Queens 4/9/2012

Constraint Satisfaction Problems

Local Consistency in Weighted CSPs and Inference in Max-SAT

Constraint Programming

4 Search Problem formulation (23 points)

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

Constraint Satisfaction Problems Part 2

1 The comparison of QC, SC and LIN

Announcements. CS 188: Artificial Intelligence Fall 2010

CS 4100 // artificial intelligence

Notes on CSP. Will Guaraldi, et al. version 1.7 4/18/2007

Transcription:

Constraint Programming for Faculty of Informatics, Masaryk University Brno, Czech Republic http://www.fi.muni.cz/~hanka ASAP Seminar, 2004

University Course demands for individual students conflicts among classes of one student minimized Timetable for large lecture classes Fall 2001 manually created: slightly smaller (750 classes), less constrained (about 40 assigned prior search) Fall 2004 830 classes. = 1500 meetings 50 classrooms 89,633 course demands for 29,808 students about 350 classes assigned before search Spring 2005 easier data set no freshmen consideration, about 780 classes

1 University 2 Constraint Satisfaction 3 4 5

Constraint Satisfaction () Constraint satisfaction (X, D, C) finite set of domain variables X = {V 1,..., V n } finite set of values (domain) D = D 1... D n finite set of constraints C = {c 1,..., c m } relations over subsets of variables

Constraint Satisfaction () Constraint satisfaction (X, D, C) finite set of domain variables X = {V 1,..., V n } finite set of values (domain) D = D 1... D n finite set of constraints C = {c 1,..., c m } relations over subsets of variables Partial assignment of variables (d 1,..., d k ), k n Complete assignment of variables (d 1,..., d n ) Solution of complete assignment which satisfies all constraints

Constraint Satisfaction () Constraint satisfaction (X, D, C) finite set of domain variables X = {V 1,..., V n } finite set of values (domain) D = D 1... D n finite set of constraints C = {c 1,..., c m } relations over subsets of variables Partial assignment of variables (d 1,..., d k ), k n Complete assignment of variables (d 1,..., d n ) Solution of complete assignment which satisfies all constraints Constrain & constraint propagation

Constraint Satisfaction () Constraint satisfaction (X, D, C) finite set of domain variables X = {V 1,..., V n } finite set of values (domain) D = D 1... D n finite set of constraints C = {c 1,..., c m } relations over subsets of variables Partial assignment of variables (d 1,..., d k ), k n Complete assignment of variables (d 1,..., d n ) Solution of complete assignment which satisfies all constraints Constrain & constraint propagation example variables: time T and classroom R for each class domains: possible starting times, possible classrooms constraints: required classrooms, precedence relations among times

Global Constraints 3 serialized 2 classes of the same instructor at different times disjoint2 two classes must have different time or classrooms 1 3 2 1 1 2 3 4 5 6 cumulative for approximation ( ) classes change classroom example: big classrooms on time variables only 3 2 1 1 2 3 4 5 6 1 2 3 4 5 6

s constrained there is no solution with all constraints satisfied Solution: constraint modeling by hard and soft constraints hard constraints = everything what must be satisfied soft constraints = optimization part part of the which can be unsatisfied optimization for preferential requirements Example of soft constraints too many preferential time requirements two classes share some students

Weighted constraints each constraint associated with the weight example: V 1 #\ = V 2 @weight aim: minimize weighted sum of unsatisfied constraints

Weighted constraints each constraint associated with the weight example: V 1 #\ = V 2 @weight aim: minimize weighted sum of unsatisfied constraints Weighted constraints + hard constraints stronger propagation for hard constraints optimization for weighted constraints

Solver for Each value of the variable associated with a weight unary soft constraints Soft constraint propagation unsatisfied c @ weight increases weights of values for variables in c Evaluation of the solution [V 1 = v 1,..., V n = v n ]: w[v i, v i ] Aim: minimize evaluation of the solution i

Solver for Each value of the variable associated with a weight unary soft constraints Soft constraint propagation unsatisfied c @ weight increases weights of values for variables in c Evaluation of the solution [V 1 = v 1,..., V n = v n ]: w[v i, v i ] i Aim: minimize evaluation of the solution Example: V 1 #\ = V 2 @weight V 1 or V 2 is instantiated to value v weight of the value v for second variable V i increased by weight w[v i, v] + weight partial forward checking

Examples of Unary soft constraint times or locations are preferred or discouraged Soft serialized constraint class A should not overlap with B weight is the number of students in common Soft cumulative constraint At most N classes of some department are taught at the same time N is a soft limit

s mistakes in the definition Mistake = contradiction of hard constraints Example constraint propagation two teachers require the same classroom at the same time

s mistakes in the definition Mistake = contradiction of hard constraints Example constraint propagation two teachers require the same classroom at the same time Mistakes must be removed from the definition to find a solution Solution: detection of mistakes during search during posting hard constraints

Tree Complete search Depth First

Tree Complete search Depth First Incomplete search: cutoff strategy constrain some of the available resources Depth Bounded DBS(1)

Limited Assignment Number LAN(2)

Limited Assignment Number LAN(2) Constraint propagation values incompatible with the current partial assignment are removed from the domains LAN(3) + constraint propagation do not waste time on hard variables explore various parts of the search tree

Maximal Consistent Assignment Unassigned variables second variable V 2 unassigned some constraint(s) on V 2 remain(s) unsatisfied

Maximal Consistent Assignment Unassigned variables second variable V 2 unassigned some constraint(s) on V 2 remain(s) unsatisfied Consistent assignment satisfy (at least) all constraints over assigned variables Maximal consistent assignment consistent assignment of the largest cardinality Locally maximal consistent assignment assignment which can not be extended to non-instantiated variable

Restart for LAN 1 restart algorithm with different setting unassigned variables first untried values for unassigned values first successful values for assigned variables

Restart for LAN 1 restart algorithm with different setting unassigned variables first untried values for unassigned values first successful values for assigned variables 2 automated restart until the number of assigned variables increases 3 detection of possible s over unassigned variables + hard to solve parts, weak propagation 4 continue with restart with the changes redefinition does not introduce any changes in restart strategy

How to Discover? Undesirable inconsistencies Mistakes in data input minimize by user interface types of mistakes introduced during data entry naturally included as a part of the

How to Discover? Undesirable inconsistencies Mistakes in data input minimize by user interface types of mistakes introduced during data entry naturally included as a part of the Explanations computationally expensive not available in standalone constraint solvers During search LAN search user need some partial solution user can change the Before search manual process automated process

Preconditions for Detection of Detail (print) information about posting each constraints each value removal Post constraints in specific order most complex first, most simple last Complex constraints disjoint2, cumulative detection of a conflict here is not easy Simple constraints constraints over small set of variables unary constraints over location or time

Towards Automated Process of Detection 1 Fail during constraint posting 2 Last posted constraint c LAST failed 3 Variables in c LAST are variables 4 Tracking of value removals for variables 5 Value removal was due to constraint c REMOVE 6 Check consistency of c LAST and c REMOVE In our, conflict between c LAST and c REMOVE was always source of a mistake.

Conclusion constrained, ill-defined s solver for weighted soft constraints locally maximal consistent assignment during search detection of mistakes for standalone constraint solvers

Conclusion constrained, ill-defined s solver for weighted soft constraints locally maximal consistent assignment during search detection of mistakes for standalone constraint solvers Optimization multi-criteria optimization minimal perturbation