View source: R/heumilkr_solution.R
milkr_saving | R Documentation |
Measures the saving that was achieved by the heuristic optimization
algorithm clarke_wright()
compared to the naive vehicle run assignment,
i.e. one run per site.
milkr_saving(solution, relative = FALSE)
solution |
A " |
relative |
Should the saving be given as dimensionful value (in units of distance as
provided to |
The savings either as dimensionful value or as percentage relative to the
naive costs, depending on relative
.
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))
print(milkr_saving(solution, relative = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.