nextroute 1.11.1.dev0__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,281 @@
1
+ Metadata-Version: 2.2
2
+ Name: nextroute
3
+ Version: 1.11.1.dev0
4
+ Summary: Nextroute is an engine for solving Vehicle Routing Problems (VRPs).
5
+ Author-email: Nextmv <tech@nextmv.io>
6
+ Maintainer-email: Nextmv <tech@nextmv.io>
7
+ License: # LICENSE
8
+
9
+ Business Source License 1.1
10
+
11
+ Parameters
12
+
13
+ Licensor: nextmv.io inc
14
+ Licensed Work: nextroute
15
+
16
+ Change Date: Four years from the date the Licensed Work is published.
17
+ Change License: GPLv3
18
+
19
+ For information about alternative licensing arrangements for the Software,
20
+ please email info@nextmv.io.
21
+
22
+ Notice
23
+
24
+ The Business Source License (this document, or the “License”) is not an Open
25
+ Source license. However, the Licensed Work will eventually be made available
26
+ under an Open Source License, as stated in this License.
27
+
28
+ License text copyright © 2023 MariaDB plc, All Rights Reserved. “Business Source
29
+ License” is a trademark of MariaDB plc.
30
+
31
+ -----------------------------------------------------------------------------
32
+
33
+ ## Terms
34
+
35
+ The Licensor hereby grants you the right to copy, modify, create derivative
36
+ works, redistribute, and make non-production use of the Licensed Work. The
37
+ Licensor may make an Additional Use Grant, above, permitting limited production
38
+ use.
39
+
40
+ Effective on the Change Date, or the fourth anniversary of the first publicly
41
+ available distribution of a specific version of the Licensed Work under this
42
+ License, whichever comes first, the Licensor hereby grants you rights under the
43
+ terms of the Change License, and the rights granted in the paragraph above
44
+ terminate.
45
+
46
+ If your use of the Licensed Work does not comply with the requirements currently
47
+ in effect as described in this License, you must purchase a commercial license
48
+ from the Licensor, its affiliated entities, or authorized resellers, or you must
49
+ refrain from using the Licensed Work.
50
+
51
+ All copies of the original and modified Licensed Work, and derivative works of
52
+ the Licensed Work, are subject to this License. This License applies separately
53
+ for each version of the Licensed Work and the Change Date may vary for each
54
+ version of the Licensed Work released by Licensor.
55
+
56
+ You must conspicuously display this License on each original or modified copy of
57
+ the Licensed Work. If you receive the Licensed Work in original or modified form
58
+ from a third party, the terms and conditions set forth in this License apply to
59
+ your use of that work.
60
+
61
+ Any use of the Licensed Work in violation of this License will automatically
62
+ terminate your rights under this License for the current and all other versions
63
+ of the Licensed Work.
64
+
65
+ This License does not grant you any right in any trademark or logo of Licensor
66
+ or its affiliates (provided that you may use a trademark or logo of Licensor as
67
+ expressly required by this License).TO THE EXTENT PERMITTED BY APPLICABLE LAW,
68
+ THE LICENSED WORK IS PROVIDED ON AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL
69
+ WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION)
70
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
71
+ NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this
72
+ License’s text to license your works, and to refer to it using the trademark
73
+ “Business Source License”, as long as you comply with the Covenants of Licensor
74
+ below.
75
+
76
+ ## Covenants of Licensor
77
+
78
+ In consideration of the right to use this License’s text and the “Business
79
+ Source License” name and trademark, Licensor covenants to MariaDB, and to all
80
+ other recipients of the licensed work to be provided by Licensor:
81
+
82
+ To specify as the Change License the GPL Version 2.0 or any later version, or a
83
+ license that is compatible with GPL Version 2.0 or a later version, where
84
+ “compatible” means that software provided under the Change License can be
85
+ included in a program with software provided under GPL Version 2.0 or a later
86
+ version. Licensor may specify additional Change Licenses without limitation. To
87
+ either: (a) specify an additional grant of rights to use that does not impose
88
+ any additional restriction on the right granted in this License, as the
89
+ Additional Use Grant; or (b) insert the text “None” to specify a Change Date.
90
+ Not to modify this License in any other way.
91
+
92
+ License text copyright © 2023 MariaDB plc, All Rights Reserved. “Business Source
93
+ License” is a trademark of MariaDB plc.
94
+
95
+ Project-URL: Homepage, https://www.nextmv.io
96
+ Project-URL: Documentation, https://www.nextmv.io/docs/vehicle-routing
97
+ Project-URL: Repository, https://github.com/nextmv-io/nextroute
98
+ Keywords: decision engineering,decision science,decisions,nextmv,optimization,operations research,solver,vehicle routing problem
99
+ Classifier: License :: Other/Proprietary License
100
+ Classifier: Operating System :: OS Independent
101
+ Classifier: Programming Language :: Python :: 3
102
+ Classifier: Programming Language :: Python :: 3.8
103
+ Classifier: Programming Language :: Python :: 3.9
104
+ Classifier: Programming Language :: Python :: 3.10
105
+ Classifier: Programming Language :: Python :: 3.11
106
+ Classifier: Programming Language :: Python :: 3.12
107
+ Classifier: Programming Language :: Python :: 3.13
108
+ Requires-Python: >=3.8
109
+ Description-Content-Type: text/markdown
110
+ License-File: LICENSE
111
+ Requires-Dist: pydantic>=2.5.2
112
+
113
+ # Nextroute
114
+
115
+ Welcome to Nextmv's **Nextroute**, a feature-rich Vehicle Routing Problem (VRP)
116
+ solver written in pure Go. Designed with a focus on maintainability,
117
+ feature-richness, and extensibility, Nextroute is built to handle real-world
118
+ applications across [all platforms that Go (cross)compiles
119
+ to](https://go.dev/doc/install/source#environment).
120
+
121
+ Our goal is not to compete on specific VRP type benchmarks, but to provide a
122
+ robust and versatile tool that can adapt to a variety of routing use-cases.
123
+ Whether you're optimizing the routes for a small fleet of delivery vans in a
124
+ city or managing complex logistics for a global supply chain, Nextroute is
125
+ equipped to help you find efficient solutions.
126
+
127
+ You can work with Nextroute in a variety of ways:
128
+
129
+ * Go package: Import the `nextroute` package in your Go project and use the
130
+ solver directly.
131
+ * Python package: Use the `nextroute` Python package as an interface to the Go
132
+ solver.
133
+
134
+ ## Features
135
+
136
+ | Feature | Description |
137
+ | ------- | ----------- |
138
+ | [Alternate stops](https://www.nextmv.io/docs/vehicle-routing/features/alternate-stops) | Specify a set of alternate stops per vehicle for which only one should be serviced. |
139
+ | [Compatibility attributes](https://www.nextmv.io/docs/vehicle-routing/features/compatibility-attributes) | Specify which stops are compatible with which vehicles. |
140
+ | [Capacity](https://www.nextmv.io/docs/vehicle-routing/features/capacity) | Set capacities for vehicles and quantities (demanded or offered) at stops. |
141
+ | [Cluster constraint](https://www.nextmv.io/docs/vehicle-routing/features/cluster-constraint) | Enforce the creation of clustered routes. |
142
+ | [Cluster objective](https://www.nextmv.io/docs/vehicle-routing/features/cluster-objective) | Incentivize the creation of clustered routes. |
143
+ | [Custom constraints](https://www.nextmv.io/docs/vehicle-routing/features/custom-constraints) | Implement custom constraints with Nextmv SDK. |
144
+ | [Custom data](https://www.nextmv.io/docs/vehicle-routing/features/custom-data) | Add custom data that is preserved in the output. |
145
+ | [Custom matrices](https://www.nextmv.io/docs/vehicle-routing/features/custom-matrices) | Use custom matrices to achieve more precise drive time. |
146
+ | [Custom objectives](https://www.nextmv.io/docs/vehicle-routing/features/custom-objectives) | Implement custom objectives with Nextmv SDK. |
147
+ | [Custom operators](https://www.nextmv.io/docs/vehicle-routing/features/custom-operators) | Implement custom operators with Nextmv SDK. |
148
+ | [Custom output](https://www.nextmv.io/docs/vehicle-routing/features/custom-output) | Create a custom output for your app. |
149
+ | [Distance matrix](https://www.nextmv.io/docs/vehicle-routing/features/distance-matrix) | Specify a distance matrix in the input that provides the distance of going from location A to B. |
150
+ | [Duration matrix](https://www.nextmv.io/docs/vehicle-routing/features/duration-matrix) | Specify a duration matrix in the input that provides the duration of going from location A to B. |
151
+ | [Duration groups](https://www.nextmv.io/docs/vehicle-routing/features/duration-groups) | Specify a duration that is added every time a stop in the group is approached from a stop outside of the group. |
152
+ | [Early arrival time penalty](https://www.nextmv.io/docs/vehicle-routing/features/early-arrival-time-penalty) | Specify a penalty that is added to the objective when arriving before a stop's target arrival time. |
153
+ | [Late arrival time penalty](https://www.nextmv.io/docs/vehicle-routing/features/late-arrival-time-penalty) | Specify a penalty that is added to the objective when arriving after a stop's target arrival time. |
154
+ | [Map data in cloud](https://www.nextmv.io/docs/vehicle-routing/features/map-data) | Calculates duration and distance matrices using a hosted OSRM map service when running on Nextmv Cloud. Note that map data is a paid feature. |
155
+ | [Maximum route distance](https://www.nextmv.io/docs/vehicle-routing/features/max-distance) | Specify the maximum distance that a vehicle can travel. |
156
+ | [Maximum route duration](https://www.nextmv.io/docs/vehicle-routing/features/max-duration) | Specify the maximum duration that a vehicle can travel for. |
157
+ | [Maximum route stops](https://www.nextmv.io/docs/vehicle-routing/features/max-stops) | Specify the maximum stops that a vehicle can visit. |
158
+ | [Maximum wait time](https://www.nextmv.io/docs/vehicle-routing/features/max-wait) | Specify the maximum time a vehicle can wait when arriving before the start time window opens at a stop. |
159
+ | [Minimum route stops](https://www.nextmv.io/docs/vehicle-routing/features/min-stops) | Specify the minimum stops that a vehicle should visit (applying a penalty). |
160
+ | [Nextcheck](https://www.nextmv.io/docs/vehicle-routing/features/nextcheck) | Check which stops can be planned or why stops have been unplanned. |
161
+ | [Precedence](https://www.nextmv.io/docs/vehicle-routing/features/precedence) | Add pickups and deliveries or specify multiple pickups before deliveries and vice versa. |
162
+ | [Stop duration](https://www.nextmv.io/docs/vehicle-routing/features/stop-duration) | Specify the time it takes to service a stop. |
163
+ | [Stop duration multiplier](https://www.nextmv.io/docs/vehicle-routing/features/stop-duration-multiplier) | Specify a multiplier on time it takes a vehicle to service a stop. |
164
+ | [Stop groups](https://www.nextmv.io/docs/vehicle-routing/features/stop-groups) | Specify stops that must be assigned together on the same route, with no further requirements. |
165
+ | [Stop mixing](https://www.nextmv.io/docs/vehicle-routing/features/stop-mixing) | Specify properties of stops which can not be on the vehicle at the same time. |
166
+ | [Time windows](https://www.nextmv.io/docs/vehicle-routing/features/time-windows) | Specify the time window in which a stop must start service. |
167
+ | [Unplanned penalty](https://www.nextmv.io/docs/vehicle-routing/features/unplanned-penalty) | Specify a penalty that is added to the objective to leave a stop unplanned when all constraints cannot be fulfilled. |
168
+ | [Vehicle activation penalty](https://www.nextmv.io/docs/vehicle-routing/features/vehicle-activation-penalty) | Specify a penalty that is added to the objective for activating (using) a vehicle. |
169
+ | [Vehicle initial stops](https://www.nextmv.io/docs/vehicle-routing/features/vehicle-initial-stops) | Specify initial stops planned on a vehicle. |
170
+ | [Vehicle start/end location](https://www.nextmv.io/docs/vehicle-routing/features/vehicle-start-end-location) | Specify optional starting and ending locations for vehicles. |
171
+ | [Vehicle start/end time](https://www.nextmv.io/docs/vehicle-routing/features/vehicle-start-end-time) | Specify optional starting and ending time for a vehicle. |
172
+
173
+ ## License
174
+
175
+ Please note that Nextroute is provided as _source-available_ software (not
176
+ _open-source_). For further information, please refer to the [LICENSE](./LICENSE.md)
177
+ file.
178
+
179
+ ## Installation
180
+
181
+ * Go
182
+
183
+ Install the Go package with the following command:
184
+
185
+ ```bash
186
+ go get github.com/nextmv-io/nextroute
187
+ ```
188
+
189
+ * Python
190
+
191
+ Install the Python package with the following command:
192
+
193
+ ```bash
194
+ pip install nextroute
195
+ ```
196
+
197
+ ## Usage
198
+
199
+ For further information on how to get started, features, deployment, etc.,
200
+ please refer to the [official
201
+ documentation](https://www.nextmv.io/docs/vehicle-routing/get-started).
202
+
203
+ ### Go
204
+
205
+ A first run can be done with the following command. Stand at the root of the
206
+ repository and run:
207
+
208
+ ```bash
209
+ go run cmd/main.go -runner.input.path cmd/input.json -solve.duration 5s
210
+ ```
211
+
212
+ This will run the solver for 5 seconds and output the result to the console.
213
+
214
+ In order to start a _new project_, please refer to the sample app in the
215
+ [community-apps repository](https://github.com/nextmv-io/community-apps/tree/develop/go-nextroute).
216
+ If you have [Nextmv CLI](https://www.nextmv.io/docs/platform/installation#nextmv-cli)
217
+ installed, you can create a new project with the following command:
218
+
219
+ ```bash
220
+ nextmv community clone -a go-nextroute
221
+ ```
222
+
223
+ ### Python
224
+
225
+ A first run can be done by executing the following script. Stand at the root of
226
+ the repository and execute it:
227
+
228
+ ```python
229
+ import json
230
+
231
+ import nextroute
232
+
233
+ with open("cmd/input.json") as f:
234
+ data = json.load(f)
235
+
236
+ input = nextroute.schema.Input.from_dict(data)
237
+ options = nextroute.Options(SOLVE_DURATION=5)
238
+ output = nextroute.solve(input, options)
239
+ print(json.dumps(output.to_dict(), indent=2))
240
+ ```
241
+
242
+ This will run the solver for 5 seconds and output the result to the console.
243
+
244
+ In order to start a _new project_, please refer to the sample app in the
245
+ [community-apps repository](https://github.com/nextmv-io/community-apps/tree/develop/python-nextroute).
246
+ If you have [Nextmv CLI](https://www.nextmv.io/docs/platform/installation#nextmv-cli)
247
+ installed, you can create a new project with the following command:
248
+
249
+ ```bash
250
+ nextmv community clone -a python-nextroute
251
+ ```
252
+
253
+ ## Local benchmarking
254
+
255
+ To run the go benchmarks locally, you can use the following command:
256
+
257
+ ```bash
258
+ go test -benchmem -timeout 20m -run=^$ -count 10 -bench "^Benchmark" ./...
259
+ ```
260
+
261
+ In order to compare changes from a PR with the latest `develop` version, you can
262
+ use `benchstat`.
263
+
264
+ ```bash
265
+ # on the develop branch (or any other branch)
266
+ go test -benchmem -timeout 20m -run=^$ -count 10 -bench "^Benchmark" ./...\
267
+ | tee develop.txt
268
+ # on the new branch (or any other branch)
269
+ go test -benchmem -timeout 20m -run=^$ -count 10 -bench "^Benchmark" ./...\
270
+ | tee new.txt
271
+ # compare the two
272
+ benchstat develop.txt new.txt
273
+ ```
274
+
275
+ ## Versioning
276
+
277
+ We try our best to version our software thoughtfully and only break APIs and
278
+ behaviors when we have a good reason to.
279
+
280
+ * Minor (`v1.^.0`) tags: new features, might be breaking.
281
+ * Patch (`v1.0.^`) tags: bug fixes.
@@ -0,0 +1,26 @@
1
+ nextroute/__about__.py,sha256=-2DH_lsrTALT7QP4yB_ct2IyWF-R_bIKY3UcHuC82zs,65
2
+ nextroute/__init__.py,sha256=Ai-wDfMB-Yd8WsI42vjuQKlNOA7bYZpqTIArtXWfdPY,547
3
+ nextroute/base_model.py,sha256=dKv6OdyXcZm83NhDAS1eTKMDUyKJVUP6EKX8cDJDe_M,565
4
+ nextroute/options.py,sha256=Mlb_4oCj0yQcQRI9s3FRkQR5GP5TLIrU9uL65va3ZL8,8450
5
+ nextroute/solve.py,sha256=UWBKh1884aper0dAK--cDsbfNuuc8TJGE4tfhom9844,4337
6
+ nextroute/version.py,sha256=2vL_WuVQA76en7WJTbof4cJbHOTljpCA5nL7DGbgFvU,337
7
+ nextroute/bin/nextroute.exe,sha256=V1Df83JT93uz9b6F6caQhqNOdlosW4FjUV6GmZUbnto,14251008
8
+ nextroute/check/__init__.py,sha256=KCNtywi2e8jQeDyfEkg_Vo4Mu11lYC2CxwntC1JEZjY,1331
9
+ nextroute/check/schema.py,sha256=ue5Xb4gohz_DQSHWZ61i-IK6DRMppsVYKmilcsxcs9Q,5998
10
+ nextroute/schema/__init__.py,sha256=AHzMPxEel3udVhKzVRwV3642qLarZohfc31xhovofDw,1196
11
+ nextroute/schema/input.py,sha256=uUkDlwkPuIN_w_ScRFhNT0yxSzuxoWvdTgQR9RSzKYI,2943
12
+ nextroute/schema/location.py,sha256=n1ZQAc_FQo2-fL1JwKKQmgCSEFP0wkTE_w3_6QEmxOE,317
13
+ nextroute/schema/output.py,sha256=46nvLAw3QXSgYUCVE13_fGn5wHXpDpGZGuf7YxsLmmk,4950
14
+ nextroute/schema/statistics.py,sha256=ICbCa7V0X2bHGEj_yDMq6NV9euG1qOYOYNH-ZosEzto,3749
15
+ nextroute/schema/stop.py,sha256=LU4-i4cWaZVg_86bgVBRbX2CRPrW715BRy_I7eKw3cI,2264
16
+ nextroute/schema/vehicle.py,sha256=K_mAgM6p6Ef0HXcDC2g7AbvNPxxhnSbjduGsVV4Eazg,2607
17
+ tests/schema/__init__.py,sha256=UrdqXQHUHkSG7vHemeoeJtUm2_afa6-KFo0Fs2l9zG8,33
18
+ tests/schema/test_input.py,sha256=qYdr9d5WDoBFcTK1JKtY12akB_Z3L7HpxOD2dsCH38U,1910
19
+ tests/schema/test_output.py,sha256=L_zeFroI_0wpwsxvhfL69N-kmcYB2Gu9IktAmq4vQIY,11897
20
+ tests/solve_golden/__init__.py,sha256=UrdqXQHUHkSG7vHemeoeJtUm2_afa6-KFo0Fs2l9zG8,33
21
+ tests/solve_golden/main.py,sha256=Hh7IsGKnWOH3IQsI__H5diKNy-4rQ5PS7X40E_xG0B0,1788
22
+ nextroute-1.11.1.dev0.dist-info/LICENSE,sha256=4jrNU-0mMZDGEdwQi9vJ7w-Ep59Kqc7XcOLhDkQbCnM,4194
23
+ nextroute-1.11.1.dev0.dist-info/METADATA,sha256=0A62648LHbygHtYgQ_OZ4KPcXT_hKu_xPg1r4bmi9og,15876
24
+ nextroute-1.11.1.dev0.dist-info/WHEEL,sha256=agy-BJge3afXwWznUXANATmKFW4eqelqRR0uf608A_0,99
25
+ nextroute-1.11.1.dev0.dist-info/top_level.txt,sha256=KNsuo1j7tr-QvBFS_ELmo68OmJ-orEZiOXqstGLJDXA,16
26
+ nextroute-1.11.1.dev0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.8.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp39-cp39-win_amd64
5
+
@@ -0,0 +1,2 @@
1
+ nextroute
2
+ tests
@@ -0,0 +1 @@
1
+ # © 2019-present nextmv.io inc
@@ -0,0 +1,59 @@
1
+ # © 2019-present nextmv.io inc
2
+
3
+ import json
4
+ import os
5
+ import unittest
6
+
7
+ from nextroute.schema import Input, Stop, Vehicle
8
+
9
+
10
+ class TestInput(unittest.TestCase):
11
+ filepath = os.path.join(os.path.dirname(__file__), "input.json")
12
+
13
+ def test_from_json(self):
14
+ with open(self.filepath) as f:
15
+ json_data = json.load(f)
16
+
17
+ nextroute_input = Input.from_dict(json_data)
18
+ parsed = nextroute_input.to_dict()
19
+
20
+ for s, stop in enumerate(parsed["stops"]):
21
+ original_stop = json_data["stops"][s]
22
+ self.assertEqual(
23
+ stop,
24
+ original_stop,
25
+ f"stop: parsed({stop}) and original ({original_stop}) should be equal",
26
+ )
27
+
28
+ for v, vehicle in enumerate(parsed["vehicles"]):
29
+ original_vehicle = json_data["vehicles"][v]
30
+ self.assertEqual(
31
+ vehicle,
32
+ original_vehicle,
33
+ f"vehicle: parsed ({vehicle}) and original ({original_vehicle}) should be equal",
34
+ )
35
+
36
+ self.assertEqual(
37
+ parsed["defaults"],
38
+ json_data["defaults"],
39
+ f"defaults: parsed ({parsed['defaults']}) and original ({json_data['defaults']}) should be equal",
40
+ )
41
+
42
+ def test_from_dict(self):
43
+ with open(self.filepath) as f:
44
+ json_data = json.load(f)
45
+
46
+ nextroute_input = Input.from_dict(json_data)
47
+ stops = nextroute_input.stops
48
+ for stop in stops:
49
+ self.assertTrue(
50
+ isinstance(stop, Stop),
51
+ f"Stop ({stop}) should be of type Stop.",
52
+ )
53
+
54
+ vehicles = nextroute_input.vehicles
55
+ for vehicle in vehicles:
56
+ self.assertTrue(
57
+ isinstance(vehicle, Vehicle),
58
+ f"Vehicle ({vehicle}) should be of type Vehicle.",
59
+ )