Measures the saving that was achieved by the heuristic optimizationalgorithmclarke_wright() compared to the naive vehicle run assignment,i.e. one run per site.
Arguments
- solution
A "
heumilkr_solution" object, typically obtained byclarke_wright().- relative
Should the saving be given as dimensionful value (in units of distance asprovided to
clarke_wright()), or as percentage relative to thenaive costs.Defaults toFALSE, i.e. a dimensionful value.
Value
The savings either as dimensionful value or as percentage relative to thenaive costs, depending onrelative.
Examples
demand<-c(3,2,4,2)positions<-data.frame( pos_x=c(0,1,-1,2,3), pos_y=c(0,1,1,2,3))solution<-clarke_wright(demand,dist(positions),data.frame(n=NA_integer_, caps=6))print(milkr_saving(solution))#> [1] 6.485281print(milkr_saving(solution, relative=TRUE))#> [1] 0.3275562