B
Bruce
Hi
I am trying to come up with an algorithm to solve the following
problem.
There are x components and y machines (y > x) one machine can only run
one component.
Each component has 2 requirements - memory, disk space. Each machine
offers a certain memory and disk space.
Match the machines to the servers. (Component1 on Machine2,Component2
on Machine5 etc)
The one I came up with is inefficient - brute force. For every
component, iterate through all machines to find a fit. This is O(n
square). Repeat this by starting with a different server every time.
So, overall O(N cube).
Given that there are 2 parameters to consider, is there a more
efficient way of doing this?
Thanks
Bruce
I am trying to come up with an algorithm to solve the following
problem.
There are x components and y machines (y > x) one machine can only run
one component.
Each component has 2 requirements - memory, disk space. Each machine
offers a certain memory and disk space.
Match the machines to the servers. (Component1 on Machine2,Component2
on Machine5 etc)
The one I came up with is inefficient - brute force. For every
component, iterate through all machines to find a fit. This is O(n
square). Repeat this by starting with a different server every time.
So, overall O(N cube).
Given that there are 2 parameters to consider, is there a more
efficient way of doing this?
Thanks
Bruce