 Hello everyone, this is AliceGal. In this video, I will introduce the definition of arc consistency. Why do we want to use the arc consistency concept? Well, it provides another way for us to solve a constraint satisfaction problem. In the previous video, I solved the four queens problem using backtracking search. In the leftmost subtree, we started by putting the first queen in row zero. Later on, we realized that this assignment does not lead to a solution. It turns out that if we make use of arc consistency, we can detect this dead end without expanding the leftmost subtree at all. Let me illustrate the idea of arc consistency using an example. Suppose I would put the first queen x0 in row zero. After this, due to the row and diagonal constraints, queen x1 cannot be zero or one. What if we try to put queen x1 in row two? How can we figure out that this assignment does not lead to a solution? Since queen x0 is in row zero, we cannot put any queen in the top row. We also cannot put any queen in this diagonal. Similarly, since queen x1 is in row two, we cannot put any queen in row two. And we cannot put any queen in these two diagonals. Now we have a problem. All possible positions for queen x2 have been eliminated. This tells us that putting x1 in row two does not lead to a solution. Similarly, putting x1 in row three also does not lead to a solution. I will leave this as an exercise for you. This example illustrates the idea behind arc consistency. By examining each constraint, we can eliminate some domain values that cannot satisfy the constraint. Reducing the domains this way can get us closer to finding a solution or proving that a solution does not exist. In the next video, I will introduce an arc consistency algorithm which handles binary constraints only. In general, each constraint can be categorized based on the number of variables in the constraint. A unary constraint involves one variable. A binary constraint involves two variables. There are also constraints involving three or more variables. Restricting to binary constraint does not limit our arc consistency algorithm. In fact, the algorithm can solve any constraint satisfaction problem. The question is, how does the algorithm deal with non-binary constraints? First, handling a unary constraint is straightforward. A unary constraint specifies whether a variable can take a value or not. If a constraint does not allow a value, we can simply remove it from the variables domain. Next, what about the constraint involving three or more variables? It turns out that we can convert the constraint into an equivalent set of binary constraints by defining additional variables. The process of converting these constraints is beyond the scope of this course. You can look it up in the textbooks if you are interested. Before I introduce the arc consistency definition, let me introduce some notation for defining an arc. Let x and y be two variables. Let c of x, y be a binary constraint. Depending on the meaning of the constraint, c of x, y and c of y, x may or may not represent the same constraint. For example, if the constraint is x plus y equals 5, then c of x, y and c of y and x have the same meaning. If the constraint is x is divisible by y, then c of x, y and c of y, x have different meanings. Each constraint has two arcs associated with it. Take a look at the picture. Let's look at the left arc angle bracket x, c of x, y angle bracket. The arc is denoted by a tuple in angle brackets. The second element in the tuple is a constraint. The first element in the tuple is the primary variable in the constraint. The primary variable tells us which arc we're looking at. For our example, if the primary variable is x, we're looking at the arc on the left. If the primary variable is y, we're looking at the arc on the right. Let's look at the arc consistency definition. There are two variables, x and y, with domains d sub x and d sub y. C of x, y is a binary constraint. Consider the arc with x as the primary variable. This arc is consistent, if and only if. For every value v in the domain of x, there is a value w in the domain of y, such that v and w satisfy the constraint c. To help you understand the definition, let's translate the definition into a predicate logic formula. Pause the video and write down the logical formula yourself. Then keep watching for the answer. In predicate logic, the definition becomes the following. For all v in the domain of x, there exists w in the domain of y, such that v and w satisfy the constraint c. We have mixed quantifiers here. The first one is universal and the second one is existential. When we verify the statement, we need to consider the quantifiers in order. First, we need to pick a value v in the domain of x, then we need to find the value w in the domain of y, such that the two values satisfy the constraint. Let's look at an example of applying the arc consistency definition. Consider the constraint, x is less than y. Each domain contains one and two. Is the arc with x as a primary variable consistent? Pause the video and choose an answer. Then keep watching. The correct answer is b, the arc is not consistent. To verify the definition, we start by picking any value of x and try to find the value of y, such that the two values satisfy the constraint. If x is one, then y is two satisfies the constraint. If x is two, then no value of y satisfies the constraint. Since we cannot find the corresponding value of y for x equals two, this arc is not consistent. If this is part of a constraint satisfaction problem, we can go ahead and remove two from the domain of x. In general, if an arc is not consistent, we can remove at least one value from the primary variables domain. Doing this will not rule out any solution. Reducing the domains is helpful as it takes us closer to finding a solution or showing that a solution does not exist. That's everything on the arc consistency definition. Let me summarize. After watching this video, you should be able to do the following. Explain the idea of arc consistency at a high level. Explain why it is sufficient to consider binary constraints only. Describe the notation for an arc. Describe the arc consistency definition. Verify whether a given arc is consistent. Explain how the arc consistency definition can be helpful for solving a CSP. Thank you very much for watching. I will see you in the next video. Bye for now.