Description Usage Arguments References Examples
Implements Clarke-Wright Savings algorithm to find greedy routes
1 2 3 4 |
demand |
– Demand at each node [ID, Demand] |
locations |
– [ID, X, Y] Node id and X, Y co-ordinates/long, lat |
DMat |
– Provide distance matrix, if you already have computed. Make sure that first row and column of the distance matrix represents distances from depot to all the nodes |
Vehicle_Capacity |
– Vehicle capacity |
method |
– Metric to calculate distnace between nodes. Feasible methods for X-Y co-ordinates c("euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski"); Feasible methods for Long-Lat c(distCosine, distHaversine). Default: "euclidean". Note: Please make sure that, method should be a character only for X-Y co-ordinates not for Long-Lat |
Constraints |
– List of constraints to check. Currently implemented only vehicle capacity constraint |
type |
– Type of savings algorithm. Possible values ("Parallel", "Sequential"). If you want to build more than one route then we strong recommend you to use "Parallel", "Sequential" algorithm may end up with infeasible nodes for more than one route. For building one route (assumes infinite vehilce capacity) go for "Sequential" |
Plot |
– If you want to plot the final greedy routes. Logical (TRUE or FALSE). Default: TRUE |
logfile |
– If you want to save all routes in each iteration. Logical (TRUE or FALSE). Check "Results.txt" or "Results_Seq.txt" in your working directory. Default: TRUE |
[1] Classical Heuristics for Vehicle Routing Problem by Gilbert Laporte and Frederic Semet, October, 1998 (Revised: August, 1999), Les Cahiers du Gerad
1 2 3 4 5 6 7 8 9 | data(An32k5locations)
locations <- An32k5locations
DMat <- DistMat(locations[, -1])
row.names(DMat) <- locations[, 1]
colnames(DMat) <- locations[, 1]
data(An32k5demand)
demand <- An32k5demand
Vehicle_Capacity <- 100
CW_VRP(demand = demand, locations = locations, Vehicle_Capacity = Vehicle_Capacity)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.