Solving constraint satisfaction problems