• Keine Ergebnisse gefunden

Foundations of Artificial Intelligence 27. Constraint Satisfaction Problems: Constraint Graphs Malte Helmert

N/A
N/A
Protected

Academic year: 2022

Aktie "Foundations of Artificial Intelligence 27. Constraint Satisfaction Problems: Constraint Graphs Malte Helmert"

Copied!
18
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

27. Constraint Satisfaction Problems: Constraint Graphs

Malte Helmert

University of Basel

April 19, 2021

(2)

Constraint Satisfaction Problems: Overview

Chapter overview: constraint satisfaction problems 22.–23. Introduction

24.–26. Basic Algorithms 27.–28. Problem Structure

27. Constraint Graphs 28. Decomposition Methods

(3)

Constraint Graphs

(4)

Motivation

To solve a constraint network consisting ofn variables andk values, kn assignments must be considered.

Inference can alleviate this combinatorial explosion, but will not always avoid it.

Many practically relevant constraint networks are efficiently solvable if their structureis taken into account.

(5)

Constraint Graphs

Definition (constraint graph)

LetC=hV,dom,(Ruv)i be a constraint network.

Theconstraint graphof C is the graph whose vertices are V and which contains an edge betweenu andv iff Ruv is a nontrivial constraint.

(6)

Constraint Graphs: Example

Coloring of the Australian states and territories

Victoria

WA

NT

SA

Q

NSW

V

T

(7)

Unconnected Graphs

(8)

Unconnected Constraint Graphs

Proposition (unconnected constraint graphs)

If the constraint graph ofC has multiple connected components, the subproblems induced by each component can be solved separately.

The union of the solutions of these subproblems is a solution forC.

Proof.

A total assignment consisting of combined subsolutions satisfies all constraints that occur within the subproblems.

From the definitions of constraint graphs and connected components, all nontrivial constraints are within a subproblem.

(9)

Unconnected Constraint Graphs

Proposition (unconnected constraint graphs)

If the constraint graph ofC has multiple connected components, the subproblems induced by each component can be solved separately.

The union of the solutions of these subproblems is a solution forC.

Proof.

A total assignment consisting of combined subsolutions satisfies all constraints that occurwithin the subproblems.

From the definitions of constraint graphs and connected components,all nontrivial constraints are within a subproblem.

(10)

Unconnected Constraint Graphs: Example

example: Tasmania can be colored independently from the rest of Australia.

Victoria

WA NT

SA Q

NSW

V

T

further example:

network withk = 2,n = 30 that decomposes into three components of equal size

savings?

only 3·210= 3072 assignments instead of 230= 1073741824

(11)

Unconnected Constraint Graphs: Example

example: Tasmania can be colored independently from the rest of Australia.

Victoria

WA NT

SA Q

NSW

V

T

further example:

network withk = 2,n = 30 that decomposes into three components of equal size

savings?

only 3·210= 3072 assignments instead of 230= 1073741824

(12)

Unconnected Constraint Graphs: Example

example: Tasmania can be colored independently from the rest of Australia.

Victoria

WA NT

SA Q

NSW

V

T

further example:

network withk = 2,n = 30 that decomposes into three components of equal size

savings?

only 3·210= 3072 assignments instead of 230= 1073741824

(13)

Trees

(14)

Trees as Constraint Graphs

Proposition (trees as constraint graphs)

LetC be a constraint network with n variables and maximal domain size k whose constraint graph is atreeor forest (i.e., does not contain cycles).

Then we can solveC or prove that no solution exists in time O(nk2).

example: k = 5,n = 10 kn= 9765625,nk2 = 250

(15)

Trees as Constraint Graphs: Algorithm

algorithm for trees:

Build a directedtree for the constraint graph.

Select an arbitrary variable as the root.

Order variablesv1, . . . ,vn such that parents are ordered before their children.

For i ∈ hn,n−1, . . . ,2i: callrevise(vparent(i),vi)

each variable is arc consistent with respect to its children If a domain becomes empty, the problem is unsolvable.

Otherwise: solve with BacktrackingWithInference, variable order v1, . . . ,vn and forward checking.

solution is foundwithout backtracking steps proof: exercises

(16)

Trees as Constraint Graphs: Example

constraint network directed tree + order:

A B C

D E

F

A B C D E F

(a) (b)

revise steps:

revise(D,F) revise(D,E) revise(B,D) revise(B,C) revise(A,B) finding a solution:

backtracking with orderA≺B ≺C ≺D≺E ≺F

(17)

Summary

(18)

Summary

Constraint networks with simple structureare easy to solve.

Constraint graphs formalize this structure:

several connected components:

solveseparatelyfor each component tree: algorithmlinear in number of variables

Referenzen

ÄHNLICHE DOKUMENTE

there is no restriction, and the constraint is typically not given explicitly in the constraint network description (although it formally always exists!).. Constraints R uv and R

We have already seen this algorithm: Backtracking corresponds to depth-first search Chapter 12 with the following state space: states: partial assignments initial state:

enforcing arc consistency of all variables with respect to the just assigned variable corresponds to forward checking.. We will next consider algorithms that enforce

arc consistency (considers pairs of variables) to path consistency (considers triples of variables) and i -consistency (considers i -tuples of variables) arc consistency tightens

If the constraint graph of C has multiple connected components, the subproblems induced by each component can be solved separately.. The union of the solutions of these subproblems is

tree decomposition: build tree-like meta constraint network meta variables: groups of original variables. that jointly cover all variables

basic idea of abstraction heuristics: estimate solution cost by considering a smaller planning task. formally: abstraction function α maps states to abstract states and thus

Hence the objective of our landmark heuristics is to approximate the optimal delete relaxed heuristic h + as accurately as possible.. More advanced landmark techniques work directly