TUTORIAL -III
You are in charge of scheduling for computer science classes that meet Mondays, Wednesdays and
Fridays. There are 5 classes that meet on these days and 3 professors who will be teaching these
classes. You are constrained by the fact that each professor can only teach one class at a time.
The classes are:
• Class 1 - Intro to Programming: meets from 8:00-9:00am
• Class 2 - Intro to Artificial Intelligence: meets from 8:30-9:30am
• Class 3 - Natural Language Processing: meets from 9:00-10:00am
• Class 4 - Computer Vision: meets from 9:00-10:00am
• Class 5 - Machine Learning: meets from 9:30-10:30am
The professors are:
• Professor A, who is available to teach Classes 3 and 4.
• Professor B, who is available to teach Classes 2, 3, 4, and 5.
• Professor C, who is available to teach Classes 1, 2, 3, 4, 5.
(i) Formulate this problem as a CSP problem in which there is one variable per class, stating
the domains, and constraints. Constraints should be specified formally and precisely, but
may be implicit rather than explicit.
(ii) Draw the constraint graph associated with your CSP.
(iii) Show the domains of the variables after running arc-consistency on this initial graph (after
having already enforced any unary constraints)
(iv) Give one solution to this CSP.
2. You are a detective in charge of bringing down drug dealers (D). A tip has led you to a small
apartment complex where you believe one or more D might be hiding out. There are five apartments
in a row. Each apartment could contain a drug dealer D or could contain innocent people: adults (A),
families with babies (B), or with teenagers (T). Before you break down a door, you need to be
absolutely sure that a dealer D is inside, otherwise you could get sued for police suboptimality.
To help you narrow down where drug dealers D might be (if any are there at all!), you use the fact that
different people make different noises. Every time you walk between two apartments, you can hear
the louder of the two noises that are being made in those apartments. The loudest people are
teenagers T, who blast music (m), the next loudest are babies B who cry (c), the next loudest is the
drug dealer D, who makes a rustling sound (r), and the quietest people are adults A, who are totally
silent (s). For example, if there were a baby in one house and a teenager in next, you would hear music
(m) when standing between those apartments. Walking by the five apartments, you hear the noises
shown in the diagram above. You decide to try solving this problem as a CSP.
3. Alby-Bach University (ABU) wants to start a new degree program: B.S in Judgment Day Prevention
(JDP). Suppose the degree program is associated with the following courses:
15-211 Fundamental Data Structures and Algorithms
15-212 Principles of Programming
15-381 Artificial Intelligence: Representation and Problem-Solving
15-681 Machine Learning
80-310 Logic and Computation
21-484 Graph Theory
70-122 Accounting
70-311 Organizational Behavior
19-601 Information Warfare
In order to graduate from the degree program, one must complete the following four requirements:
Algorithms Requirement: (15-211 AND 15-212) OR (15-211 AND 15-381) OR (15-681 AND 21-
484)
Machine Learning Requirement: 15-381 OR 15-681 OR 80-310
Communications Requirement: 21-484 OR 70-311 OR 70-122
Information Warfare Requirement: 15-381 OR 19-601
In addition, the department imposes the following restrictions:
Information Aggressiveness Restriction: So that they can’t make their programs TOO smart,
students can take only one class from the set 15-381, 15-681, and 19-601.
Basic Arithmetic Restriction: Students can’t take both 15-211 and 70-122.
Organization Restriction: Students can’t take both 21-484 and 70-311.
Finally, courses cannot be used to count towards multiple graduation requirements - so if you use
15-381 to fulfill part of the Algorithms requirement it can’t count towards either the Machine
Learning Requirement or the Information Warfare Requirement.
(i) John Conner just started his junior year at ABU, and needs to graduate as soon as possible.
Suppose all he has left to take are JDP required classes. Model the problem of his trying
to find a set of classes to satisfy all requirements as a CSP (Hint: the requirements should
be your variables). What are the initial domains for each of your variables?
(ii) Show a DFS with backtracking tree for finding a set of classes that fulfill all requirements
using a variable order of the requirements in the order they are listed above, and using a
value order that selects the lowest department/course number remaining in a variable’s
domain. Indicate which constraints were violated whenever the DFS needs to backtrack.
(Note: to get full credit you must show the full DFS tree and not just the classes that are
used to fulfill each requirement).