
Optimizing Bipartite Matching in Real-World Applications by
Incremental Cost Computation
Tenindra Abeywickrama
∗
Grab-NUS AI Lab
tenindra.a@grab.com
Victor Liang
Grab-NUS AI Lab
victor.liang@grab.com
Kian-Lee Tan
School of Computing
National University of Singapore
tankl@comp.nus.edu.sg
ABSTRACT
The Kuhn-Munkres (KM) algorithm is a classical combinatorial op-
timization algorithm that is widely used for minimum cost bipartite
matching in many real-world applications, such as transportation.
For example, a ride-hailing service may use it to nd the optimal
assignment of drivers to passengers to minimize the overall wait
time. Typically, given two bipartite sets, this process involves com-
puting the edge costs between all bipartite pairs and nding an
optimal matching. However, existing works overlook the impact of
edge cost computation on the overall running time. In reality, edge
computation often signicantly outweighs the computation of the
optimal assignment itself, as in the case of assigning drivers to pas-
sengers which involves computation of expensive graph shortest
paths. Following on from this observation, we observe common
real-world settings exhibit a useful property that allows us to incre-
mentally compute edge costs only as required using an inexpensive
lower-bound heuristic. This technique signicantly reduces the
overall cost of assignment compared to the original KM algorithm,
as we demonstrate experimentally on multiple real-world data sets,
workloads, and problems. Moreover, our algorithm is not limited
to this domain and is potentially applicable in other settings where
lower-bounding heuristics are available.
PVLDB Reference Format:
Tenindra Abeywickrama, Victor Liang, and Kian-Lee Tan. Optimizing
Bipartite Matching in Real-World Applications by Incremental Cost
Computation. PVLDB, 14(7): 1150 - 1158, 2021.
doi:10.14778/3450980.3450983
1 INTRODUCTION
The Kuhn-Munkres (KM) algorithm [
14
,
16
], also known as the
Hungarian Method, is a combinatorial optimization algorithm that
is widely utilized to solve many real-world problems, particularly
in transportation. The KM algorithm solves the assignment problem,
also known as the minimum-weight bipartite matching problem,
which involves nding an optimal pair-wise assignment of a set
of agents to a set of jobs. Assigning an agent to a job is associated
with some cost, thus the goal is to nd an optimal assignment or
∗
This work was primarily conducted while the rst author was with the Grab-NUS AI
Lab in the Institute of Data Science at the National University of Singapore
This work is licensed under the Creative Commons BY-NC-ND 4.0 International
License. Visit https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of
this license. For any use beyond those covered by this license, obtain permission by
emailing info@vldb.org. Copyright is held by the owner/author(s). Publication rights
licensed to the VLDB Endowment.
Proceedings of the VLDB Endowment, Vol. 14, No. 7 ISSN 2150-8097.
doi:10.14778/3450980.3450983
matching of agent-job pairs, such that the overall cost is minimized
(or maximized depending on the problem and desired outcome).
Assignment tasks are of particular importance in transportation
problems, and the KM algorithm is widely used as a subroutine
in many existing works [
8
,
12
,
26
,
28
]. For example, it is used in
ride-hailing services to optimally match drivers to passengers for
maximum utilization of available vehicles. Other examples include
computing mail delivery routes using Route Inspection, where
minimum-weight bipartite matching is used to compute the min-
imum T-join [
4
] or the order picking problem solved by using
an approximate Traveling Salesman algorithm utilizing bipartite
matching. The KM algorithm takes the assignment costs as input,
hence these costs must be computed for each assignment task. How-
ever, we nd that existing works overlook the signicance of this
step. Moreover, all of the aforementioned examples involve com-
puting assignment costs based on computationally expensive graph
shortest paths. For example, the cost to assign a car to a passenger
is the wait time, which is commonly modeled by the travel time of
the shortest path in a road network graph. As we discuss next, cost
computation has signicant implications for algorithm eciency
with increasingly expensive assignment cost metrics.
1.1 Motivation
Let
𝑈
be a set of agents and
𝑉
be a set of jobs, both with size
𝑚 = |𝑈 | = |𝑉 |
, for which an optimal assignment is required. Also,
let
𝑐 (𝑢, 𝑣)
be the cost of assigning agent
𝑢 ∈ 𝑈
to job
𝑣 ∈ 𝑉
. Costs
𝑐 (𝑢, 𝑣)∀𝑢 ∈ 𝑈 , 𝑣 ∈ 𝑉
are often conceptualized as an
𝑚 × 𝑚
matrix.
To the best of our knowledge, all previous work utilizing KM to
solve transport problems like ride-hailing assumes this matrix is
provided to the KM algorithm or the cost of computing the ma-
trix is not a bottleneck. However, in many real-world applications,
computing the matrix is not only a non-trivial cost but also more
computationally expensive than the assignment itself. Moreover,
the matrix may need to be re-computed each time an assignment
is required. Given the real-time nature of transportation problems,
this may be quite frequent, which serves to only exacerbate the
non-trivial cost of computing
𝑐 (𝑢, 𝑣)
. For example, in a ride-hailing
service, a new assignment is required as new cars become available
and new passenger requests are received continuously in real-time.
According to Fortune
1
, popular ride-hailing services like Grab are
reported to process 6 million ride requests a day, highlighting the
scale of throughput required.
Our observation can be demonstrated using a simple ride-hailing
assignment framework. Let us represent the cost of assigning a
passenger (job) to a ride-hailing car (agent) as the travel-time of
1
https://fortune.com/longform/grab-gojek-super-apps/
1150
评论