Constraint Satisfaction Flashcards

(32 cards)

1
Q

What is a Constraint Satisfaction Problem (CSP)?

A

A CSP is defined as:
* a set of m distinct variables: X = {x1, x2, …, xm}
* a set of m domains associated with each variable: D = {D1, …, Dm}
* a set of constraints imposed on the variables: C = {C | Cj(X1, X2, …, Xn)}

CSPs are used to model complex problems in various fields, making them closer to natural problem statements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main characteristics of industrial problems in constraint satisfaction?

A

Industrial problems are characterized by:
* Large number of parameters involved
* Large number of constraints imposed on parameters
* Goals are often not known in detail
* Need for efficient solutions
* Natural problem representation for easy development and maintenance

These characteristics make modeling and solving these problems quite complex.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the ultimate goal of constraint satisfaction?

A

The ultimate goal is to have programming tools where the problem is stated in a natural representation and the computer efficiently solves it

This reflects the desire for user-friendly interfaces in problem-solving.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an example of a constraint in a class schedule problem?

A

A constraint could be:
* Teachers cannot teach two classes at once
* Students should not be taught more than five hours in a row
* Only one class can be taught in one classroom

These constraints ensure the feasibility of scheduling.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the types of constraints in constraint satisfaction?

A

Constraints can be:
* Unary: involving one variable
* Binary: involving two variables
* n-ary: involving more than two variables

Examples include constraints like X > 10 (unary) or X + Y = 30 (binary).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the process of assigning values in CSP called?

A

The process is often called labelling

Labelling involves assigning values to variables from their domains while satisfying all constraints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between finite and continuous domains in constraint satisfaction?

A

Finite domains deal with discrete values, while continuous domains involve real numbers and complex values

Finite domains are more common in industrial applications, while continuous domains require more complex mathematical techniques.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a generate-and-test strategy?

A

A generate-and-test strategy involves generating all possible combinations of values and testing whether they satisfy the constraints

This method is often inefficient due to the large number of possible combinations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Min-Conflicts Heuristic?

A

The Min-Conflicts Heuristic is a local search algorithm that starts with a random assignment and attempts to reduce the number of violated constraints

This heuristic can still fall into local minima, leading to incomplete solutions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the purpose of consistency checking in CSP?

A

Consistency checking aims to exploit knowledge regarding the solution by removing inconsistent values from variable domains based on constraints

This helps reduce the search space and improve efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the advantages of Constraint Logic Programming (CLP)?

A

Advantages of CLP include:
* Declarativeness
* Short development time
* Maintainability
* Ideal platform for constraint programming
* Elegant solution to efficiency problems in logic programming

CLP allows users to express problems naturally without needing to specify how to solve them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill in the blank: A solution to a CSP is an _______ of values to the variables from their given domain.

A

assignment

The assignment must satisfy all constraints simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

True or False: All constraints in CSP are independent.

A

False

Constraints often share variables and are rarely independent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the goal of the classic search algorithms in CSP?

A

The goal is to assign values to unbound variables such that all constraints on the variable are satisfied

Classic search algorithms typically involve depth-first search (DFS) or breadth-first search (BFS).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is one common application of constraint satisfaction problems?

A

Common applications include:
* Scheduling
* Resource allocation
* Crew rotation
* Planning

CSPs are widely used in various industries due to their ability to handle complex constraints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the significance of the ACM’s identification of constraint programming?

A

It has been identified as one of the strategic directions in computer research

This highlights the growing importance and relevance of constraint programming in the field.

17
Q

What does the term ‘labelling’ refer to in CSP?

A

Labelling refers to the process of assigning values to variables from their domains while satisfying constraints

This is a crucial step in finding a solution to a CSP.

18
Q

What module is used to support the Finite Domain Solver in SWI-Prolog?

A

library(bounds)

This module is essential for working with finite domain constraints.

19
Q

How is a variable declared to be in a specific range in SWI-Prolog?

A

Var in Range where Range is denoted by L..U

L and U are integers defining the lower and upper bounds of the range.

20
Q

What is the syntax to declare a list of variables restricted to a specific range?

A

[Vars] in Range

Example: [X,Y] in 1..10 restricts both X and Y to the range 1 to 10.

21
Q

What does the constraint ?Expr #> ?Expr signify?

A

greater than

This is one of the binary constraint relations used in arithmetic expressions.

22
Q

Which arithmetic operator is used to denote equality in SWI-Prolog constraints?

A

=

This operator checks if two expressions are equal.

23
Q

What does the constraint sum(+Vars, +Op, ?Value) do?

A

It computes the sum of variables in Vars constrained by Op to equal Value

Op can be one of the binary constraint relation symbols.

24
Q

What is the purpose of the all_different(+Vars) constraint?

A

Constrains all variables in Vars to be pair-wise not equal

This is useful in problems where unique values are required.

25
What does the indomain(+Var) predicate do?
Unifies variable Var with a value in its domain ## Footnote It backtracks over all possible values from lowest to greatest.
26
What is the function of label(+Vars) in SWI-Prolog?
Assigns values to all variables in Vars from their respective domains without violating constraints ## Footnote Equivalent to labeling([], Vars).
27
What is the default variable selection strategy in labeling(+Options, +Vars)?
leftmost ## Footnote This strategy labels the variables in the order they appear in Vars.
28
What does the 'ff' option in labeling(+Options, +Vars) stand for?
first-fail principle ## Footnote It selects the variable with the smallest domain to label first.
29
What is the purpose of the 'up' value selection strategy in labeling?
Select values from the variable’s domain in ascending order ## Footnote This is the default behavior for value selection.
30
What does the example code solve_eq([X,Y,Z]) demonstrate?
It defines constraints for the variables X, Y, and Z and then labels them ## Footnote This example shows how to use the bounds library to solve equations.
31
Fill in the blank: The operator ?Expr mod ?Expr is used to compute the _______.
modulus ## Footnote This operator gives the remainder of the division of two expressions.
32
True or False: The labeling( +Options, +Vars ) can dictate the ordering of the solutions.
True ## Footnote Options can include ordering strategies like min(Expr) and max(Expr).