My brother just started a delivery job, currently he only has about 6 deliveries a day max,and the deliveries are grouped into three categories: 6 AM - Noon, Noon - 6 PM, and Anytime. This got me thinking about how every morning he plans the best route possible to make sure that no deliveries are late but also minimize the time it will take to complete.
So I wanted to come up with an algorithm that could do this given a list of deliveries (lat, long, min delivery time, and max delivery time). I decided that seemed way to hard especially because the Google GeoCoding and Directions APIs have a limited amount of calls per 24 hours.
So to simplify I went back to a variable number of blocks of time that do not over lap and decided I am OK with making the assumption that the shortest overall distance equals the shortest overall time. For the first time block I know we start at the location where we pick up the truck, but I don't know where to have it end because the shortest path hitting every point in the time block starting at truck pick up may result in being very far away from the closest delivery of the next time block and I wouldn't know which of the deliveries in the next time block to use as the "last" delivery of the first time block either.
I hope I explained this well enough that it is understandable, also for the sake of this question please ignore the Anytime time block as I can just sift those in later wherever they increase the overall distance the least (for the most part, but I'll deal with one issue at a time). Also, even though currently my brother has only 6 or so deliveries a day, I was hoping to come up with a solution that doesn't become exponentially slower when adding deliveries so that it could support more deliveries, if it could handle 100, that would be way more than enough.
If you think there is an even better (easier but still yields correct results) way to solve the problem instead of the variable number of non-overlapping time blocks, I'd love to hear about that as well.
Thanks!