1. A computer-implemented method for resource management, comprising: receiving, in a computer, a definition of a set of resource consumers, resources for allocation to the resource consumers, and constraints applying to the allocation of the resources; associating respective variables in the computer with the resource consumers, and identifying the resources as values applicable to the variables, thereby defining respective domains of the values for the variables; identifying a group of the variables as preferred variables based on respective values that were assigned to the variables in a previous allocation of the resources, wherein identifying the group comprises: providing a first assignment of a respective first value to each of the variables; after providing the first assignment, receiving an indication of a change in one or more conditions that mandates finding a second assignment, different from the first assignment, of the values to the variables; and inserting in the group those variables whose respective domains, following the change, contain the respective first value; finding, by the computer, an assignment of the values to the variables that satisfies the constraints by repeatedly performing, while the group contains one or more of the variables, the steps of: choosing a variable from the group; instantiating the chosen variable with a value; removing the chosen variable from the group; and pruning the domains of the other variables by propagation of the constraints responsively to the value of the chosen variable; and assigning the resources to the resource consumers responsively to the assignment of the values to the variables, wherein the resource consumers comprise tasks, and the resources comprises workers having respective skills, and wherein assigning the resources comprises assigning the workers to perform the tasks responsively to the skills of the workers.