Foundations of AI and ML

Content

Lisam

Course materials

/

Section

Constraint Satisfaction Problems: Formalism

Constraint Networks

Lecture slides are available here.

Constraint Network?

So, is it constraint network or constraint satisfaction problem?

Properties of constraint networks II

You are given the constraint network from the previous exercise, so ${\cal C} = \langle V, dom, (R_{uv})\rangle$ with variables $V = \{v_1, v_2, v_3\}$ and domains $dom(v) = \{1, 2, 3, 4, 5\}$ for all $v \in V$.

How many assignments exist for this network?

Consistency vs. Solvability

Given the constraint network from the previous exercise, so ${\cal C} = \langle V, dom, (R_{uv})\rangle$ with variables $V = \{v_1, v_2, v_3\}$, domains $dom(v) = \{1, 2, 3, 4, 5\}$ for all $v \in V$, and constraints $v_1 < v_2$, $v_2 < v_3$. Assume the partial assignment $\alpha = \{v_1 \mapsto 2, v_3 \mapsto 3\}$.

Is $\alpha$ consistent? Can it be extended to a solution?

Map Coloring Example

Try to run the code below. This should print the solution of a simple map coloring problem encoding some of the states of Australia.

This exercise is built around the Python constraint package. You can find the package documentation here. There are also some simple example shown here.

australia

Map Coloring Australia

In the next code block you are supposed to encode the full map-coloring problem of Australia.

This webpage contains the course materials for the course TDDE56 Foundations of AI and Machine Learning.
The content is licensed under Creative Commons Attribution 4.0 International.
Copyright © 2022 Linköping University