Skip to content

Commit 6f2d7a9

Browse files
Revert "Reset base to working commit"
This reverts commit c6c75ac.
1 parent c6c75ac commit 6f2d7a9

56 files changed

Lines changed: 1242 additions & 1153 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
#### Features
88

9-
- Ability to set different task times per vehicle type (#336)
10-
- Task times can be included in the cost used internally for optimization (#1130)
11-
- Support for cost per hour spent on tasks on a vehicle basis (#1130)
9+
- Ability to set different tasks setup/service time per vehicle type (#336)
1210

1311
#### Internals
1412

1513
- Apply heuristics to partial solutions provided in input (#977)
14+
- LOG_LS flag to generate debug info on the internal solving process (#1124)
1615

1716
### Changed
1817

@@ -32,10 +31,6 @@
3231
- Remove heuristic synchronisation (#1188)
3332
- Refactor gain evaluation in operators to ease code maintenance and extension (#1266)
3433
- Remove `LOG_LS_OPERATORS` (#1263)
35-
- Update README to clarify high-level purpose and usage of the project (#1264)
36-
- Remove unused `breaks_travel_margin` members from TWRoute and associated code (#1295)
37-
- Run routing requests in parallel (#1218)
38-
- Refactor parallel solving (#1305)
3934

4035
#### CI
4136

@@ -49,7 +44,6 @@
4944
#### Dependency
5045

5146
- Update `LibosrmWrapper` to breaking change introduced in OSRM v6 (#1234)
52-
- Update `asio` usage for deprecated `io_service` and `query` (#1279)
5347

5448
### Fixed
5549

@@ -66,9 +60,6 @@
6660
- Solution "shadowing" when only comparing indicators (#1199)
6761
- Too loose `max_tasks` bound derived from TW (#1243)
6862
- Wrong evaluation in `ReverseTwoOpt` (#1271)
69-
- Misleading error with custom distance matrix (#1281)
70-
- Wrong distance-based optimization with only custom durations (#1298)
71-
- Break positioning heuristic shortcoming (#1251)
7263

7364
#### Internals
7465

README.md

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,23 @@
1-
# Complex Route Optimization in Milliseconds
1+
# Vehicle Routing Open-source Optimization Machine
22

33
_Good solutions, fast._
44

55
---
66

77
## About
88

9-
Vroom is an open-source route optimization engine written in C++20
10-
that solves complex [vehicle routing
9+
VROOM is an open-source optimization engine written in C++20 that aim
10+
at providing good solutions to various real-life [vehicle routing
1111
problems](https://en.wikipedia.org/wiki/Vehicle_routing_problem) (VRP)
12-
in milliseconds.
13-
14-
The project is maintained by [Verso](https://verso-optim.com). If you
15-
want to get started as quickly as possible with route optimization,
16-
you want white-glove support to increase the ROI from your
17-
optimization project and/or you need access to the best possible data
18-
for even more accurate route timing, you should use the [Vroom Premium
19-
API](https://verso-optim.com/api/).
20-
21-
## Why use Vroom?
22-
23-
Vroom is ideally suited to situations in which route optimization has
24-
to be done quickly, both to react to changes and new requests and to
25-
iterate on your routes to find the solution that works best for all
26-
stakeholders.
27-
28-
Vroom doesn't replace domain expertise. It allows fleet managers and
29-
business owners to apply their domain knowledge and understanding of
30-
the company culture to larger, more complex optimization problems than
31-
they could manage manually.
32-
33-
The open source project is ideal for companies who want to control
34-
their own infrastructure, have the technical expertise to do so and
35-
can manage their own data integration. If you would rather not manage
36-
your own infrastructure, if you want access to expertise around route
37-
optimization or if you want more accurate ETA relying on enhanced
38-
speed estimates, consider using the [Vroom Premium
39-
API](https://verso-optim.com/api/).
12+
within a small computing time.
13+
14+
The project has been initiated by [Verso](https://verso-optim.com/) to
15+
power its [route optimization
16+
API](https://blog.verso-optim.com/category/route-optimization/api/).
4017

4118
## Supported problem types
4219

43-
Vroom solves several well-known types of vehicle routing problems
20+
VROOM can solve several well-known types of vehicle routing problems
4421
(VRP).
4522

4623
- TSP (travelling salesman problem)
@@ -49,13 +26,11 @@ Vroom solves several well-known types of vehicle routing problems
4926
- MDHVRPTW (multi-depot heterogeneous vehicle VRPTW)
5027
- PDPTW (pickup-and-delivery problem with TW)
5128

52-
Vroom solves all of the above routing problems at the same time — and
53-
delivers the optimized route in milliseconds, even when complex
54-
variables are involved.
29+
VROOM can also solve any mix of the above problem types.
5530

56-
## How it works
31+
## Features
5732

58-
Vroom models a VRP with a description of resources (`vehicles`),
33+
VROOM models a VRP with a description of resources (`vehicles`),
5934
single-location pickup and/or delivery tasks (`jobs`) and
6035
pickup-and-delivery tasks that should happen within the same route
6136
(`shipments`).
@@ -80,14 +55,14 @@ pickup-and-delivery tasks that should happen within the same route
8055

8156
## Supported routing engines
8257

83-
Vroom works out-of-the-box on top of several open-source routing
58+
VROOM works out-of-the-box on top of several open-source routing
8459
engines.
8560

8661
- [OSRM](http://project-osrm.org/)
8762
- [Openrouteservice](https://openrouteservice.org/)
8863
- [Valhalla](https://github.com/valhalla/valhalla)
8964

90-
Vroom can also use a custom cost matrix computed from any other
65+
VROOM can also use a custom cost matrix computed from any other
9166
source.
9267

9368
## Getting started
@@ -97,54 +72,54 @@ source.
9772
- The [demo frontend](http://map.vroom-project.org/) provides a simple
9873
user interface for quick tests.
9974
- The [demo
100-
server](https://github.com/Vroom-Project/vroom/wiki/Demo-server) makes
75+
server](https://github.com/VROOM-Project/vroom/wiki/Demo-server) makes
10176
it easy to send sample optimization requests for testing purposes.
10277

103-
### Setup your own Vroom stack
78+
### Setup your own VROOM stack
10479

10580
#### Solving engine
10681

10782
Several options are available to get `vroom` running on command-line.
10883

10984
1. Build from source following [the wiki
110-
instructions](https://github.com/Vroom-Project/vroom/wiki/Building).
85+
instructions](https://github.com/VROOM-Project/vroom/wiki/Building).
11186
2. Use
112-
[`vroom-docker`](https://github.com/Vroom-Project/vroom-docker).
87+
[`vroom-docker`](https://github.com/VROOM-Project/vroom-docker).
11388

11489
### Command-line usage
11590

11691
Refer to [this wiki
117-
page](https://github.com/Vroom-Project/vroom/wiki/Usage)
92+
page](https://github.com/VROOM-Project/vroom/wiki/Usage)
11893

11994
#### Http wrapper
12095

121-
[`vroom-express`](https://github.com/Vroom-Project/vroom-express) is a
96+
[`vroom-express`](https://github.com/VROOM-Project/vroom-express) is a
12297
simple wrapper to use `vroom` with http requests. It's already bundled
12398
in the `vroom-docker` setup.
12499

125100
#### Using libvroom from C++
126101

127102
The project can also used as a library from any C++ project, refer to
128103
[this wiki
129-
page](https://github.com/Vroom-Project/vroom/wiki/Using-libvroom).
104+
page](https://github.com/VROOM-Project/vroom/wiki/Using-libvroom).
130105

131106
## Tests
132107

133108
### CI builds
134109

135-
[![vroom](https://github.com/Vroom-Project/vroom/actions/workflows/vroom.yml/badge.svg)](https://github.com/Vroom-Project/vroom/actions/workflows/vroom.yml)
110+
[![vroom](https://github.com/VROOM-Project/vroom/actions/workflows/vroom.yml/badge.svg)](https://github.com/VROOM-Project/vroom/actions/workflows/vroom.yml)
136111

137-
[![vroom + libosrm](https://github.com/Vroom-Project/vroom/actions/workflows/vroom_libosrm.yml/badge.svg?branch=master)](https://github.com/Vroom-Project/vroom/actions/workflows/vroom_libosrm.yml)
112+
[![vroom + libosrm](https://github.com/VROOM-Project/vroom/actions/workflows/vroom_libosrm.yml/badge.svg?branch=master)](https://github.com/VROOM-Project/vroom/actions/workflows/vroom_libosrm.yml)
138113

139-
[Github Actions](https://github.com/Vroom-Project/vroom/actions) are
114+
[Github Actions](https://github.com/VROOM-Project/vroom/actions) are
140115
used to check the build across various compilers and settings.
141116

142117
### Functional tests
143118

144119
Several sets of instances are used.
145120

146121
1. Benchmark instances from papers (see [wiki page with
147-
results](https://github.com/Vroom-Project/vroom/wiki/Benchmarks)).
122+
results](https://github.com/VROOM-Project/vroom/wiki/Benchmarks)).
148123
2. Custom random instances generated to target typical use-cases and
149124
constraints settings.
150125
3. Real-life instances.
@@ -156,11 +131,11 @@ solution quality and computing times.
156131

157132
## Reference in publications
158133

159-
To cite Vroom in publications, please use:
134+
To cite VROOM in publications, please use:
160135

161136
```bibtex
162137
@manual{vroom_v1.14,
163-
title = {{Vroom v1.14, Vehicle Routing Open-source Optimization Machine}},
138+
title = {{VROOM v1.14, Vehicle Routing Open-source Optimization Machine}},
164139
author = {Coupey, Julien and Nicod, Jean-Marc and Varnier, Christophe},
165140
year = 2024,
166141
organization = {Verso (\url{https://verso-optim.com/})},

docs/API.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ A `cost` object has the following properties:
132132
| ----------- | ----------- |
133133
| [`fixed`] | integer defining the cost of using this vehicle in the solution (defaults to `0`) |
134134
| [`per_hour`] | integer defining the cost for one hour of travel time with this vehicle (defaults to `3600`) |
135-
| [`per_task_hour`] | integer defining the cost for one hour of task time (setup + service) with this vehicle (defaults to `0`) |
136135
| [`per_km`] | integer defining the cost for one km of travel time with this vehicle (defaults to `0`) |
137136

138137
Using a non-default `per-hour` value means defining travel costs based
@@ -311,14 +310,12 @@ integers filed under the `profile` key, then under:
311310

312311
- `durations` for a custom travel-time matrix that will be used for
313312
all checks against timing constraints;
314-
- `distances` for a custom distance matrix (requires also providing
315-
custom `durations`);
313+
- `distances` for a custom distance matrix;
316314
- `costs` for a custom cost matrix that will be used within all route
317315
cost evaluations.
318316

319-
If `durations` are provided without `distances` and distances are
320-
required (either by `-g` or a non-zero `per_km` cost), then a call to
321-
the routing engine is generated to fetch distances.
317+
If only the `durations` matrix is provided, internal costs are derived from
318+
durations based on vehicles `costs` properties.
322319

323320
Example of describing different matrices for different vehicle
324321
profiles:

src/algorithms/heuristics/heuristics.cpp

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -153,38 +153,31 @@ template <class Route> struct UnassignedCosts {
153153
min_unassigned_to_route(input.jobs.size(),
154154
std::numeric_limits<Cost>::max()) {
155155
for (const auto job_rank : unassigned) {
156-
const auto& unassigned_job = input.jobs[job_rank];
157-
const auto unassigned_job_index = unassigned_job.index();
158-
159-
// The purpose here is to generate insertion lower bounds so we
160-
// only account for service times (no setup) which are
161-
// independent of insertion rank.
162-
const auto added_service = unassigned_job.services[vehicle.type];
163-
const auto service_cost = vehicle.task_eval(added_service).cost;
156+
const auto unassigned_job_index = input.jobs[job_rank].index();
164157

165158
if (vehicle.has_start()) {
166159
const auto start_to_job =
167160
vehicle.eval(vehicle.start.value().index(), unassigned_job_index)
168161
.cost;
169-
min_route_to_unassigned[job_rank] = start_to_job + service_cost;
162+
min_route_to_unassigned[job_rank] = start_to_job;
170163
}
171164

172165
if (vehicle.has_end()) {
173166
const auto job_to_end =
174167
vehicle.eval(unassigned_job_index, vehicle.end.value().index()).cost;
175-
min_unassigned_to_route[job_rank] = job_to_end + service_cost;
168+
min_unassigned_to_route[job_rank] = job_to_end;
176169
}
177170

178171
for (const auto j : route.route) {
179172
const auto job_index = input.jobs[j].index();
180173

181174
const auto job_to_unassigned =
182-
vehicle.eval(job_index, unassigned_job_index).cost + service_cost;
175+
vehicle.eval(job_index, unassigned_job_index).cost;
183176
min_route_to_unassigned[job_rank] =
184177
std::min(min_route_to_unassigned[job_rank], job_to_unassigned);
185178

186179
const auto unassigned_to_job =
187-
vehicle.eval(unassigned_job_index, job_index).cost + service_cost;
180+
vehicle.eval(unassigned_job_index, job_index).cost;
188181
min_unassigned_to_route[job_rank] =
189182
std::min(min_unassigned_to_route[job_rank], unassigned_to_job);
190183
}
@@ -222,19 +215,15 @@ template <class Route> struct UnassignedCosts {
222215
const std::set<Index>& unassigned,
223216
Index inserted_index) {
224217
for (const auto j : unassigned) {
225-
const auto& unassigned_job = input.jobs[j];
226-
const auto unassigned_job_index = unassigned_job.index();
227-
228-
const auto added_service = unassigned_job.services[vehicle.type];
229-
const auto service_cost = vehicle.task_eval(added_service).cost;
218+
const auto unassigned_job_index = input.jobs[j].index();
230219

231220
const auto to_unassigned =
232-
vehicle.eval(inserted_index, unassigned_job_index).cost + service_cost;
221+
vehicle.eval(inserted_index, unassigned_job_index).cost;
233222
min_route_to_unassigned[j] =
234223
std::min(min_route_to_unassigned[j], to_unassigned);
235224

236225
const auto from_unassigned =
237-
vehicle.eval(unassigned_job_index, inserted_index).cost + service_cost;
226+
vehicle.eval(unassigned_job_index, inserted_index).cost;
238227
min_unassigned_to_route[j] =
239228
std::min(min_unassigned_to_route[j], from_unassigned);
240229
}
@@ -290,7 +279,7 @@ inline Eval fill_route(const Input& input,
290279

291280
for (Index r = 0; r <= route.size(); ++r) {
292281
const auto current_eval =
293-
utils::addition_eval(input, job_rank, vehicle, route.route, r);
282+
utils::addition_cost(input, job_rank, vehicle, route.route, r);
294283

295284
const double current_cost =
296285
static_cast<double>(current_eval.cost) -
@@ -328,7 +317,7 @@ inline Eval fill_route(const Input& input,
328317
route.route.size() + 1);
329318

330319
for (unsigned d_rank = 0; d_rank <= route.route.size(); ++d_rank) {
331-
d_adds[d_rank] = utils::addition_eval(input,
320+
d_adds[d_rank] = utils::addition_cost(input,
332321
job_rank + 1,
333322
vehicle,
334323
route.route,
@@ -340,7 +329,7 @@ inline Eval fill_route(const Input& input,
340329
}
341330

342331
for (Index pickup_r = 0; pickup_r <= route.size(); ++pickup_r) {
343-
const auto p_add = utils::addition_eval(input,
332+
const auto p_add = utils::addition_cost(input,
344333
job_rank,
345334
vehicle,
346335
route.route,
@@ -381,7 +370,7 @@ inline Eval fill_route(const Input& input,
381370

382371
Eval current_eval;
383372
if (pickup_r == delivery_r) {
384-
current_eval = utils::addition_eval(input,
373+
current_eval = utils::addition_cost(input,
385374
job_rank,
386375
vehicle,
387376
route.route,

src/algorithms/local_search/insertion_search.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ compute_best_insertion_single(const Input& input,
4444
rank < sol_state.insertion_ranks_end[v][j];
4545
++rank) {
4646
const Eval current_eval =
47-
utils::addition_eval(input, j, v_target, route.route, rank);
47+
utils::addition_cost(input, j, v_target, route.route, rank);
4848
if (current_eval.cost < result.eval.cost &&
4949
v_target.ok_for_range_bounds(sol_state.route_evals[v] +
5050
current_eval) &&
@@ -113,7 +113,7 @@ RouteInsertion compute_best_insertion_pd(const Input& input,
113113
bool found_valid = false;
114114
for (unsigned d_rank = begin_d_rank; d_rank < end_d_rank; ++d_rank) {
115115
d_adds[d_rank] =
116-
utils::addition_eval(input, j + 1, v_target, route.route, d_rank);
116+
utils::addition_cost(input, j + 1, v_target, route.route, d_rank);
117117
if (result.eval < d_adds[d_rank]) {
118118
valid_delivery_insertions[d_rank] = false;
119119
} else {
@@ -132,7 +132,7 @@ RouteInsertion compute_best_insertion_pd(const Input& input,
132132
pickup_r < sol_state.insertion_ranks_end[v][j];
133133
++pickup_r) {
134134
const Eval p_add =
135-
utils::addition_eval(input, j, v_target, route.route, pickup_r);
135+
utils::addition_cost(input, j, v_target, route.route, pickup_r);
136136
if (result.eval < p_add) {
137137
// Even without delivery insertion more expensive than current best.
138138
continue;
@@ -173,7 +173,7 @@ RouteInsertion compute_best_insertion_pd(const Input& input,
173173

174174
Eval pd_eval;
175175
if (pickup_r == delivery_r) {
176-
pd_eval = utils::addition_eval(input,
176+
pd_eval = utils::addition_cost(input,
177177
j,
178178
v_target,
179179
route.route,

0 commit comments

Comments
 (0)