diff --git a/examples/python/prize_collecting_tsp.py b/examples/python/prize_collecting_tsp.py index eb6dee6dd3..fa91031e81 100755 --- a/examples/python/prize_collecting_tsp.py +++ b/examples/python/prize_collecting_tsp.py @@ -14,7 +14,7 @@ """Simple prize collecting TSP problem with a max distance.""" from ortools.routing import enums_pb2 -from ortools.constraint_solver import pywrapcp +from ortools.routing import pywraprouting DISTANCE_MATRIX = [ [0, 10938, 4542, 2835, 29441, 2171, 1611, 9208, 9528, 11111, 16120, 22606, 22127, 20627, 21246, 23387, 16697, 33609, 26184, 24772, 22644, 20655, 30492, 23296, 32979, 18141, 19248, 17129, 17192, 15645, 12658, 11210, 12094, 13175, 18162, 4968, 12308, 10084, 13026, 15056], @@ -106,13 +106,13 @@ def main(): all_nodes = range(num_nodes) # Create the routing index manager. - manager = pywrapcp.RoutingIndexManager( + manager = pywraprouting.RoutingIndexManager( num_nodes, num_vehicles, depot) # Create routing model. - routing = pywrapcp.RoutingModel(manager) + routing = pywraprouting.RoutingModel(manager) # Create and register a transit callback. def distance_callback(from_index, to_index): @@ -145,7 +145,7 @@ def main(): VISIT_VALUES[node]) # Setting first solution heuristic. - search_parameters = pywrapcp.DefaultRoutingSearchParameters() + search_parameters = pywraprouting.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC) search_parameters.local_search_metaheuristic = ( diff --git a/examples/python/prize_collecting_vrp.py b/examples/python/prize_collecting_vrp.py index 58faaef4c1..679167708c 100755 --- a/examples/python/prize_collecting_vrp.py +++ b/examples/python/prize_collecting_vrp.py @@ -14,7 +14,7 @@ """Simple prize collecting VRP problem with a max distance.""" from ortools.routing import enums_pb2 -from ortools.constraint_solver import pywrapcp +from ortools.routing import pywraprouting DISTANCE_MATRIX = [ [0, 10938, 4542, 2835, 29441, 2171, 1611, 9208, 9528, 11111, 16120, 22606, 22127, 20627, 21246, 23387, 16697, 33609, 26184, 24772, 22644, 20655, 30492, 23296, 32979, 18141, 19248, 17129, 17192, 15645, 12658, 11210, 12094, 13175, 18162, 4968, 12308, 10084, 13026, 15056], @@ -112,13 +112,13 @@ def main(): all_nodes = range(num_nodes) # Create the routing index manager. - manager = pywrapcp.RoutingIndexManager( + manager = pywraprouting.RoutingIndexManager( num_nodes, num_vehicles, depot) # Create routing model. - routing = pywrapcp.RoutingModel(manager) + routing = pywraprouting.RoutingModel(manager) # Create and register a transit callback. def distance_callback(from_index, to_index): @@ -151,7 +151,7 @@ def main(): VISIT_VALUES[node]) # Setting first solution heuristic. - search_parameters = pywrapcp.DefaultRoutingSearchParameters() + search_parameters = pywraprouting.DefaultRoutingSearchParameters() search_parameters.first_solution_strategy = ( enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC) search_parameters.local_search_metaheuristic = ( diff --git a/examples/python/random_tsp.py b/examples/python/random_tsp.py index 8bd0a388f7..53d5e6be66 100755 --- a/examples/python/random_tsp.py +++ b/examples/python/random_tsp.py @@ -27,7 +27,7 @@ from functools import partial import random from ortools.routing import enums_pb2 -from ortools.constraint_solver import pywrapcp +from ortools.routing import pywraprouting parser = argparse.ArgumentParser() @@ -91,9 +91,9 @@ def main(args): # Second argument = 1 to build a single tour (it's a TSP). # Nodes are indexed from 0 to args_tsp_size - 1, by default the start of # the route is node 0. - manager = pywrapcp.RoutingIndexManager(args.tsp_size, 1, 0) - routing = pywrapcp.RoutingModel(manager) - search_parameters = pywrapcp.DefaultRoutingSearchParameters() + manager = pywraprouting.RoutingIndexManager(args.tsp_size, 1, 0) + routing = pywraprouting.RoutingModel(manager) + search_parameters = pywraprouting.DefaultRoutingSearchParameters() # Setting first solution heuristic (cheapest addition). search_parameters.first_solution_strategy = ( enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC) diff --git a/examples/tests/issue117.py b/examples/tests/issue117.py index 68ec9d59a4..c4885c4a27 100755 --- a/examples/tests/issue117.py +++ b/examples/tests/issue117.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 from collections import namedtuple -from ortools.constraint_solver import pywrapcp +from ortools.routing import pywraprouting VEHICLE_COUNT = 30 VEHICLE_CAPACITY = 200 @@ -14,8 +14,8 @@ customers.append(Customer(1, 1, 1.0, 1.0)) customers.append(Customer(1, 1, 2.0, 2.0)) customer_count = len(customers) -manager = pywrapcp.RoutingIndexManager(3, VEHICLE_COUNT, 0) -routing = pywrapcp.RoutingModel(manager) +manager = pywraprouting.RoutingIndexManager(3, VEHICLE_COUNT, 0) +routing = pywraprouting.RoutingModel(manager) print('Demand Constraint') demands = []