• 검색 결과가 없습니다.

Constraint Satisfaction Problems

N/A
N/A
Protected

Academic year: 2021

Share "Constraint Satisfaction Problems"

Copied!
13
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

Constraint Satisfaction Problems

Seung-Hoon Na1

1Department of Computer Science Chonbuk National University

2017.9.19

(2)

Example: Job-shop scheduling

Consider a small part of the car assembly, consists of 15 tasks Install axles (front & back)

Affix all four wheels (right and left, front and back) Tighten nuts for each wheel, affix hubcaps

Inspect the final assembly

Represent the tasks with 15 variables:

X = {AxleF, AxleB, WheelRF, WheelLF, WheelRB, WheelLB, NutsRF, NutsLF, NutsRB, NutsLB, CapRF, CapLF, CapRB, CapLB, Inspect}

The value of each variable: the time that tasks starts Precedence constraints (between individual tasks)

T1+ d1 ≤ T2 T1 must occur before T2.

T1 takes duration d1 to complete.

(3)

Example: Job-shop scheduling

Install the axles (10 min): They have to be in place before the wheels are put on

AxleF + 10 ≤ WheelRF AxleF + 10 ≤ WheelLF AxleB+ 10 ≤ WheelRB AxleB + 10 ≤ WheelLB

Affix the wheels (1 min), tighten the nuts (2 min), and attach the hubcap (1 min):

WheelRF + 1 ≤ NutsRF NutsRF + 2 ≤ CapRF WheelLF + 1 ≤ NutsLF NutsLF + 2 ≤ CapLF

WheelRB+ 1 ≤ NutsRB NutsRB+ 2 ≤ CapRB WheelLB + 1 ≤ NutsLB NutsLB + 2 ≤ CapLB

(4)

Example: Job-shop scheduling

Disjunctive constraint: AxleF and AxleB must not overlap in time Either one comes first and the other does

(AxleF + 10 ≤ AxleB) or (AxleB + 10 ≤ AxleF)

Do inspection (3 min for each task): for every variable except Inspect, we add a constraint:

X + dX ≤ Inspect

Limit the domain of all variables (The whole assembly should be done in 30 min):

Di = {1, 2, 3, · · · , 27} (1)

(5)

Constraints

Unary constraint: restricts the value of a single variable Binary constraint: relates two variables

Global constraint: involving an arbitrary number of variables E.g.)Cryptarithmetic puzzles - Alldiff (F , T , U, R, O)

O + O = R + 10 · C10

C10+ W + W = U + 10 · C100

C100+ T + T = O + 10 · C1000

C1000= F

Additional constraints can be represented by hypergraph.

(6)

Constraint propagation: Inference in CSPs

CSP algorithm has a choice between:

Search: Choose a new variable assignment

Constraint propagation: using the constraints to reduce the numbers of regal values for variables

- may be interwined with search, or may be done as a preprocessing step, before search starts.

(7)

Constraint propagation: Local consistency

Local consistency: Enforcing local consistency in each node and arc of a constraint graph eliminate inconsistent values throughout the graph.

Node consistency: Satisfy the variables’s unary constraints on their values. E.g.) h(SA), SA 6= greeni

Arc consistency: Satisfy the variables’s binary constraints.

For the constraint Y = X2, we have h(X , Y ), {(0, 0), (1, 1), (2, 4), (3, 9)}i

But, For the map-coloring problem, arc consistency “do nothing”:

h(SA, WA), {(R, G ), (R, B), (G , R), (G , B), (B, R), (B, G )}i No matter what value you choose for SA, there is a valid value for WA.

(8)

Arc-consistent algorithm – AC-3

After applying AC-3, either every arc is arc-consistent, or some variable has an empty domain, indicating that the CSP cannot be solved.

(9)

Path consistency

Arc consistency: tightens down the domains (unary constraints) using the arcs (binary constraints)

Path consistency: tightens the binary constraints by using implicit constraints that are inferred by looking at triples of variables.

Path consistency

A two-variable set {Xi, Xj} is path-consistent with respect to a third variable Xm if, for every assignment {Xi = a, Xj = b} consistent with the constraints on {Xi, Xj}, there is an assignment to Xm that satisfies the constraints on {Xi, Xm} and {Xm, Xj}.

(10)

Path consistency: Example

Coloring the Australia map with two colors.

What is the set {WA, SA} path consistent with respect to NT ?

There are only two: {WA = red , SA = blue} and {WA = blue, SA = red }

No valid choice for NT . No solution to this problem

(11)

K-consistency

K-consistency

CSP is k-consistent if, for any set of k − 1 variables and for any consistent assignment to those variables, a consistent value can always be assigned to any k-th variable

1-consistency: node consistency 2-consistency: arc consistency 3-consistency: path consistency

Strong K-consistency

A CSP is strongly k-consistent if it is k-consistent and is also (k − 1)-consistent, (k − 2)-consistent, · · · , all the way down to 1-consistent.

Time complexity for finding a solution: O(n2d ) to a find solution for strongly n-consistent CSP with n nodes

Time and space complexity for establishing n-consistency: exponential in n

(12)

Global consistency

Global consistency: One involving an arbitrary number of variables (but not necessarily all variables)

For example, the Alldiff constraint: all the variables involved must have distinct values.

Simple method of inconsistency detection for Alldiff constraints: if m variables are involved in the constraint with n possible distinct values, m > n, then the constraint cannot be satisfied.

Example: Detecting inconsistency in {WA = red , NSW = red } Consider SA, NT , and Q that are effectively connected by an Alldiff constraint.

After applying AC-3 with the partial assignment, the domain of each variable is reduced to {green, blue}.

But, m > n (3 > 2), so the Alldiff constraint is violated.

(13)

Example: Sudoku

A Sudoku puzzle and its solution

How far can arc consistency take us?

참조

관련 문서

In addition, the thermal flow analysis and imaging ultrasonic thermography detection method are comparatively analyzed to improve the detection reliability for

In the analysis of the dose constraint of nuclear medical radiation workers using chi-square test statistics, the dose constraint at (the time of) the highest

The reduction of power series ( , m→ ∞) to polynomials (m is finite) is a great advantage.. because then we have solutions for all x,

가령, 여행을 갈 때 시간이라는 제약이 있지만 주어진 시간 동안 갈 수 있는 다양한 코 스가 나올 수 있는 것과 같은 이치입니다..

If some active participating site does not contain a <ready T> record in its log, then the failed coordinator C i cannot have decided to commit T.. If none of the

 A linear system of equations in n unknowns has a unique solution if the coefficient matrix and the augmented matrix have the same rank n, and infinitely many solution if

„ The length of a shortest path from the source vertex v to vertex u under the constraint that the shortest path. contains at

26 In the present analysis, the combination of the AP and the following NP is thus not a constructional constraint, but is licensed by the lexical properties of the degree