Pyvrp

Latest version: v0.8.2

Safety actively analyzes 623739 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

0.8.2

Fixes an issue with the Windows binaries that would crash with large default integer values. See 547 and 548 for details.

**Full Changelog**: https://github.com/PyVRP/PyVRP/compare/v0.8.1...v0.8.2

0.8.1

Small patch that fixes an issue with the automated deployment workflow.

What's Changed

* Benchmark results v0.8.0 by leonlan in https://github.com/PyVRP/PyVRP/pull/542
* Run CD also on push to main by N-Wouda in https://github.com/PyVRP/PyVRP/pull/544

**Full Changelog**: https://github.com/PyVRP/PyVRP/compare/v0.8.0...v0.8.1

0.8.0

The second release of 2024 adds support for several new VRP variants, includes a few much needed refactorings, and overall makes PyVRP easier to use.

Highlights

- PyVRP now also supports return shipments, from clients back to the depot (in 471). This means PyVRP can now also solve the VRP with **backhaul**, and the VRP with **simultaneous pickup and delivery**. Examples have been added to the documentation (in 513).
- PyVRP now supports a **maximum distance** constraint (in 500), in addition to the maximum duration constraint that was added in v0.7.0.
- PyVRP now supports mutually exclusive client groups (in 514). Exactly one client in such a group must be visited. This can be used to model **generalised VRP**, but also for example the VRP with **multiple time windows**.
- `Model.solve` now takes solver configuration options, and can be toggled to display solver progress.

Breaking changes

The following breaking changes have been made to PyVRP's `Model` interface:

- The default values for `tw_late` and `max_duration` has changed to `INT_MAX` in all cases. Additionally, `VehicleType.tw_early = 0`, `VehicleType.tw_late = INT_MAX`, and `VehicleType.max_duration = INT_MAX` now no longer take `None` as an argument (in 463).
- The `VehicleType` now also has a `max_distance = INT_MAX` argument.
- The `Client.demand` attribute has been renamed to `delivery`, and a `Client.pickup` attribute has been added. The `pickup` attribute can be used to indicate the amount of goods flowing from a client back to the depot. The `Client.__init__` method has been updated to reflect these changes (in 471). More generally, `demand` has been renamed to `delivery`, and a `pickup` value has been added where appropriate.
- We have separated the underlying data structures for clients and depots (in 481). Before, a depot also used the same data structure as a client, which resulted in many attributes that a depot does not have (and should not have been set to values other than zero). This change rectifies the situation by making those attributes unavailable for depots. The consequences to user code should be limited if one uses the `pyvrp.Model` interface.
- The `Client` object now also takes an optional `group` argument to indicate membership in a client group.
- All getters have been renamed to drop the use of `get_`. E.g., `solution.get_routes()` is now simply `solution.routes()`.
- All `name` arguments (available for depots, clients, and vehicle types) must now be passed as keywords, rather than by position.

Additional changes have been made to PyVRP's internals, but should not impact users of PyVRP's modelling interface.

Additional

- We have added OR-Tools as a reference solver to our [benchmarks page](https://pyvrp.org/setup/benchmarks.html) (in #469). The gaps to the BKS are 5-13% across different instances.
- PyVRP now uses 64-bit integer values internally (in 490). This significantly increases the range of acceptable input values.

What's Changed

* Update pybind11 to v2.11.1 by N-Wouda in https://github.com/PyVRP/PyVRP/pull/447
* Update pyvrp.repair operator interface to use lists of routes, not solutions by N-Wouda in https://github.com/PyVRP/PyVRP/pull/448
* Add Solution::Route::depot() member by N-Wouda in https://github.com/PyVRP/PyVRP/pull/449
* Consistency checks by N-Wouda in https://github.com/PyVRP/PyVRP/pull/450
* Add another TWS test checking duration and time warp values by N-Wouda in https://github.com/PyVRP/PyVRP/pull/457
* Add asserts that check for overflow by N-Wouda in https://github.com/PyVRP/PyVRP/pull/462
* Test Client::required field is correctly set, add Client attributes documentation by N-Wouda in https://github.com/PyVRP/PyVRP/pull/466
* Move tests out of the source tree by N-Wouda in https://github.com/PyVRP/PyVRP/pull/467
* Make [0, INT_MAX] the default time windows by N-Wouda in https://github.com/PyVRP/PyVRP/pull/463
* OR-Tools benchmark by leonlan in https://github.com/PyVRP/PyVRP/pull/469
* Print solver progress by leonlan in https://github.com/PyVRP/PyVRP/pull/460
* Proxy for segments of route statistics by N-Wouda in https://github.com/PyVRP/PyVRP/pull/473
* New README badges by leonlan in https://github.com/PyVRP/PyVRP/pull/477
* Simultaneous pickup and delivery by N-Wouda in https://github.com/PyVRP/PyVRP/pull/471
* Separate client and depot structs by N-Wouda in https://github.com/PyVRP/PyVRP/pull/481
* Rename TimeWindowSegment to DurationSegment by N-Wouda in https://github.com/PyVRP/PyVRP/pull/483
* Remove NodeStats struct, use vectors instead by N-Wouda in https://github.com/PyVRP/PyVRP/pull/484
* Support VRPLIB backhaul instances by leonlan in https://github.com/PyVRP/PyVRP/pull/485
* Update read and tests to properly round load and capacity values by N-Wouda in https://github.com/PyVRP/PyVRP/pull/493
* Switch over to int64_t by N-Wouda in https://github.com/PyVRP/PyVRP/pull/490
* VRPB benchmarking instructions by leonlan in https://github.com/PyVRP/PyVRP/pull/494
* Add DistanceSegment by N-Wouda in https://github.com/PyVRP/PyVRP/pull/487
* Per client argument in CLI by leonlan in https://github.com/PyVRP/PyVRP/pull/497
* Remove "get" prefix from data accessors by N-Wouda in https://github.com/PyVRP/PyVRP/pull/499
* Split 2-OPT into ReverseSegment and SwapTails by N-Wouda in https://github.com/PyVRP/PyVRP/pull/510
* Update quick tutorial with new problem variants by N-Wouda in https://github.com/PyVRP/PyVRP/pull/513
* Remove unnecessary local search operators by leonlan in https://github.com/PyVRP/PyVRP/pull/511
* Exact round function by leonlan in https://github.com/PyVRP/PyVRP/pull/517
* Add support for a maximum distance constraint by N-Wouda in https://github.com/PyVRP/PyVRP/pull/500
* Remove double precision support by N-Wouda in https://github.com/PyVRP/PyVRP/pull/518
* Update tests to use assert_equal where possible by N-Wouda in https://github.com/PyVRP/PyVRP/pull/519
* Make name argument keyword only by N-Wouda in https://github.com/PyVRP/PyVRP/pull/526
* Add ClientGroup by N-Wouda in https://github.com/PyVRP/PyVRP/pull/528
* Generalised VRP by N-Wouda in https://github.com/PyVRP/PyVRP/pull/514
* Make collecting statistics optional by N-Wouda in https://github.com/PyVRP/PyVRP/pull/531
* Add SolveParams configuration and separate solve function by leonlan in https://github.com/PyVRP/PyVRP/pull/523
* Make PopulationParams fields readonly by N-Wouda in https://github.com/PyVRP/PyVRP/pull/536
* Clip the penalty parameters to [1, 100K] by N-Wouda in https://github.com/PyVRP/PyVRP/pull/535
* Add a link to the paper's preprint to README and docs by N-Wouda in https://github.com/PyVRP/PyVRP/pull/540
* Simplify operators by N-Wouda in https://github.com/PyVRP/PyVRP/pull/534

**Full Changelog**: https://github.com/PyVRP/PyVRP/compare/v0.7.0...v0.8.0

0.7.0

Welcome to PyVRP 0.7! This first release of 2024 introduces several new features, some bug fixes, and overall improvements. There are also a few breaking changes, listed below.

PyVRP now supports:
- Vehicle routing problems with **multiple depots**;
- Vehicles with **maximum route duration constraints**;
- **Python 3.12**.

New features

- `ProblemData.replace` allows one to create a new `ProblemData` instance where one or more attributes are replaced with the given arguments (in 383).
- Max duration constraints on `VehicleType` (in 395).
- Optional, free-form name fields for clients, depots, and vehicle types (in 426).
- A new aggregate `MultipleCriteria` stopping criterion (in 427). This can be used to apply multiple stopping criteria at the same time.
- PyVRP now supports VRPs with multiple depots (in 411).
- PyVRP now uses an ordered crossover for TSP instances (in 423).
- Support for Python 3.12 (in 413).

Breaking changes

- `VehicleType.__init__` arguments, argument order and argument defaults have changed: see the documentation for details.
- Separate `clients` and `depots` arguments in `ProblemData.__init__`.
- `TimeWindowSegment.total_time_warp` has been renamed to `TimeWindowSegment.time_warp`, in line with other uses.
- Removed the `TimedNoImprovement` stopping criterion (in 427). Use the new aggregate `pyvrp.stop.MultipleCriteria` class instead, with arguments `NoImprovement` and `MaxRuntime`.

Additional

- MDVRPTW benchmark instances from the literature, in VRPLIB format (in https://github.com/PyVRP/Instances/pull/6).
- PyVRP v0.7.0 drops support for Python 3.8. The supported range of Python versions going forward is Python 3.9 - 3.12.

What's Changed

* Implement ProblemData.replace by leonlan in https://github.com/PyVRP/PyVRP/pull/383
* Keep route alive in Route::push_back and Route::insert by leonlan in https://github.com/PyVRP/PyVRP/pull/385
* Fix neighbourhood calculation by N-Wouda in https://github.com/PyVRP/PyVRP/pull/388
* Nearest route insert by N-Wouda in https://github.com/PyVRP/PyVRP/pull/386
* Decouple clients/depots lists by N-Wouda in https://github.com/PyVRP/PyVRP/pull/360
* Describe VRPLIB format by N-Wouda in https://github.com/PyVRP/PyVRP/pull/391
* Fix typos in test_PenaltyManager.py by wouterkool in https://github.com/PyVRP/PyVRP/pull/392
* Always apply round_func to service times; update instances by N-Wouda in https://github.com/PyVRP/PyVRP/pull/393
* Fix random constructor vehicle usage by leonlan in https://github.com/PyVRP/PyVRP/pull/397
* Don't re-open namespace std for specialisations by N-Wouda in https://github.com/PyVRP/PyVRP/pull/400
* Fix build by pinning pydantic version by N-Wouda in https://github.com/PyVRP/PyVRP/pull/402
* Bump Python version in RTD/fix dependencies by N-Wouda in https://github.com/PyVRP/PyVRP/pull/403
* Update VEHICLE specification in docs by N-Wouda in https://github.com/PyVRP/PyVRP/pull/405
* Reduce VehicleType struct size by N-Wouda in https://github.com/PyVRP/PyVRP/pull/406
* Update docblock by N-Wouda in https://github.com/PyVRP/PyVRP/pull/407
* Add homepage link to package metadata by N-Wouda in https://github.com/PyVRP/PyVRP/pull/409
* Remove superfluous compile flag in TWS by N-Wouda in https://github.com/PyVRP/PyVRP/pull/410
* Add support for Python 3.12, drop Python 3.8 by N-Wouda in https://github.com/PyVRP/PyVRP/pull/413
* Add max duration support by N-Wouda in https://github.com/PyVRP/PyVRP/pull/395
* Update type hinting to use builtin list, dict, and tuple by N-Wouda in https://github.com/PyVRP/PyVRP/pull/418
* Multi depot by N-Wouda in https://github.com/PyVRP/PyVRP/pull/411
* Add a flag that tracks whether the Route's structure has updated, but statistics have not been synced yet by N-Wouda in https://github.com/PyVRP/PyVRP/pull/421
* Add OX for TSP by N-Wouda in https://github.com/PyVRP/PyVRP/pull/423
* Add TspWarning to the docs by N-Wouda in https://github.com/PyVRP/PyVRP/pull/424
* Add support for reading MDVRPTW instances by N-Wouda in https://github.com/PyVRP/PyVRP/pull/425
* Add name fields by N-Wouda in https://github.com/PyVRP/PyVRP/pull/426
* Write MDVRPTW solutions, enable benchmarking by N-Wouda in https://github.com/PyVRP/PyVRP/pull/427
* Fix multi-depot test by leonlan in https://github.com/PyVRP/PyVRP/pull/431
* Link to Python source code by leonlan in https://github.com/PyVRP/PyVRP/pull/382
* Enforce zero matrix diagonal by wouterkool in https://github.com/PyVRP/PyVRP/pull/436
* Update docs about MDVRPTW by N-Wouda in https://github.com/PyVRP/PyVRP/pull/432
* Citation metadata by N-Wouda in https://github.com/PyVRP/PyVRP/pull/398
* Add missing default none for optional argument in _pyvrp.pyi by wouterkool in https://github.com/PyVRP/PyVRP/pull/437
* Add benchmark results to docs by N-Wouda in https://github.com/PyVRP/PyVRP/pull/438

**Full Changelog**: https://github.com/PyVRP/PyVRP/compare/v0.6.3...v0.7.0

0.6.3

Bugfix release that adds evaluation of fixed vehicle cost differences to the TwoOpt operator.

What's Changed
* Fix docstring num vehicle types by leonlan in https://github.com/PyVRP/PyVRP/pull/379
* Improve operator evaluation by N-Wouda in https://github.com/PyVRP/PyVRP/pull/376
* Evaluate fixed costs in TwoOpt by leonlan in https://github.com/PyVRP/PyVRP/pull/381

**Full Changelog**: https://github.com/PyVRP/PyVRP/compare/v0.6.2...v0.6.3

0.6.2

Adds the `extract_docstrings.py` script to the source distribution (sdist).

What's Changed

* Add test fixtures for instance reading by N-Wouda in https://github.com/PyVRP/PyVRP/pull/372
* Add LS test for required clients by N-Wouda in https://github.com/PyVRP/PyVRP/pull/370
* Add extract_docstrings script to sdist by N-Wouda in https://github.com/PyVRP/PyVRP/pull/377

**Full Changelog**: https://github.com/PyVRP/PyVRP/compare/v0.6.1...v0.6.2

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.