Closed rohams closed 10 years ago
Sahli, I think since you have done the distMatrix you may get this thing done faster. It would be great to finish this before the weekend. Once this is done, we can introduce permutation and see our very first result of applying GA on the application by Tue.
Sorry because I just see this now. I'll work on it later today.
Does the "a_" mean anything?
a_15 is the element (1,5) of the distance matrix.
Do I have to make a new function or I can get it out from graph_groups() ?
committed the code
Roham, have you reviewed the code for totalDistance()? Can we close this issue?
Function Name: totalDistance(routes, brks) Input: routes array, brks array
Output: total distance of the solution
With the help of the distanceMatrix, the total distance of the solution can be found like the example below:
Example:
routes: 1,5,4,2,3,6,7,9,8 brks: 2,4
path1: dc, 1,5,4 -> distance1: a_dc1 + a_15+ a_45 path2: dc, 2,3 -> distance2: a_dc2 + a_23 path3: dc, 6,7,9,8 -> distance3: a_dc6 + a_67+ a_79 + a_98
total distance = distance1 + distance2 + distance3