Need help positioning algorithm/fill a fleet of vehicles. Any ideas?
Write the system to assign orders on the basis of vehicles.
Condition: there are N identical vehicles. And there are X orders for them to rent. Rent daily, each in his own time, with your day beginning and end.
Task: to place the orders on the basis of transport so that the utilization of the fleet was the most effective. That is, the gaps between orders from each vehicle was minimal.
Now do a complete search (in php) all options and it turns out very long.
Maybe there is a ready efficient algorithms for this task? Or what side to approach?
1. Sort the orders by start time.
2. Take the first order in the queue.
3. Find the car, which by this time, the minimum free time.
4. Appointed by ordering her to throw it from the queue.
5. Back to claim 2.
In section 3 takes the minimum time, if you want to load and not use more cars than is required for orders. Either max if you need to spread them "fairly" and to minimize simple each participant.