# Alex Assignment

## Title: A Note on Learning Algorithms for Quadratic Assignment with Graph Neural Networks

Authors:Alex Nowak, Soledad Villar, Afonso S. Bandeira, Joan Bruna

(Submitted on 22 Jun 2017)

Abstract: Many inverse problems are formulated as optimization problems over certain appropriate input distributions. Recently, there has been a growing interest in understanding the computational hardness of these optimization problems, not only in the worst case, but in an average-complexity sense under this same input distribution.

In this note, we are interested in studying another aspect of hardness, related to the ability to learn how to solve a problem by simply observing a collection of previously solved instances. These are used to supervise the training of an appropriate predictive model that parametrizes a broad class of algorithms, with the hope that the resulting "algorithm" will provide good accuracy-complexity tradeoffs in the average sense.

We illustrate this setup on the Quadratic Assignment Problem, a fundamental problem in Network Science. We observe that data-driven models based on Graph Neural Networks offer intriguingly good performance, even in regimes where standard relaxation based techniques appear to suffer.

## Submission history

From: Soledad Villar [view email]**[v1]**Thu, 22 Jun 2017 18:18:58 GMT (407kb,D)

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)

## Significance

Ride-sharing services can provide not only a very personalized mobility experience but also ensure efficiency and sustainability via large-scale ride pooling. Large-scale ride-sharing requires mathematical models and algorithms that can match large groups of riders to a fleet of shared vehicles in real time, a task not fully addressed by current solutions. We present a highly scalable anytime optimal algorithm and experimentally validate its performance using New York City taxi data and a shared vehicle fleet with passenger capacities of up to ten. Our results show that 2,000 vehicles (15% of the taxi fleet) of capacity 10 or 3,000 of capacity 4 can serve 98% of the demand within a mean waiting time of 2.8 min and mean trip delay of 3.5 min.

## Abstract

Ride-sharing services are transforming urban mobility by providing timely and convenient transportation to anybody, anywhere, and anytime. These services present enormous potential for positive societal impacts with respect to pollution, energy consumption, congestion, etc. Current mathematical models, however, do not fully address the potential of ride-sharing. Recently, a large-scale study highlighted some of the benefits of car pooling but was limited to static routes with two riders per vehicle (optimally) or three (with heuristics). We present a more general mathematical model for real-time high-capacity ride-sharing that (*i*) scales to large numbers of passengers and trips and (*ii*) dynamically generates optimal routes with respect to online demand and vehicle locations. The algorithm starts from a greedy assignment and improves it through a constrained optimization, quickly returning solutions of good quality and converging to the optimal assignment over time. We quantify experimentally the tradeoff between fleet size, capacity, waiting time, travel delay, and operational costs for low- to medium-capacity vehicles, such as taxis and van shuttles. The algorithm is validated with ∼3 million rides extracted from the New York City taxicab public dataset. Our experimental study considers ride-sharing with rider capacity of up to 10 simultaneous passengers per vehicle. The algorithm applies to fleets of autonomous vehicles and also incorporates rebalancing of idling vehicles to areas of high demand. This framework is general and can be used for many real-time multivehicle, multitask assignment problems.

New user-centric services are transforming urban mobility by providing timely and convenient transportation to anybody, anywhere, and anytime. These services have the potential for a tremendous positive impact on personal mobility, pollution, congestion, energy consumption, and thereby quality of life. The cost of congestion in the United States alone is roughly $121 billion per year or 1% of GDP (1), which includes 5.5 billion hours of time lost to sitting in traffic and an extra 2.9 billion gallons of fuel burned. These estimates do not even consider the cost of other potential negative externalities such as the vehicular emissions (greenhouse gas emissions and particulate matter) (2), travel-time uncertainty (3), and a higher propensity for accidents (4). Recently, the large-scale adoption of smart phones and the decrease in cellular communication costs has led to the emergence of a new mode of urban mobility, namely mobility-on-demand (MoD) systems, led by companies such as Uber, Lyft, and Via. These systems are able to provide users with a reliable mode of transportation that is catered to the individual and improves access to mobility to those who are unable to operate a personal vehicle, reducing the waiting times and stress associated with travel.

One of the major inefficiencies of current MoD systems is their capacity limitation, typically restricted to two passengers. Our method applies not only to shared taxis but also to shared vans and minibuses. A recent study in New York City showed that up to 80% of the taxi trips in Manhattan could be shared by two riders, with an increase in the travel time of a few minutes (5). However, the method and analysis of ref. 5 was (*i*) limited to two riders for an optimal allocation (three with heuristics), (*ii*) intractable for larger number of passengers, and (*iii*) did not allow for allocation of additional riders after the start of a trip. There are no studies of this scale that quantify the benefits of larger-scale ride pooling, mainly due to the lack of efficient and scalable algorithms for this problem, both of which we address in this work.

Much of the fleet management literature for MoD systems considers the case of ride-sharing without pooling requests, focusing on fluid approximations (6), queuing based formulations (7), case studies in specific regions [e.g., Singapore (8)], and operational considerations for fleet managers (9). With the growing interest and rapid developments in autonomous vehicles, there is also an increasing focus on autonomous MoD systems (6, 9, 10). However, none of these works considered the ride-pooling problem of servicing multiple rides with a single trip. The ride-pooling problem is more related to the vehicle-routing problem and the dynamic pickup and delivery problem (11⇓⇓⇓–15), where spatiotemporally distributed demand must be picked up and delivered within prespecified time windows. A major challenge when addressing this problem is the need to explore a very large decision space, while computing solutions fast enough to provide users with the experience of real-time booking and service.

Here, we consider the problem of using a fleet of vehicles with varying passenger capacities, and, in contrast to ref. 5, we address both the problems of assigning vehicles to matched passengers and rebalancing—or repositioning—the fleet to service demand. We show how the unified problem of passenger and vehicle assignment can be solved in a computationally efficient manner at a large scale, thereby demonstrating the capability to operate a real-time MoD system with multiple service tiers (shared-taxi, shared-vans, and shared-buses) of varying capacity.

Whereas previous approaches to this problem have focused on heuristic-based solutions (16⇓–18), we present a reactive anytime optimal algorithm. That is, an algorithm that efficiently returns a valid assignment of travel requests to vehicles and then refines it over time, converging to an optimal solution. If enough computational resources are available, the optimal assignment for the current requests and time would be found; otherwise, the best solution found so far is returned.

Traditional approaches that rely on an integer linear program (ILP) formulation, such as ref. 19, also provide anytime guarantees for the multivehicle-routing problem. However, in contrast to our approach, their applicability is limited to small problem instances, which in ref. 19 was 32 requests and 4 vehicles, with a computation cost of several minutes. We also rely on an ILP formulation, but because we do not explicitly model the edges of the road network in the ILP, our approach scales to much larger problem instances. We observe that instances such as New York City, with thousands of vehicles, requests, and road segments, can be solved in real time.

Our approach decouples the problem by first computing feasible trips from a pairwise shareability graph (5) and then assigning trips to vehicles. We show that this assignment can be posed as an ILP of reduced dimensionality. The framework allows for flexibility in terms of prescribing constraints such as (but not limited to) maximum user waiting times and maximum additional delays due to sharing a ride. We also extend the method to proactively rebalance the vehicle fleet by moving idle vehicles to areas of high demand. In summary, we present a framework for solving the real-time ride-pooling problem with (*i*) arbitrary numbers of passengers and trips, (*ii*) anytime optimal rider allocation and routing dependent on the fleet location, and (*iii*) online rerouting and assignment of riders to existing trips.

We quantify experimentally the performance tradeoffs between fleet size, capacity, waiting time, travel delay, and operational costs for low- and medium-capacity vehicles (such as taxis, vans, or minibuses) in a large urban setting. Detailed experimental results are presented for a subset of ∼3 million rides extracted from the New York City taxicab public dataset. We show that 3,000 vehicles with a capacity of 2 and 4 could serve 94 and 98% of the demand with a mean waiting time of 3.2 and 2.7 min, and a mean delay of 1.5 and 2.3 min, respectively. To achieve 98% service rate, with comparable waiting time (2.8 min) and delay (3.5 min), a fleet of just 2,000 vehicles with a capacity of 10 was required. This fleet size is 15% of the active taxis in New York City (Movie S1). We also show that our approach is robust with respect to the density of requests and could therefore be applied to other cities.

Our system runs in real time and is particularly suited to autonomous vehicle fleets that can continuously reroute based on real-time requests. It can also rebalance idle vehicles to areas with high demand and is general enough to be applied to other multivehicle, multitask assignment problems.

## Passenger Assignment and Vehicle Routing

We consider a fleet of vehicles of capacity , the maximum number of passengers each vehicle can have at any given time. We address the problems of both optimally assigning online travel requests to vehicles and finding optimal routes for the vehicle fleet. Each travel request consists of the time of request, a pickup location and a drop-off location.

We propose an anytime optimal algorithm for batch assignment of a set of requests to a set of vehicles , which minimizes a cost function , satisfies a set of constraints , and allows for multiple passengers per vehicle. A passenger is a past request that has been picked up by a vehicle and that is now en route to its destination. We denote by the set of passengers for vehicle . In a second step, the method also allows to rebalance the fleet of vehicles by driving idle vehicles to areas of high demand, where those vehicles are likely to be required in the future. A schema of the method is shown in Fig. 1.

Schematic overview of the proposed method for batch assignment of multiple requests to multiple vehicles of capacity . The method consists of several steps leading to an integer linear optimization that provides an anytime optimal assignment. (*A*) Example of a street network with four requests (orange human, origin; red triangle, destination) and two vehicles (yellow car, origin; red triangle, destination of passenger). Vehicle 1 has one passenger, and vehicle 2 is empty. (*B*) Pairwise shareability RV-graph of requests and vehicles. Cliques of this graph are potential trips. (*C*) RTV-graph of candidate trips and vehicles which can execute them. A node (yellow triangle) is added for requests that cannot be satisfied. (*D*) Optimal assignment given by the solution of the ILP, where vehicle 1 serves requests 2 and 3 and vehicle 2 serves requests 1 and 4. (*E*) Planned route for the two vehicles and their assigned requests. In this case, no rebalancing step is required because all requests and vehicles are assigned.

Our formulation is flexible with respect to physical and performance-related constraints that might need to be added. In our implementation, we consider the following. (*i*) For each request , the waiting time , given by the difference between the pickup time and the request time , must be below a maximum waiting time , for example, 2 min. (*ii*) For each passenger or request the total travel delay must be lower than a maximum travel delay , for example, 4 min, where is the drop-off time and is the earliest possible time at which the destination could be reached if the shortest path between the origin and the destination was followed without any waiting time. The total travel delay includes both the in-vehicle delay and the waiting time. Finally, (*iii*) for each vehicle , we consider a maximum number of passengers, , for example, capacity 10.

We define the cost of an assignment as the sum of delays (which includes the waiting time) over all assigned requests and passengers, plus a large constant for each unassigned request. Given an assignment of requests to vehicles, we denote by the set of requests that have been assigned to some vehicle and the set of unassigned requests, due to the constraints or the fleet size. Formally,[1]

This constrained optimization problem is solved via four steps (Fig. 1), which are: computing a pairwise request-vehicle shareability graph (RV-graph) (Fig. 1*B*); computing a graph of feasible trips and the vehicles that can serve them (RTV-graph) (Fig. 1*C*); solving an ILP to compute the best assignment of vehicles to trips (Fig. 1*D*); and rebalancing the remaining idle vehicles (Fig. 1*E*).

Given a network graph with travel times, we consider a function for single-vehicle routing. For a vehicle , with passengers , this function returns the optimal travel route to satisfy requests . This route minimizes the sum of delays subject to the constraints (waiting time, delay, and capacity). For low-capacity vehicles, such as taxis, the optimal path can be computed via an exhaustive search. For vehicles with larger capacity, heuristic methods such as Lin–Kernighan (20), Tabu search (21), or simulated annealing (22) may be used. Fig. 2, *Right* shows the optimal route for a vehicle with four passengers and an additional request.

(*A*) Snapshot: 2,000 vehicles, capacity of 4 ( min, Wednesday, 2000 hours). Vehicle in the fleet are represented at their current positions. Colors indicate number of passengers (0: light blue; 1: light green; 2: yellow; 3: dark orange; 4: dark red); 39 rebalancing vehicles are displayed in dark blue—mostly in the upper Manhattan returning to the middle. (*B*) Close view of the scheduled path for a vehicle (dark red circle) with four passengers, which drops one off, picks up a new one (blue star), and drops all four. Drop-off locations are displayed with inverted triangles. See Movie S1 for a complete simulation.

The RV-graph (Fig. 1*B*) represents which requests and vehicles might be pairwise-shared and builds on the idea of shareability graphs proposed by ref. 5 but also includes the vehicles at their current state. Two requests and are connected if an empty virtual vehicle starting at the origin of one of them could pick up and drop off both requests while satisfying the constraints . A cost is associated to each edge . Likewise, a request and a vehicle are connected if the request can be served by the vehicle while satisfying the constraints , as given by . The edge is denoted by .

Next, the cliques of the RV-graph—or regions for which its induced subgraph is complete—are explored to find feasible trips and compute the RTV-graph (Fig. 1*C*). A trip is a set of requests to be combined in one vehicle. A trip is feasible if all of the requests can be picked up and dropped off by some vehicle, while satisfying the constraints .

This step computes feasible trips. There might be several trips of varying size that can service a particular request. In addition, more than one vehicle might be able to service a trip. The assignment step will later ensure that each request and vehicle are assigned to a maximum of one trip. The RTV-graph contains two types of edges: (*i*) edges , between a request and a trip that contains request (i.e., ), and (*ii*) edges , between a trip and a vehicle that can execute the trip (i.e., is feasible). The cost , sum of delays, is associated to each edge *e*(*T*,*v*).

The algorithm to compute the feasible trips and edges proceeds incrementally in trip size for each vehicle, starting from the request-vehicle edges in the RV-graph (*SI Appendix*, Algorithm 1). For computational efficiency, we rely on the fact that a trip only needs to be checked for feasibility if there exists a vehicle for which all of its subtrips (obtained by removing one request) are feasible and have been added as edges to the RTV-graph.

Next, we compute the optimal assignment of vehicles to trips. This optimization is formalized as an ILP, initialized with a greedy assignment obtained directly from the RTV-graph. To compute the greedy assignment , trips are assigned to vehicles iteratively in decreasing size of the trip and increasing cost (sum of travel delays). The idea is the maximize the amount of requests served while minimizing the cost (*SI Appendix*, Algorithm 2).

The optimization problem is formulated in Algorithm 1. A binary variable is introduced for each edge between a trip and a vehicle in the RTV-graph. If , then vehicle is assigned to trip . We denote by the set of indices for which an edge exists in the RTV-graph, i.e., the set of possible pickup trips. An additional binary variable is introduced for each request . These variables are active, i.e., , if the associated request can not be served by any vehicle and is ignored. The set of variables is then

The cost terms are the sum of delays for trip and vehicle pickup (stored in the edge of the RTV-graph) and is a large constant to penalize ignored requests.

Two types of constraints are included. Line 3 in Algorithm 1 imposes that each vehicle is assigned to one trip at most. Line 4 in Algorithm 1 imposes that each request is assigned to a single vehicle or ignored. In these constraints, three sets appear. The set of trips that can be serviced by a vehicle , or edges , is . The set of trips that contain request , or edges , is . The set of vehicles that can service trip , or edges