CW_VRP: Implements Clarke-Wright Savings algorithm to find greedy...

Description Usage Arguments References Examples

Description

Implements Clarke-Wright Savings algorithm to find greedy routes

Usage

1
2
3
4
CW_VRP(demand = NULL, locations = NULL, DMat = NULL,
  Vehicle_Capacity = NULL, method = "euclidean",
  Constraints = c("Capacity"), type = "Parallel", Plot = TRUE,
  logfile = TRUE)

Arguments

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

References

[1] Classical Heuristics for Vehicle Routing Problem by Gilbert Laporte and Frederic Semet, October, 1998 (Revised: August, 1999), Les Cahiers du Gerad

Examples

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)

kavetinaveen/HeuristicsVRP documentation built on May 20, 2019, 7:53 a.m.