Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the complexity of Arc-Consistency Algorithm O(cd^3)?

Why is the complexity of Arc-Consistency Algorithm O(cd3)?

like image 265
ark Avatar asked Apr 21 '16 10:04

ark


People also ask

What is Arc consistency algorithm?

(Arc Consistency) The pair (X, Y) of constraint variables is arc consistent if for each value there exists a value such that the assignments X = x and Y = y satisfy all binary constraints between X and Y. A CSP is arc consistent if all variable pairs are arc consistent.

How does ac3 algorithm work?

The algorithm AC-3 operates on constraints, variables, and the variables' domains (scopes). A variable can take any of several discrete values; the set of values for a particular variable is known as its domain. A constraint is a relation that limits or constrains the values a variable may have.

What is consistency in A * algorithm?

In the A* search algorithm, using a consistent heuristic means that once a node is expanded, the cost by which it was reached is the lowest possible, under the same conditions that Dijkstra's algorithm requires in solving the shortest path problem (no negative cost edges).

What is node consistency in AI?

Node consistency requires that every unary constraint on a variable is satisfied by all values in the domain of the variable, and vice versa. This condition can be trivially enforced by reducing the domain of each variable to the values that satisfy all unary constraints on that variable.


1 Answers

I will asume that you are refering to AC-3 consistency algorithm. This algorithm is nicely and simply described here. I will be refering to this decsription of the algorithm.

First, lets calculate the complexity of the method REVISE (method revises one arc between two domains). For each value in one domain, it is examining all the values of the second domain. So the complexity of the REVISE method would be d2 where d is maximum domain size.

Now, how many times, at worst, will be the REVISE called? Initially, there are all the arcs in the queue. Every time the REVISE is called, one arc is removed from the queue. That would be e calls of the method. But we are also adding arcs back to the queue. How many times can we do that? Well, we are adding arc back to the queue only if a value was deleted from the domain the arc is pointing to. One arc is pointing to one domain, so we can only add it as many times as the number of values in that domain. So at worst, we are adding every arc back to the queue d times.

REVISE is called at maximum e + ed times where e is number of arcs.

When we put it all together, we find out that the complexity of the whole algorithm is O((e+ed)d2) which is O(ed3).

like image 57
Fila Avatar answered Sep 24 '22 16:09

Fila