Skip to main content

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

Project description

sdvrp-py

crates.io docs

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

Install

pip install sdvrp-py

If there are no precompiled wheels suitable for your platform, you need to install Rust before running pip install sdvrp-py.

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.1.tar.gz (10.7 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.1-cp39-abi3-win_amd64.whl (181.3 kB view details)

Uploaded CPython 3.9+Windows x86-64

sdvrp_py-0.1.1-cp39-abi3-win32.whl (162.2 kB view details)

Uploaded CPython 3.9+Windows x86

sdvrp_py-0.1.1-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.1-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.1-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.1-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.1-cp39-abi3-manylinux_2_28_x86_64.whl (354.6 kB view details)

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

sdvrp_py-0.1.1-cp39-abi3-manylinux_2_28_aarch64.whl (349.2 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

sdvrp_py-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (287.2 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

sdvrp_py-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (300.0 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for sdvrp_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2846bdc458fa03e1cacd58ac66d85c270d3f46756ac28dbccfa88e4acc40b093
MD5 279178bb99f0c52ea8d0ab147b00a620
BLAKE2b-256 99990ca4afb51328275e3016087e1c7ed09e203ca86a6a4c8772458c701ebe08

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sdvrp_py-0.1.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 181.3 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.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0c83b0f65af0d1cc168c3fe4d3d72c712518ca094c584f1802ddd766e1d4c21d
MD5 43d5b5e653483a400e73537f6cfdafa4
BLAKE2b-256 e1d42376bb6cb288a9979c8fcb505189084c03f45250cca2a812b61ff92e232a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sdvrp_py-0.1.1-cp39-abi3-win32.whl
  • Upload date:
  • Size: 162.2 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.1-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 c9e956b09df453c62594c2a6e402208acc58971642d50b1a40edc4bb8f8ee08a
MD5 1b1ce33883ecef8d785de63ec3c0ba65
BLAKE2b-256 2ce3e273633c9cfc7b63e74b7de892e39acf5591489f3b6d9b6e669931f07fe7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9510440939a1d3ca71d9954339d7b6901f38fa858f43b9a3c040a0ca62e4ff9b
MD5 2d9b80834398a96168f64c7d8d4b12b3
BLAKE2b-256 525d9f930c646b4b9131028c7c126c1342a5faf318ebc242fa80aa06a9bab260

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 131ab6ecdbefa9c131f5d3a14016249dd914dc68f01284c8bb7eca6168fd3732
MD5 aecdda9e5c4b14e69933f36e58bfaa7b
BLAKE2b-256 5798c668699535d63c03c4b767a3342e27aa4309ffbc2da65af1bf11154fc17f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 ffb8194b7d63eb065e5bfa54473c919a9e4a7bcd578ead989864ffd28eeecf6f
MD5 f3091beedf91ed490a34d74a62e967f4
BLAKE2b-256 b8dde5b823d2de915f1b0bea97ef5a31118689d68919168c0979abdf3ae1893d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 820e44408a413771aa0748e6ead7efe9b0695b0c71d8ff5e8c5af06bdf0bd4b4
MD5 3f195d8b9e649d470eb2d923810bc7a2
BLAKE2b-256 62dfe4855321047b302ce8ff1595576c47bfe229b795054178f2f97ccb232760

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c3e32d28c0656e3e66c5afe2fa652ac17cf64e44b95dbbe73435d19349748d96
MD5 9985a42c7362edfb12f49d4817b11216
BLAKE2b-256 42a3cc3d2ad1549780cd65a4bcd39ff190558119f269da68614cb02b41adbbb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e1982c492395392c6cee1282eba5dc5ef6476e2c6120efe23241a73419be31ea
MD5 ca7de26052f15f95e5fbfa8701318e79
BLAKE2b-256 86d174b50250ad51ce82ac010a83588f292de58ae8ae54b2d19435e2db9f3ef3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c805d4007721fed8793a4fbb1214c3b76e3e057c2b7f0dfe22d91205938f68ff
MD5 86465f333e468de5abf4ce3790ef1ad6
BLAKE2b-256 921a626cd657e56b3916f1ec27ca3d131c52d0247423d4f5eda6fbde97ca45d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for sdvrp_py-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ec00799ea3cbeee43c5bd1018cf93a3e3dfe243a8e3b0adcdae293b41999f571
MD5 48f64b81e055adb34b4990ae84145451
BLAKE2b-256 b12510482a607fc08fceb3b5e2c59f5bb5f4058851bac0ef09f6d7deaddccb99

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