CSP Flashcards

1
Q

Discrete CSP

A

If all the variables have countable domains (finite and infinite domains)

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

Continuous CSP

A

If domain is uncountable

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

Time complexity

A

Linear constraints are solvable in polynomial time (nd). Non linear is exponential (d^n)

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

Types of constraints

A

Unary
Binary
Higher order
Preferences (Soft)

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

Example of crypt arithmetic puzzles

A

SEND+MORE=MONEY

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

When are auxiliary variables used

A

When there are higher order constraints >=5
Higher-order constraints can be transformed into equi-satisfiable binary constraints using auxiliary variables.

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

What is a binary CSP?

A

A CSP where each constraint is binary or unary

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

What is a constraint graph

A

The graph formed from binary CSP (A CSP where each constraint is binary or unary) whose nodes are variables and edges are constraints

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

Examples of real world CSP

A
  1. Job scheduling
  2. Class timetabling
  3. Queens or Rook placement on chess board
  4. Assignment problems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Define Constraint network

A

A constraint network is a triple <V, D, C>
Variables, Domains, and constraints (relations on the domain of the variables)

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

Satisfying constraints

A

If the assignment is consistent with all the constraints

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

What is a consistent and total assignment

A

If the assignment holds tru for all variables and respects all the constraints - Consistent

If all variables are assigned - Total

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

How to view CSP as search problem

A

We can view a constraint network as a search problem, if we take the states as the variable assignments, the actions as assignment extensions, and the goal states as consistent assignments.

โ–ทIdea: Every constraint network induces a single state problem.
Given a constraint network
๐›พ :=ใ€ˆ๐‘‰,๐ท,Cใ€‰,
then ฮ ๐›พ :=ใ€ˆ๐’ฎ๐›พ,๐’œ๐›พ,๐’ฏ๐›พ,โ„๐›พ,๐’ข๐›พใ€‰is called the search problem induced by ๐›พ, iff
โ–ทStates ๐’ฎ๐›พ are variable assignments
โ–ทActions ๐’œ๐›พ: extend ๐œ‘โˆŠ๐’ฎ๐›พ by a pair ๐‘ฅโ†ฆ๐‘ฃ not conflicted with ๐œ‘.
โ–ทTransition model ๐’ฏ(๐‘Ž,๐œ‘)=๐œ‘,๐‘ฅโ†ฆ๐‘ฃ (extended assignment)
โ–ทInitial state โ„๐›พ: the empty assignment ๐œ–.
โ–ทGoal states ๐’ข๐›พ: the total assignments

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

Backtracking search in CSP

A

DFS for CSP with single variable assignment extension. It is the basic uninformed algorithm for CSPs. It can solve the ๐‘›-queens problem for โ‰Š๐‘›,25

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

How to make backtracking better?

A

Heuristics: Minimum Remaining Values (Which Variable) and Least Constraining Value Heuristic (Value Ordering)

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

Minimum Remaining Values (Which Variable)

A

The minimum remaining values (MRV) heuristic for backtracking search always chooses the variable with the fewest legal values, i.e. a variable ๐‘ฃ that given an initial assignment ๐‘Ž minimizes its domain count.

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

Why does MRV work?

A

By choosing a most constrained variable ๐‘ฃ first, we reduce the branching factor (number of sub trees generated for ๐‘ฃ) and thus reduce the size of our search tree.

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

Explain degree heuristic

A

Used as a tie breaker in MRV. The degree heuristic in backtracking search always chooses a most constraining variable, i.e. given an initial assignment ๐‘Ž always pick a variable ๐‘ฃ with
maximum constraints. By choosing a most constraining variable first, we detect inconsistencies earlier on and thus reduce the size of our search tree.

19
Q

Least Constraining Value Heuristic (Value Ordering)

A

Given a variable ๐‘ฃ, the least constraining value heuristic chooses the least constraining value for ๐‘ฃ: the one that rules out the fewest values in the remaining variables, i.e. for a given initial assignment ๐‘Ž and a chosen variable ๐‘ฃ pick a value ๐‘‘โˆŠ๐ท๐‘ฃ that minimizes the domain count

20
Q

Constraint Propagation

A

Constraint propagation (inference in constraint networks) is deriving additional constraints, that follow from the already known constraints, i.e. that are satisfied in all solutions.

We say that two constraint networks
๐›พ:=ใ€ˆ๐‘‰,๐ท,๐ถใ€‰and ๐›พโ€™:=ใ€ˆ๐‘‰,๐ทโ€™,๐ถโ€™ใ€‰sharing the same set of variables are equivalent, (๐›พโ€™โ‰ก๐›พ), if they have the same solutions.

21
Q

Explain tightness in Constraint Networks

A

Tighter means the constraints or allowed values in one network (ฮณโ€ฒ) are stricter or more limiting compared to the other network (ฮณ).

Constraint Propagation is tightening up without losing solutions

22
Q

What are the conditions for ฮณโ€ฒ to be tighter than ฮณ

A

Domain: The domain of ฮณโ€ฒ is a subset of ฮณ (so the domain could have same or lesser number of values)

Constraints: The constrains of ฮณโ€ฒ are either a subset of ฮณ and new constraints can be added to ฮณโ€ฒ that are not part of ฮณ

23
Q

Equivalent Constraint Networks

A

Let ๐›พ and ๐›พโ€™ be constraint networks such that ๐›พโ€™โ‰ก๐›พ and๐›พโ€™โŠ‘๐›พ. Then ๐›พโ€™ has the same solutions as, but fewer consistent assignments than, ๐›พ.
โ–ทโคณ๐›พโ€™ is a better encoding of the underlying problem.
โ–ทTwo equivalent constraint networks

24
Q

What are the inference methods on constraint networks?

A

Forward checking, arc consistency and decomposition

25
Q

Forward Checking

A

When you assign a value to a variable, forward checking immediately looks ahead at the neighboring (or future) variables to ensure that the current assignment doesnโ€™t violate any constraints with unassigned variables.

Suppose youโ€™re assigning a value to variable Xi. Once you assign a value to
Xi , forward checking looks at the variables that havenโ€™t been assigned yet (letโ€™s call them Xj) and checks the constraints between Xi and Xj. If any value in the domain of Xj is incompatible with the current assignment of Xi , that value is removed from the domain of Xj .

26
Q

Is forward checking sound?

A

Yes. An inference procedure is called sound if every conclusion it derives is guaranteed to be true, provided the premises (or inputs) are true.

27
Q

What is the problem with forward checking?

A

Forward checking only checks the immediate neighbors and It only makes inferences from assigned to unassigned variables. There is a better inference technique. Arc consistency

28
Q

What is Arc consistency. How does it work? and how is it more better?

A

A variable v is arc consistent relative to another variable w if there is either no direct arc (constraint) between them or for every value in the domain of v has a value in the domain of w that satisfies the constraints

Ensures consistency for all arcs (constraints) between variables in the entire CSP, not just immediate neighbors.

29
Q

What are the different arc consistency available?

A

AC-1 and AC-3

30
Q

What is the time complexity of AC-1

A

O(k^2) where k is the domain size

31
Q

How does AC-3 work

A

watch
https://www.youtube.com/watch?v=4cCS8rrYT14&t=170s

32
Q

What is the run time of AC-3

A

With m constraints and d domain values
O(md^3)

33
Q

what is the disadvantage of AC-1

A

every pair of constraint gets checked again once the domain is changed (algorithm is revised)

34
Q

What is decomposition

A

The process of decomposing a constraint network into components is called decomposition.

The idea behind decomposing a constraint graph is to break it down into smaller subgraphs (or components) that can be solved independently or combined later. The most common approach is to find parts of the graph that are only loosely connected to the rest and solve these parts separately.

If youโ€™re coloring a map, and Tasmania is not connected to the rest of Australia, you can color Tasmania separately without affecting the rest of the map.

35
Q

Tree-structured CSPs

A

A CSP is tree-structured if its constraint graph has no loops (itโ€™s acyclic).

Tree-structured CSPs are much easier to solve and can be done in time proportional to the size of the problem (O(n*dยฒ)), compared to general CSPs, which are much harder to solve.

36
Q

Algorithm for Tree-structured CSPs

A
  1. Choose a variable as the root and arrange variables from root to leaves (like in a tree).
  2. Apply a procedure to remove inconsistencies as you go down the tree.
  3. Then assign values to the variables as you go back up, ensuring consistency.
37
Q

Nearly Tree-structured CSPs

A

This is a method where you โ€œfixโ€ a variable by assigning it a value and pruning the options for its neighbors. This makes the problem easier, as it can reduce it to a simpler (tree-like) structure.

38
Q

Cutset Conditioning

A

Cutset conditioning is a technique where you remove certain variables (the cutset) to break cycles in the constraint graph, leaving a tree structure that can be solved easily. The process involves solving smaller sub-problems recursively.

Figure out which node in the graph I should solve first, so that the subgraph becomes acyclic and then I can solve the rest of the graph easily (Australia map SA)

Cutest is basically converting constraint graphs into acyclic graph

39
Q

Time complexity for acyclic constraint graph

A

If a CSP has an acyclic constraint graph, it can be solved in polynomial time (O(nkยฒ)), making it much easier to solve than a general CSP.

40
Q

Acyclic graph algorithm

A

Steps:
1. Build a tree from the constraint graph by choosing a root variable and directing edges outward.

  1. Order the variables topologically (from parent to children).
  2. Ensure consistency by revising the constraints as you move from the leaves to the root.
41
Q

What type pf problem is cutest conditioning

A

Finding the optimal cutset is computationally hard (NP-hard), but good approximations exist, meaning we can often solve these problems efficiently in practice.

42
Q

CSP with Local search

A
43
Q

Min-complexity heuristic

A
44
Q

Min Complexity run time

A

Constant and then explosive