Skip to contents

Modelling

Build a VRP model by piping together depots, clients and vehicle types.

vrp_model()
Build a vehicle routing (VRP) model
add_depot()
Add a depot to the model
add_clients()
Add clients to the model
add_vehicle_type()
Add a vehicle type to the model
add_client_group()
Add a mutually exclusive group of clients

Solving

Run the iterated local search solver and control when it stops.

vrp_solve()
Solve a VRP model
ils_params()
ILS solver parameters
max_runtime() max_iterations() no_improvement() first_feasible()
Solver stopping criteria

Results

Inspect and visualise a solution.

cost()
Cost of a result or solution
routes()
Routes of a solution, in long (tidy) format
summary(<vrpr_result>)
One-row summary of a result (tibble)
unvisited_clients()
Unvisited optional clients
plot(<vrpr_result>)
Plot the solution of a VRP result
plot(<vrpr_model>)
Plot a VRP model (depots and clients only)

Reading instances

Read standard VRPLIB and Solomon instance files.

read_vrplib()
Read an instance in VRPLIB / TSPLIB format
read_solomon()
Read a VRPTW instance in Solomon format

Lower-level building blocks

Direct access to the problem data, solutions and cost evaluator.

vrp_problem_data()
Assemble the problem data (ProblemData) from a model
vrp_solution()
Build a solution from explicit routes
vrp_random_solution()
Generate a random solution
vrp_cost_evaluator()
Cost evaluator (CostEvaluator)
solution_cost()
Cost of a solution