I've got an TSP problem which I can't seem to solve somehow. It consists of about 1200 addresses for which all distances (measured in seconds) between them, a frequency (once a week, twice a week, 3 times a week etc...) and cargo-weight are given.
I've looked into TSP solutions, but they only seem to offer ways to calculate the shortest route, not divide addresses over multiple routes.
I should divide these addresses over 5 days based on their frequency. Then for every day I should devide the adresses over 2 routes for a cargo-truck to drive.
Furthermore there are 3 constraints:
- All routes should start and end at the same given address.
- There is a maximum distance which all routes must not exceed.
- A truck has a maximum cargo-space which it should not exceed, if it does the truck should go back to the starting point to pick up the rest of the cargo and then continue with its route.
I've tried solving this problem by constructing a TSP algorithm that consists of greedysearch as an initial route, and then proceeds with localsearch to find a local optimum. Then I'm trying to swap addresses between routes and checking whether the total distance has decreased afterwards.
I can check (optimize and find its distance) one set of routes in about 10-20 seconds, by using multi-threading. I could potentially reduce this by only checking the distance between the nodes that have changed (instead of the entire route), but even then I don't think it would affect the execution-time much since there are only ~120-130 nodes in every route and dictionary-lookups aren't that slow after all). And as you can probably imagine by now, this is so incredibly slow that it won't seem to solve the problem at all.
So far I haven't been able to find a solution that comes anywhere close to the target distance (I've managed 8000 without the constraints whereas it should be below 6000 with constraints) . This has all been WITHOUT implementing the constraints mentioned earlier (which should probably be done by applying certain penalties for constraints that aren't met).
What would be a smart/good way to approach this problem?
Thanks in advance!