Arc consistency algorithm AC-3
n Time complexity: O(n2d3)