Skip to content

Prefered driver penalty #4631

Apr 23, 2025 · 1 comments · 11 replies
Discussion options

You must be logged in to vote

(based on vrp_capacity.py....)

vrp_capacity_with_prefered_vehicle.py:

#!/usr/bin/env python3
# [START program]
"""Capacited Vehicles Routing Problem (CVRP) With Prefered Vehicles."""

# [START import]
from functools import partial
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp

# [END import]


# [START data_model]
def create_data_model():
    """Stores the data for the problem."""
    data = {}
    data["distance_matrix"] = [
        # fmt: off
      [0, 548, 776, 696, 582, 274, 502, 194, 308, 194, 536, 502, 388, 354, 468, 776, 662],
      [548, 0, 684, 308, 194, 502, 730, 354, 696, 742, 1084, 594, 480, 674, 1016, 868, 1210],
      [7…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@Isaksjoberg
Comment options

@Mizux
Comment options

@Mizux
Comment options

@Mizux
Comment options

Answer selected by Isaksjoberg
@Mizux
Comment options

@Isaksjoberg
Comment options

@Mizux
Comment options

@Isaksjoberg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants