A system calculates the optimal allocation of two or more resources
provided by a resource provider to a task within a computer system from a
plurality of possible allocations. In doing so, the system calculates the
total volume of an N-dimensional cube, where N is the number of resources
provided by the resource provider, representing the respective amounts of
resources available to be allocated. The system also calculates the
average volume of the N-1 dimensional shapes forming the sides of the
N-dimensional cube. The system then calculates, at least partly from the
ratio of the total volume to the average volume, the balance resulting
from the allocation of resources represented by the N-dimensional cube.
The system then calculates the imbalance resulting from the allocation of
resources at least partly from the balance and determines the smallest
imbalance as the optimal allocation of resources.