> Even though it's not a search, sometimes it can solve our problem before even beginning to search. Moreover each global constraint can become a binary constraint,
> making this step always possible to implement (at a higher computational cost of either the machine or the human transforming these constraints)
A **set** of **2 variables** is **path consistent to a 3rd variable** if for **each valid assignment satisfying their arc consistency** there exists **at least a value** for
a **3rd variable** so that it **satisfies its binary constraints with the other two variables**
A **variable** is **k-consistent** if it's also **(k-1)-consistent** down to **1-consistent (node-consistent)**
### Bound Propagation
Sometimes, when we deal with lots of numbers, it's better to represent possible values as a bound (or a union of bounds).
In this case we need to check that there exists a solution for both the maximum and minimum values for all variables in order to
have **bound-consistency**
## Backtracking Search
This is a step coming **after** the **constraint propagation** when we have multiple values assignable to variables and is a *traditional search*
over the problem.
It can be interleaved with [constraint propagation](#constraint-propagation) at each step to see if we are breaking a constraint
### Commutativity
Since our problem **may** not care about the specific value we may take, we can just consider the number of assignments.
In other words, we don't care much about the value we are assigning, but rather about the assignment itself
### Heuristics
To make the algorithm faster, we can have some heuristics to help us choose the best strategy:
- **Choose Variable to Assign**:
- **minimum-remaining-values (MRV)**: consists on choosing the **variable with the least amount of values in its domain**
- **Pros**:
- Detection of Failures is faster
- **Cons**:
- There may be still ties among variables
- **degree heuristic**: choose the **variable involved the most in constraints**
- **Pros**:
- Fast detection of Failures
- Can be a tie-breaker combined with MRV
- **Cons**:
- Worse results than MRV
- **Choose Value to assign**:
- **least-constraining-value**: choose the **value that rules out the fewest choices among the variable neighbours**
- **Pros**:
- We only case about assigning, not what we assign
- **Inference**:
- **forward checking**: **propagate constraintsfor all unassigned variables**
- **Pros**:
- Fast
- **Cons**:
- Does not detect all inconsistencies
- **MAC - Maintaining Arc Consistency**: It's a **call to [AC3](#arc-consistency)** only with **constrainst involving our assigned variable**
- **Pros**:
- Detects all inconsistencies
- **Cons**:
- Slower than forward checking
- **Backtracking - Where should we go back once we fail**
- **chronological backtracing**: go a step back
- **Pros**:
- Easy to implement
- **Cons**:
- Slower time of computation
- **backjumping**: We go to a step where we made an **assignment that led to a conflict**. This is accomplished by having conflicts sets, sets where we track\
**variable assignments** to **variables involved in constraints**
- **Pros**:
- Faster time of computation
- **Cons**:
- Need to track a conflict set
- Useless if any **inference** heuristic has been used
- **conflict-directed backjumping**: We jump to the assignment that led to a **chain of conflicts**. Now, each time an we detect a failure, we propagate the conflict\
set over the backtraced variable **recursively**
- **Pros**:
- Faster time of computation
- **Cons**:
- Harder to implement
- **Constraint Learning**
- **no-good**: We record a set of variables that lead to a failure. Whenever we meet such a set, we fail immediately, or we avoid it completely
- **Pros**:
- Faster time of computation
- **Cons**:
- Memory expensive
## Local Search
The idea is that instead of **building** our goal state, we start from a **completely assigned state** (usually randomically) and we proceed from there on.
Can also be useful during online searching
### Local Search Heuristics
- **min-conflicts**: Change a random variable (that has conflcts) to a value that would minimize conflicts
- **Pros**:
- Almost problem size independent
- Somewhat fast
- **Cons**:
- Subsceptible to Plateaus (use taboo-search or simulated annealing)
- **constraint weighting**: Concentrate the search over solving constraints that have a higher value (each one starting with a value of 1). Choose the\
pair variable/value that minimizes this value and increment each unsolved constraint by one