Phase transitions in constraint satisfaction problems