This type of problem Pacemaker is dealing with here is known as the
knapsack problem and falls into the
NP-complete category of computer science problems - which is fancy way of saying "it takes a really long time to solve".
Clearly in a HA cluster, it’s not acceptable to spend minutes, let alone hours or days, finding an optional solution while services remain unavailable.
So instead of trying to solve the problem completely, Pacemaker uses a best effort algorithm for determining which node should host a particular service. This means it arrives at a solution much faster than traditional linear programming algorithms, but by doing so at the price of leaving some services stopped.
In the contrived example above:
rsc-small
would be allocated to node1
rsc-medium
would be allocated to node2
rsc-large
would remain inactive
Which is not ideal.