Skip to main content

Add your description here

Project description

sdvrp-py

Python binding of Rust binding of Alkaid-SDVRP: An Efficient Open-Source Solver for the Vehicle Routing Problem with Split Deliveries.

Install

  1. Install Rust first.
  2. Install sdvrp-py.
    pip install git+https://github.com/HellOwhatAs/sdvrp-py.git
    

Example

import sdvrp_py
import matplotlib.pyplot as plt

# fmt: off
demands=[
    18, 26, 11, 30, 21, 19, 15, 16, 29, 26, 37, 16, 12, 31, 8, 19, 20,
    13, 15, 22, 28, 12, 6, 27, 14, 18, 17, 29, 13, 22, 25, 28, 27, 19,
    10, 12, 14, 24, 16, 33, 15, 11, 18, 17, 21, 27, 19, 20, 5, 22, 12,
    19, 22, 16, 7, 26, 14, 21, 24, 13, 15, 18, 11, 28, 9, 37, 30, 10,
    8, 11, 3, 1, 6, 10, 20
]
coord_list=[
    (40, 40), (22, 22), (36, 26), (21, 45), (45, 35), (55, 20), (33, 34),
    (50, 50), (55, 45), (26, 59), (40, 66), (55, 65), (35, 51), (62, 35),
    (62, 57), (62, 24), (21, 36), (33, 44), (9, 56), (62, 48), (66, 14),
    (44, 13), (26, 13), (11, 28), (7, 43), (17, 64), (41, 46), (55, 34),
    (35, 16), (52, 26), (43, 26), (31, 76), (22, 53), (26, 29), (50, 40),
    (55, 50), (54, 10), (60, 15), (47, 66), (30, 60), (30, 50), (12, 17),
    (15, 14), (16, 19), (21, 48), (50, 30), (51, 42), (50, 15), (48, 21),
    (12, 38), (15, 56), (29, 39), (54, 38), (55, 57), (67, 41), (10, 70),
    (6, 25), (65, 27), (40, 60), (70, 64), (64, 4), (36, 6), (30, 20),
    (20, 30), (15, 5), (50, 70), (57, 72), (45, 42), (38, 33), (50, 4),
    (66, 8), (59, 5), (35, 60), (27, 24), (40, 20), (40, 37)
]
# fmt: on

result = sdvrp_py.solve_sdvrp(
    capacity=140,
    demands=demands,
    coord_list=coord_list,
    time_limit=10.0,
)

print(result)

plt.scatter(
    [coord[0] for coord in coord_list],
    [coord[1] for coord in coord_list],
    c="blue",
    label="Customers",
)
for route in result:
    route = [(0, 0), *route, (0, 0)]
    x = [coord_list[i][0] for i, _ in route]
    y = [coord_list[i][1] for i, _ in route]
    plt.plot(x, y, marker=None)

plt.show()

Output: (node, load)

[
    [(17, 4), (3, 11), (44, 17), (50, 22), (18, 13), (55, 7), (25, 14), (31, 25), (10, 26), (72, 1)],
    [(26, 11), (58, 21), (38, 24), (65, 9), (66, 37), (11, 37)],
    [(6, 12), (73, 6), (1, 18), (43, 18), (41, 15), (42, 11), (64, 28), (22, 12), (62, 18), (2, 2), (68, 0)],
    [(30, 22), (74, 10), (21, 28), (61, 15), (28, 29), (2, 24), (68, 10)], 
    [(45, 21), (5, 21), (15, 8), (57, 14), (54, 16), (13, 12), (27, 17), (52, 19), (34, 0), (67, 1)],
    [(17, 16), (40, 33), (32, 28), (9, 29), (39, 16), (12, 16)],
    [(51, 12), (16, 19), (49, 5), (24, 27), (56, 26), (23, 6), (63, 11), (33, 27), (6, 7)],
    [(67, 29), (46, 27), (34, 19), (4, 25), (75, 20)],
    [(4, 5), (29, 13), (37, 14), (20, 22), (70, 11), (60, 13), (71, 3), (69, 8), (36, 12), (47, 19), (48, 20)],
    [(26, 7), (7, 15), (35, 10), (53, 22), (14, 31), (59, 24), (19, 15), (8, 16), (67, 0)]
]

sdvrp

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdvrp_py-0.1.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sdvrp_py-0.1.0-cp39-abi3-win_amd64.whl (181.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

sdvrp_py-0.1.0-cp39-abi3-win32.whl (162.0 kB view details)

Uploaded CPython 3.9+Windows x86

sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_i686.whl (6.6 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ i686

sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_armv7l.whl (6.5 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARMv7l

sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl (6.4 MB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

sdvrp_py-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl (354.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

sdvrp_py-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl (349.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

sdvrp_py-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (348.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

sdvrp_py-0.1.0-cp39-abi3-macosx_11_0_arm64.whl (287.1 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

sdvrp_py-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl (299.8 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file sdvrp_py-0.1.0.tar.gz.

File metadata

  • Download URL: sdvrp_py-0.1.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for sdvrp_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a162b1f3d79776a16b155a400c912c2775d9febf3ba4fc839efdc313d1eb339e
MD5 2994844ccf7a61bb3227a7fad24ac2d7
BLAKE2b-256 73e6dcc09964920bd5d2858dcb7eea290ac205914942be7605ae6db21e21a573

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: sdvrp_py-0.1.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 181.1 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 fe28836d9c523026b0de30683871ed467bddb64ef7da023fd8912a6d1af1100e
MD5 3cce59474a26f3d4b7dcc56e7ef2cbe4
BLAKE2b-256 0d0ae8c2f56a69a4615bb9410e092c741645d1af796a18ea16114d8684e49a39

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-win32.whl.

File metadata

  • Download URL: sdvrp_py-0.1.0-cp39-abi3-win32.whl
  • Upload date:
  • Size: 162.0 kB
  • Tags: CPython 3.9+, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.9.3

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 fce0e0817d7a03c803512919e4c52bb7272b432d5eb06f4c8541f19dc63f8558
MD5 7c493801f56923cc5f25fe3f4cf00188
BLAKE2b-256 eadba9d577d13875987cd8ce065f8e8a7a1ddd6910fbfc66e4f988ecd1ed029b

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 baab89b279a9db20944c0f84445ca8bdc6d149358c29462e20baaed0c24670e2
MD5 8bfac808a75fe657abd092c383c480d6
BLAKE2b-256 28a097e4ef07b94a4da305eac66ce59429b9ca29d0c83be8f08c011b546bdb7e

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 fbc8d15a0fe6acca4681a11a7dfd60009f57fd832fe981c354aa673d72ceee98
MD5 f74fe5835fd4f0d0b7d6a1d02d836730
BLAKE2b-256 2d7422fcc5b37109c10e3938fc0ef7d07149472587291bb161c01d0aaf45373b

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 562b8474ee06fbdd7c094d1b182498299ea0f8260f4fc3cec2ce91c4875b3a84
MD5 02a273279ba114e5245a6a7c0adfa9ec
BLAKE2b-256 41b3659837920a80119d30973f8780eb7c4573d16af50d68aa263d4f682e3ef2

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8b1be153bf4ed3f71ddc7e4610e16f0c1435a1b9f11f19f2dc851b5a2c939162
MD5 15702be23016fe8e5540666602fb1346
BLAKE2b-256 2ce1a0a0e309fac13febe1d940f79508556ccf4431009f0706a0097a7c7e8d11

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 43eb30c518a6193d11562242bd9a55550075db3c4a50c77f073f1f6321200fb9
MD5 228cf76828d1018f84e233985b0ac1f5
BLAKE2b-256 3b5bbd1ef41d1bab876dc9c34647252f198a4c50e7fa8e7b7621ff2f6f66dcbf

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ca1616950000c818869c6dd8f46185c836ce89223568de986eb882faeb5b33f8
MD5 bf6a7751d6295bdcea7cb9cd007a0a96
BLAKE2b-256 9a43611d4e22de513083bc2522afeba8aabb0475927d984ba15c154c5f704b71

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8c587f3184d9c4af79764c374ef3b731c213caf68275c99ce9872934978d5991
MD5 956f69591137f0b0041381febfdbe6ff
BLAKE2b-256 e009cd8355b6bfcaf5c44ba52d44f3bdfd666454c806db53f8103bfd73929e7c

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4bfdd51a059e8b4b68c7ebd2a0d5159b0d2272a5543961ab25811e5886028c5a
MD5 d44c5a5539a7b10556bfc9f04791ab59
BLAKE2b-256 d0e837429127a89c6f38ba924ea38336f5c132cdd8986a9fd0ef0d00d311ecb5

See more details on using hashes here.

File details

Details for the file sdvrp_py-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sdvrp_py-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 37c24affa15f51c4ec028fa0ad58c9cf62d8a7a8808413ce1658edc7e07ba2af
MD5 ad51764cda2804d7e140acbbf207f0a9
BLAKE2b-256 6f1e001dfcee53052d2c9a1deb9acbcec2bf0581e9b4e17019489361c68833fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page