Bertossi 1987
Bertossi 1987
Bertossi 1987
Two bipatite matching problems arising in Vehicle Scheduling are considered: the capa-
citated matching and the multicommodity matching. For the former, given a reasonable
cost structure, we can exhibit a polynomial time algorithm, while the general case is
conjectured to be NP-hard. The latter problem is shown to be NP-hard. A heuristic
algorithm based on Lagrangean relaxation for the capacitated version of the multicom-
modity matching is also presented together with experimental results.
This work has been supported by the “Progetto Finalizzato Trasporti” of the Italian
National Research Council.
[
a, = the cost of the deadheading trip from the ending terminal of u,
to the depot, for the minimum operational cost case;
b, =
2. CAPACITATED MATCHING
Let us restate the capacitated matching problem as follows:
min{cx: x E X,xij E {O,l}, V i,j}, (2.1)
where c is the cost vector, x is a vector of binary variables with xij = 1 if arc
(i,j) belongs to the matching M,xij = 0 otherwise, and X is the set defined by
the following constraints:
Now we show that with our assumptions, that is costs satisfying inequalities
(1.1) and (1.2), the capacitated matching problem is easy.
Introduce the network (“,Ao) having 2n + 2 nodes, lAll + 2n + 1 = e arcs
and a cost vector 8, where:
NO = {s} U S U T U {t}, Ao = Al U {(i,t):i E S } U {(s,j):
j E u {(t,~)},
c”,=cijV(i,j)EAl, d=aiViES, c$‘,=bjVjET, &=O.
All the arcs in Aohave unit capacity, except arc (6s) whose capacity is k. The
nodes in S are sources, each with unit input, the nodes in Tare sinks, each with
unit demand, and s and t are transshipment nodes. Let F denote the set of all
feasible flows in the network (No,Ao).By construction, each flow in F has value
equal to n . If P(f) is the cost of a flow f , then problem (2.1) is equivalent to:
min{c?(f): f E F}. (2.3)
Since the network (No,Ao)has integer capacities and nonnegative costs, a
minimum cost flow that solves (2.3) can be found in O(en log2+clnn)time [7].
Therefore also problem (2.1) can be solved with the same computational effort.
It is plain that the equivalence between (2.1) and (2.3) holds true even if A l
274 BERTOSSI, CARRARESI, AND GALL0
3. MULTICOMMODITY MATCHING
Let us consider the complete bipartite graph of Section 1, ( S , T,A), where A
is partitioned into the two disjoint sets A , and A Z ;assume further that m cost
functions CW A + 3,h = 1, . . . ,m, be given.
MATCHING PROBLEMS IN VEHICLE SCHEDULING 275
C(C )
I 5 a!")
= a!")
+ b r ) , ( i , j ) E Al,
+ b,"'),( i , j ) E A2,
where a!") is the cost of the deadheading trip from the ending terminal of trip
(3.1)
uito the h th depot, while by) is the cost of the deadheading trip from the h th
depot to the starting terminal of trip up
In vehicle scheduling applications it is of interest the Capacitated Multicom-
modity Matching (CMM) which is obtained from MM by addition of the follow-
ing constraints
IMh fl A21 5 kh, h = I, . . . ,m,
where k h is the capacity of the hth depot.
Now we show that the multicommodity matching problem is NP-hard, even
in the case in which assumptions (3.1) hold, and that it remains NP-hard also
if m = 2. As usual the proof is given for the decision version of the problem,
that is the problem in which one asks for a solution having cost not larger than
a given real value L.
The proof proceeds by means of a reduction from the One-in-Three Satisfi-
ability problem with un-negated variables, which is known to be NP-complete
(Garey and Johnson [4, 2591):
Given a set U of Boolean variables and a collection C of clauses over U such
that each C E C has only un-negated variables and IC(= 3, is there truth
assignment for LI such that each clause C in C has exactly one true variable?
Proof. Let C,,C2,. . . ,C, and u l , u2,. . . ' uP be the clauses and the variables
respectively for the above mentioned satisfiabllity problem. We construct an
instance of the 2-commodity matching problem as follows.
For each variable ui define the subgraph shown in Fig. 3.1, where o ( i ) is the
number of occurrences of ui in the clauses.
276 BERTOSSI, CARRARESI, AND GALL0
FIG. 3.1
All the arcs drawn in the basic subgraph belong to Al. For both the two
commodities, we set equal to 1 the cost of all the arcs in the subgraph but arc
( W ; , W ~ + whose
~) +
cost is o ( i ) 1. In the bipartite graph (S, T,A)all the subgraphs
are connected in series, since the “lowest nodes” of subgraph i coincide with
the “highest nodes” of subgraph i + 1.
In addition there are p nodes u1,u2, . . . ,up in S and p nodes u1,u2, . , . ,up in
T, corresponding to the clauses in C.For the jth occurrence of uithe arc (ii,u,),
where C, is the clause in which it occurs, belongs to Al, and, €or both the
commodities, has cost equal to 3p + q. All the remaining arcs belong to A2
(remember that we assume the graph to be complete).
Note that no sequence of arcs (yo,yl), (yl,y2), . . . ,(ym-1yYm), (ym,Yo) can
belong to A l for any m 2 0, thus A l represents a compatible set of trips.
The vectors 0 ,b(’),a(*),and b(2)are defined as follows:
if y = w q + l ,
= >, otherwise;
1, ify = wl,
= { L, otherwise;
ify = u , , j = 1,. . . , p ,
42) =
{ >, otherwise;
1 if y = i i , i = I, . . . ,q, j = 1, . . . , o ( i ) ,
biz) = { i, otherwise:
where L = (p + 1)(3p + q + 2).
The costs of the arcs of A 2 are defined accordingly to (3.1). It is easy to check
that the first inequality in (3.1)is verified for all the arcs of Al.
We claim that the resulting instance of the 2-commodity matching problem
MATCHING PROBLEMS IN VEHICLE SCHEDULING 277
has a solution whose cost is L if and only if the instance of the one-in-three
satisfiability is satisfiable.
(IF) Assume that there is a truth assignment such that each clause has exactly
one true variable. Then Zlis defined to contain wi, for all i = 1, . . . ,q + 1, and
il, . . . ,ioc9only for all i such that ui is false; Z2 contains all the remaining nodes.
The matching M1includes the arcs (wi,wi+l)for all ui true, and the arcs (wi,il),
(il,i2),. . . , (iHfi-l,io&h (idll,~i+i)for all ui false. Mi contains the arc (wq+i,wl)
E A2. Thus the overall cost of M 1is 3p + q + 2. The matching M2is defined
to contain all the arcs (ii,vr)E A, and (u,,ij) E A2 such that ui is true and C,
contains the jth occurrence of ui. The cost of the pair of arcs (ij,ur)and (ur,ii)
is 3p + q + 2. Since each clause contains exactly one true variable, there are
p such pairs in M2, and hence its cost is p ( 3 p + q + 2). Thus the overall cost
of the solution is L and the first part of the proof is completed.
(ONLY IF) Assume that the instance of the 2-commodity matching problem
has a solution with cost L. Consider nodes w1in S and w,+~in T; the unique
way to match these nodes without exceeding the cost bound L is to include in
the same node subset, say I,, for each i, wi and either all the nodes il, i2, . . . ,io(i)
or none of them. Correspondently M Ishall contain arc ( W ~ + ~ , Wand, ~ ) for each
i, either arc ( w ; , w ~ +or ] ) arcs (wi,il), (i1,i2), . . . , (io(i),i4i()i)( i ) - l , w i + l ) .For
o,
each i such that (wi,wi+,)E MI, M2 shall include the arcs (ii,ur) and (ur,ii) with
j = 1,2, . . . ,o(i) and r such that C, contains the jth occurrence of ui. Note
that any other choice of Z,, I,, MI, and M2 will lead to a cost larger than L. The
corresponding solution of the satisfiability problem is obtained by setting ui true
if and only if (wi,wi+l) E M1.Since each node u, is matched to exactly one node
corresponding to the occurrence of a true variable, the proof is so completed.
Clearly since Mh4 is a particular case of CMM, also the capacitated multi-
commodity matching is NP-hard. Note that we could have derived the proof of
Theorem 3.1 directly for the capacitated case just by giving capacity 1 to the
first depot and capacity p to the second. Lastly, one can readily check that
assuming a!") = bj") = 1/2 for all i and h and = 0 for all (i,j) E A , and h,
polynomial time solvability returns. Moreover, this holds even in the capacitated
case, since the solution of the resulting fleet size problem does not depend on
the capacities of the individual depots neither on the cost of deadheading trips.
c i
xi!) = y p , V i,h,
c x(h)
i
11 = '
Yl( h ) V j,h,
2 xf) Ikh, V h,
(i.j)az
cyp
h
= 1, V i,
I
1, if trip i is assigned to depot h ,
yp = 0, otherwise;
1, if trips i and j are run in the order
Ah) = by the same vehicle housed at depot h ,
11
0, otherwise,
and costs verify assumptions (3.1).
Consider the Lagrangean dual of (4.1), max,+(A), where +(A) is defined as
follows:
ci
xi*) = Yl@), V j,h,
c
(i,j)EA2
xih) 5 kh, Vh
ci
xp = yp, V i,
x(h)
'I = yp, V j, (4.3)
i
MATCHING PROBLEMS IN VEHICLE SCHEDULING 279
V i,
iii) If we do not succeed in emptying Q2,then the solution obtained from the
initial single commodity minimum fleet size problem is used, assigning the ve-
hicles to the depots in order to minimize the cost of the deadheading trips and
to satisfy the capacity constraints.
In order to evaluate the practical behavior of the proposed approach we run
the above procedure on some randomly generated problems. We considered 35
instances with 3 depots and 50 trips (for a total of about 200 hours of travelling
time). The distribution of the trips along the day and their lengths have been
generated according to real life data; in particular data from the Florence Transit
Company have been used.
TABLE I.
Problem Fleet size Total capacity Depot capacities % Error
RSl 27 60 15 20 25 1.08
30 10 10 10 .o
RS2 30 50 15 20 25 .33
30 10 10 10 .o
30 4 15 11 .o
RS3 26 60 15 20 25 .32
30 12 9 9 .10
RS4 28 50 15 10 25 .o
30 8 10 12 .O
28 7 15 6 .o
RS5 31 40 15 10 15 .51
35 15 10 10 3.42
35 12 11 12 .51
33 11 11 11 2.54
31 10 10 11 5.04
RS6 29 40 10 15 15 2.22
35 15 10 10 .o
35 12 12 11 .o
30 10 10 10 .8
29 12 8 9 .o
RS7 29 40 10 15 15 .o
35 12 12 11 .o
35 15 5 15 .21
29 10 7 12 .O
29 10 9 10 1.41
RS8 30 40 13 13 14 .O
35 12 12 11 .o
33 11 11 11 1.1
32 11 10 11 .59
30 10 10 10 .o
RS9 28 40 14 13 13 .06
33 11 11 11 .18
32 10 11 11 .21
30 10 10 10 2.85
28 8 10 10 2.70
Note. % error = (upper bound-lower bound) . 100/(lowerbound).
MATCHING PROBLEMS IN VEHICLE SCHEDULING 281
The computational results are reported in Table I. For each problem (column
1) the minimum fleet size is computed (column 2); different instances are con-
sidered by varying depot capacities (column 3: total capacity, column 4: indi-
vidual capacities) down to a total capacity approaching the minimum fleet size.
Finally in column 5 the value of the % error of the produced solution is reported,
where % error = (upper bound - lower bound) - 100/(lower bound). As one
can check the approach yields optimal solutions quite often, even when the total
capacity is close the minimum fleet size; moreover, the percentage of the error
is greater than 3% only in two cases.
It is worth remarking that such good results have been obtained by means of
rather naive algorithms such as the ones described above. This fact suggests that
CMM should not be too hard to solve to optimality, at least in vehicle scheduling
applications.
References
[l] L. Bodin and B. Golden, Classification in vehicle routing and scheduling. Networks
11 (1981) 97-108.
[2] P. Carraresi and G. Gallo, Network models for vehicle and crew scheduling. EJOR
16 (1984) 139-151.
[3] P. Carraresi, G. Gallo and J.-M. Rousseau, Relaxation approaches to large scale bus
driver scheduling problems. Transportation Res. 16B (1982) 383-397.
[4] M. R. Garey and D. S. Johnson, Computers and intractability: a guide to the theory
of NP-Completeness. W. H. Freeman, San Francisco (1979).
[5] J. K. Lenstra and A. H. G. Rinnooy Kan, Complexity of vehicle routing and sched-
uling. Networks 11 (1981) 221-227.
[6] C. H. Papadimitriou and M. Yannakakis, The complexity of restricted spanning tree
problems. Journal ACM 29 (1982) 285-309.
[7] R. E. Tarjan, Data structures and network algorithms, SIAM, Philadelphia (1983).