1. A method for consolidating a plurality of applications into one or more servers, the method comprising: organizing consolidation constraints in a computer process, the consolidation constraints representing preferences about placing applications into the one or more servers; and allocating the applications into the one or more servers in a computer process that maximally satisfies the consolidation constraints; wherein the organizing of the consolidation constraints includes: representing each of the consolidation constraints according to dependencies between consolidated applications, the dependencies being represented by application affinity matrices, each entry having a value representing the suitability of placing two applications selected from the plurality of applications on a same one of the one or more servers, the suitability controlled by a given one of the consolidation constraints, the values including positive values representing a preference for placing the two applications on the same server and negative values representing an opposition to placing the two applications on the same server, and classifying the application affinity matrices into a plurality of different classes each of the classes based on the strictness of the corresponding constraint.