public int calculateRouteLength(final int[] route) {
        int length = 0;
        for (int i = 0; i < route.length - 1; i++) {
            length += distanceMatrix[route[i]][route[i + 1]];
        }
        return length;
    }
returns length in meters for the given route
main/src/main/java/cgeo/geocaching/maps/routing/RouteOptimizationHelper.java