I'm trying to optimize the transportation of a fleet of buses that: (1) start from several depots, (2) pick up students from several stops, and (3) drop off all students at a single destination (the school). Travel times are not symmetric: the time to go from Point A to Point B is not the same as from Point B to Point A. The goal is to minimize the number of buses and finding their routes while satisfying the constraint that no student should travel for longer than k = 1.5
times the duration of the direct route from her bus stop to school.
To simplify the problem, let's assume that buses have infinite capacity, ie. each bus can accommodate all students at all stops on its route.
I am aware that this is a well studied, hard, problem e.g., a recent presentation in:
https://www.acsu.buffalo.edu/~qinghe/thesis/2017-01%20Caceres%20PhD%20School%20Bus%20Routing.pdf
I have tried without much luck to trick FindShortestTour
using a cost matrix with "phantom", duplicated destinations, infinite distances, etc.
Any thoughts? Toy data below.
nstops = 50;
nbus = 10;
ndepots = 4;
destination = {0, 0};
depots = Table[
ReIm[(1 + RandomReal[.1*{-1, 1}])*
Exp[I*2*(j*Pi/ndepots + RandomReal[.1*{-1, 1}])]], {j, 0,
ndepots - 1}];
stops = RandomReal[{-1, 1}, {nstops, 2}];
ListPlot[stops,
Epilog -> {PointSize[Large], Red, Point[destination], Black,
Point[depots]}, PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}},
AspectRatio -> 1]
distStops =
Table[If[i == j, 0,
EuclideanDistance[stops[[i]], stops[[j]]]*RandomReal[{0.9, 1.2}]], {i,
nstops}, {j, nstops}];
distDepotsStops =
Table[EuclideanDistance[depots[[i]], stops[[j]]]*RandomReal[{0.9, 1.2}], {i,
ndepots}, {j, nstops}];
distStopsDestination =
Table[EuclideanDistance[stops[[i]], destination]*RandomReal[{0.9, 1.2}], {i,
nstops}];
Distances from stops to depots and from depots to destination are infinite.