Skip to content

Instantly share code, notes, and snippets.

@Mizux
Mizux / cvrptw.py
Last active October 26, 2023 07:07
CVRPTW for uni_r
#!/usr/bin/env python3
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
def create_data_model():
"""Stores the data for the problem."""
data = {}
data['time_matrix'] = [
[0, 6, 9, 8, 7, 3, 6, 2, 3, 2],
[6, 0, 8, 3, 2, 6, 8, 4, 8, 8],