I'm working on a project for a transport company. Essentially I get, let's say , 200 city's and 7 trucks and I need to compute best weight distribution over the 7 trucks and the shortest path overall (km).
Before I actually communicate with Google Maps API I do my own computation. For 7 trucks I can compute about 30 milion routes in about 2 hours. ( weight distribution is done with backtracking / dynamic programing and "next city" is chosed with some math formulas )
I need to compare those routes and remember the best one ( smallest km over the 7 trucks ).
I get something like this :
Truck 1
City 1 (x,y)
City 2 (x,y)
City 3 (x,y)
City 4 (x,y)
.....
Truck 2
City 1 (x,y)
City 2 (x,y)
City 3 (x,y)
City 4 (x,y)
.....
Truck 3
City 1 (x,y)
City 2 (x,y)
City 3 (x,y)
City 4 (x,y)
.....
etc ...
Where (x,y) are longitude and latitude. I can compute the distance between each city with the Euclidean distance d = sqrt((x1 - x2)^2 + (y1 - y2)^2) so I end up with a graph.
I was thinking to use A* algorithm to order the city's of each truck and after get the distance between the ordered city's. The problem is that in real life the trucks are going to return to the starting point ... can A* take that in to account ?
I am aware that the shortest path in longitude/latitude will not always be the shortest in km , but is OK, let's say 90% accuracy will do.
Any idea how I can compute a "score" for each route ( all 7 trucks ) so it can map as close as possible to the actual km ?
( I can do limited calls to Google Maps API and I want to rule out the worst options locally )