Linear Approach to Constraint Satisfaction Problems