ArticlePDF Available

A Fair Carpool Scheduling Algorithm

Authors:

Abstract

We present a simple carpool scheduling algorithm in which no penalty is assessed to a carpool member who does not ride on any given day. The algorithm is shown to be fair, in a certain reasonable sense. The amount of bookkeeping grows only linearly with the number of carpool members.
of
research and development
Volume
27,
Number
2,
March
1983
Ronald Fagin
John
H.
Williams
A
Fair Carpool Scheduling Algorithm
0
Copyright
1983
by International Business Machines Corporation.
See
individual articles
for
copying information. Pages containing the table
of contents and “Recent Papers by IBM Authors” may
be
freely
copied and distributed,
in
any
form.
ISSN
18-8646.
Printed in
USA.
Ronald Fagin
John
H.
Williams
A
Fair Carpool Scheduling Algorithm
We present a simple carpool scheduling algorithm in which
no
penalty is assessed to a carpool member who does not ride
on
any
given day. The algorithm is shown to be fair, in a certain reasonable sense. The amount
of
bookkeepinggrows only linearly with
the number
of
carpool members.
1.
Introduction
Suppose that
N
people, tired of spending their time and
money in gasoline lines, decide to form a carpool. We present
a scheduling algorithm for determining which person should
drive
on
any given day. We want a scheduling algorithm that
will be perceived as fair by all the members
so
as to
encourage their continued participation. We begin by pre-
senting three algorithms (Scheduling Algorithms
1-3
below) and discussing their flaws. We then present the
algorithm (Scheduling Algorithm
4)
that we propose. We
assume for now that
on
any given day at most one car is the
“carpool car.” This assumption is relaxed later.
Scheduling Algorithm
I
(simple rotation)
The simplest
scheme, and the one most often used, is simply to rotate
driving, e.g., in alphabetical order. Thus,
if
there are
N
members of the carpool, then person
i
is responsible for
driving
on
the ith day and every
N
driving days thereafter.
This scheme has the obvious advantage that it
is
simple to
describe and it is easy to determine who drives next. The
difficulty with this scheme arises when one
or
more people do
not participate in the carpool
on
a particular day. If the
designated driver has to stay out
on
the day that he is
supposed to drive, then he will have to swap days with
someone else. After
a
few such occurrences, it may become
difficult to determine who is to drive the next day. If a
non-driver misses one
or
more days, should he be expected to
drive in his normal rotation? If
so,
he may
soon
perceive the
carpool to be more
of
a burden than a blessing and drop out
altogether.
Just as big a problem as the person who cannot drive
on
his
scheduled day is the person who must (for personal reasons)
drive
on
someone else’s day but could otherwise participate in
the carpool (for example, a person who is going to work as
usual but needs to have his car in order to go to the bank to
deposit the money he has saved by carpooling). We want a
scheduling algorithm that will always be tolerant of excep-
tional conditions and that will never discourage participa-
tion.
In
particular, we want an algorithm that is
robust,
in
the following sense: A person can drive
on
a day that the
algorithm says someone else should drive, and it is then easy
to see how to get “back in synch” later.
Scheduling Algorithm
2
(simple tokens)
In
order to cor-
rect the deficiencies of simple rotation, we might adopt the
following procedure. Each time a person
R
rides with a driver
D
#
R,
then
R
pays
D
one “ride token.” Of course, the
tokens would not actually need to be handled; each person’s
current token holding could simply be recorded somewhere,
and that record could be updated daily. Then the algorithm
for
determining who drives next would be to choose, from
among the people participating that day, the person with the
smallest holding of tokens.
When we formally define fairness, in Section
3,
we shall
see that this scheduling algorithm is not fair in
our
sense.
In
the worst case, some carpool member may be forced to drive
far more than his “fair share,”
as
we shall see. We now
briefly mention a few intuitive reasons why this algorithm is
0
Copyright
1983
by International Business Machines Corporation. Copying
in
printed form
for
private use is permitted without payment of
royalty provided that
(1)
each reproduction
is
done without alteration and
(2)
the
Journal
reference and IBM copyright notice are included
on
the first page. The title and abstract,
but
no
other portions. of this paper may be copied
or
distributed royalty free without further permission by
computer-based and other information-service systems. Permission
to
republish
any other portion
of
this paper
must
be obtained
from
the
Editor.
133
IBM J. RES.
DEVELOP.
VOL.
21
-NO.
2
-
MARCH
1983
RONALD FAClN AND JOHN H. WILLIAMS
Don John Phyllis Ron
Ill1
Ill
Ill1
Ill
Don John Phyllis Don John Ron
1
I
I /I
1
~IIII’M
Ill1
Don Phyllis Ron John Phyllis Ron
Phyllis Ron
Figure
1
Books
for Scheduling Algorithm
3.
Date
I
Don John Phyllis Ron
Figure
2
Books
for
Scheduling Algorithm
4.
not fair. (1) It is certainly quite advantageous to drive
on
days when many people are participating (since the driver
gets one ride token from each of the other participants). If a
carpool member were unlucky enough to be the designated
driver on several “bad” (sparsely attended) days, then he
might decide that the algorithm
is
not fair, and might even be
driven to drop out
of
the carpool.
(2)
On a “good” day (a day
in which there are many participants), if two carpool partici-
pants
A
and
B
were tied for the lowest score, then both
A
and
B
would want very much to drive, and some tie-breaking
scheme would have to be devised.
(3)
Finally, this algorithm
is not robust in the sense we have defined: If
A
were a carpool
member, if it were not
A’s
turn to drive according to the
algorithm (that is,
A
did not have the lowest score among the
participants
on
that day), and if
A
insisted on driving his car
on
that day
for
personal reasons, then the other carpool
members would be quite unhappy if this were a “good” day.
Scheduling Algorithm
3
(subsets)
The next scheduling
algorithm to be described does turn out to be fair in our sense;
the problem, as we shall
see,
is
the amount
of
bookkeeping
134
required. This algorithm records, for each of the
2N
-
(N
+
1)
nontrivial subsets of carpool members (subsets
of
two
or
more), the number of times that each member of the
subset has driven that particular group of people. For exam-
ple, if there are four people named Don, John, Phyllis, and
Ron in the carpool, then the books at a given point might look
like Fig.
1
(where, for example, a tally is entered under
Phyllis in the Don-Phyllis-Ron table
on
a day in which only
Don, Phyllis, and
Ron
participate in the carpool and Phyllis
drives). If the table is as in Fig. 1, then
on
the next day
in
which the only participants are Don, Phyllis, and Ron, the
driver should be the person (in this case,
Ron)
with the least
number
of
tallies in the Don-Phyllis-Ron table. With this
method, it is clear that a person is not penalized for
non-
participation on any day. It is intuitively clear that this
algorithm is fair, since it is essentially simple rotation applied
separately to each
of
the
2N
-
(N
+
1)
nontrivial subsets.
Further, it is clear that this algorithm is robust in our sense.
Unfortunately, the bookkeeping for this algorithm becomes a
nightmare (if the number
N
of people is, say, four
or
more)
because the size
of
the book grows exponentially with the size
of the carpool. Further, this scheduling algorithm neglects
certain trade-offs. For example, Phyllis and John appear
together in four of the tables in Fig.
1,
but Scheduling
Algorithm
3
makes
no
attempt to trade
off
rides in the tables
in which Phyllis and John appear together.
In
fact, in Fig.
1,
Phyllis has driven more times than John in each of the four
tables
in
which they both appear.
2.
The proposed scheduling algorithm
We now give our proposed scheduling algorithm.
Scheduling Algorithm
4
(fair carpool scheduling algo-
rithm)
We begin by defining
U
to be a value that, intui-
tively, represents the total cost of a trip. It is convenient to
take
U
to be the least common multiple of
1,
2,
.-.,
m,
where
m
is the largest number of people who ever ride together at a
time in the carpool. In the running example we shall give, we
assume that this number
m
is taken equal to the total number
N
of members of the carpool, which in turn is assumed to be
4.
Thus,
U
is taken to be the least common multiple of
1,2,
3,
and
4;
that is, Uis
12.
As
drawn in Fig.
2,
the books consist
of
a single table, with one column for the date and one column
for
each carpool participant. Each day that the carpool
drives, a new row is entered into the table. The table is
initialized with a row of all
0’s
(the first row of the table in
Fig.
2).
If,
on a given day, there are
k
participants in the
carpool and
A
is the driver, then the
A
entry
is
increased by
U(k
-
l)/k
units (that is, the entry for that day in the
A
column is
U(k
-
l)/k
more than the
A
entry in the previous
row), and the entries of the riders who do not drive are each
decreased by
U/k.
For example, in Fig.
2,
the first day of the
carpool was May
1,
and John was the driver.
On
that day,
Phyllis and Ron rode
in
John’s car. Thus, John gained
8
RONALD
FAGlN
AND JOHN
H.
WILLIAMS IBM
J.
RES.
DEVELOP..
VOL
21
NO.
2 MARCH
1983
units, and Phyllis and Ron each lost
4
units.
On
the next day,
May
2,
all four carpool members participated, and Ron was
the driver. (The algorithm says that either Phyllis
or
Ron
should
be
the driver on May
2,
since they are tied for the
lowest score, with
-4
units each.) Since Ron drove, he
gained
9
units, and each of the others lost
3
units. On the next
day, May
3,
only Don and Phyllis participated. Since Phyllis
had
a
lower score than Don
(-7
versus
-3),
she was the
driver. She gained
6
units and Don lost
6
units. Note that by
choosing
U
as we have (in this case,
U
=
12),
every entry
of
the table is an integer.
.
An intuitive way to view this scheduling algorithm is that
the “cost” of driving is taken
to
be
U
units, and this cost is
divided equally among each of the participants.
So,
if
there
are
k
participants, then the cost to each participant is
U/k.
Thus, each
of
the participants who
is
not the driver “pays”
Ulk
units to the driver.
We now show that for each row, the
checksum
(the sum
of
the entries) is zero. For example, on May
2,
the entries are
-3,
5,
-7,
and
5,
which add to
0.
This property provides a
redundancy check
on
the arithmetic.
Proposition
I
In
each table generated by Scheduling Algorithm
4,
the
checksum of each row is zero.
Proof
When
k
people participate, one of them (the driver)
gains U(k
-
l)/k
units, the other
k
-
1
participants each
lose
U/k
units, and the values
of
the nonparticipants are
unchanged. Thus, the
net
gain
or
loss
is
0,
and since the table
is initialized to all O’s, the checksum is always
0.
0
We now show that the entries in the table are bounded for
each
N
(where
N
is the number of members
of
the carpool).
We shall make use of this result later,
in
our proof
of
fairness.
The
schedule
of
arrivals
is a finite sequence
(S,,
S,,
...,
Sn),
where
S,
is the set
of
participants
in
the carpool
on
day
i
(or
as we may also say,
at
time
i).
Intuitively, the schedule
of
arrivals tells who participated in the carpool, day by day. For
example, the schedule
of
arrivals
(ABC,
BD,
ACD),
where
ABC
is an abbreviation for
[A,
B,
C},
etc., corresponds to
persons
A,
B,
and
C
participating
in
the carpool (riding in the
carpool car)
on
the first day, persons
B
and
D
participating
on
the second day, and
so
on.
Theorem
2
Let
N,
the number
of
members
of
the carpool, be fixed. Then
there is a number
M
such that, for each schedule
of
arrivals,
the table derived by applying Scheduling Algorithm
4
con-
tains no entry larger than
M.
Proof
Assume that the theorem is false; .we shall derive a
contradiction. Find
N
such that, for each
M,
there is a table
T
(which can be derived by applying Scheduling Algorithm
4
to some schedule of arrivals) with an entry larger than
M.
Define the sequence
a,.
...,
a,
recursively by letting
a,
=
0,
and
a,,
,
=
1
+
ia,,
for
1
I
i
<
N.
Let
M
be
a,U.
Let
T
be
a
table (that
is
derived by applying Scheduling Algorithm
4)
with an entry larger than
M.
Let us
call
the top row (with all
zeros as entries) of table
Trow
0,
the next row of the table
row
I,
and
so
on.
If the
N
entries of row
t
are
b,
L
b,
L
...
2
b,, then define
s,(i)
to be b,. Thus (with ties properly
accounted for),
s,(i)
is the ith largest entry of row
t.
We think
of
row
t
as containing the scores of members
of
the carpool
just after the carpool has driven
on
time
t
(that is, the scores
after time
t
but before time
t
+
1).
Since table
T
contains an entry larger than
M,
we know
that
sl(j)
>
M,
for some
t
and
j.
Hence,
sI(
1)
>
M,
since
s,(l)
2
sl(j).
Let
t,
be the least
t
such that
s,(l)
>
M.
We
now show that there are
t,,
...,
t,,
where
t,
>
t,
>
...
>
t,,
such that for each
i
(1
5
i
i
N),
s,(i)
>
M
-
a,U.
(1)
We already know that
(I)
holds when
i
=
I,
since
a,
=
0.
Assume inductively that we have found
t,
>
t,
>
...
>
t,
such that
s
>
M
-
apU
for
1
5
p
5
i;
in particular (when
p
=
i)
we see that
(I)
holds. We must find
t,+,
<
t,
such that
‘P
s,,+,
(i
+
1)
>
M
-
a,+,
U.
(2)
Now
sr(j)
2
s,(i)
when
1
Ij
I
i.
Hence,
s,(l)
+
...
+
s,(i)
2
isf(i).
s,(l)
+
...
+
s,(i)
>
iM
-
ia,U.
(3)
By
(I)
and
(3),
it follows that when
t
=
t,,
we have
(4)
Let
k
be the least value oft such that
(4)
holds. Note for
later use that
k
>
0,
since
so(j)
=
0
for eachj. We now show
that
sk(i)
>
M
-
ia,lJ.
(5)
Ifi
=
I,
then
k
=
t,,
by definition oft, (since
a,
=
0).
So,
if
i
=
I,
then
(5)
holds. We now show that
(5)
holds
if
i
>
1.
We
know that
k
I
t,,
since, as we showed,
(4)
holds when
t
=
t,.
Since
k
5
t,
<
t,,
it follows by minimality
oft,
that
sk(j)
i
M,
for
1
I
j
I
N.
In
particular,
sk(j)iM,forlsj5i-
1.
(6)
By
(4),
with
t
=
k,
and by
(6),
it follows that
(5)
holds,
which was to be shown.
We know that
k
is the least value oft such that
(4)
holds,
and that, as noted,
k
>
0.
Therefore,
135
IBM
J
RES. DEVELOP. VOL.
21
-
NO.
2
-
MARCH
1983
RONALD FAGIN AND JOHN H. WILLIAMS
(7)
We now show that
(7)
implies that
sk-,(i
+
1)
+
U
>
sk(i).
(8)
Now
(7)
says that the sum of the
i
biggest scores strictly
increases between rows
k
-
1
and
k.
How can this happen?
Let
A
be the driver of the carpool at time
k.
Thus,
A
has the
lowest score in row
k
-
1
among those who participate in the
carpool
on
day
k.
It
is
not hard to see that for the sum of the
i
biggest scores to strictly increase between rows
k
-
1
and
k,
it is necessary that
I.
A’s
score in row
k
-
1
is
sk-
,(j)
for somej
>
i;
that is,
A’s
score is one of the lowest
N
-
i
scores in row
k
-
1,
and
2.
A’s
score in row
k
is
sk(m)
for some
m
5
i;
that is,
A’s
score is one of the biggest
i
scores in row
k.
Now the driver’s score increases by less than
U
when he
drives. Therefore,
A’s
score just before he drove [that is,
sk-,(j)]
differs from his score just after he drove [that is,
s,(m)]
by less than
U.
Hence,
(9)
Now
sk-,(i
+
1)
2
sk-,(j),
since;
>
i,
and
so
(by adding
U
to both sides), we get
Sk&,
(i
+
1)
+
u
2
Sk&,
(;)
+
u.
(10)
Further,
since
m
I
i.
Clearly,
(8)
follows immediately from
(9),
(lo),
and
(1
1).
Now
(5)
and
(8)
together imply that
sk&,
(i
+
1)
>
M
-
(ia,
+
1)U,
that is,
sk-,
(i
t
1)
>
M
-
a,+,
U.
(12)
Define
t,+,
to be
k
-
1.
Then
(12)
tells
us
that (2) holds.
Further,
t,+,
<
f,,
since we already showed that
k
5
t,.
This
completes the induction. Hence,
(1)
holds for each
i
(1
5
i
5
N).
Let
t
=
t,.
We see from
(l),
when
i
=
N, that
sI(N)
>
M
-
a,U.
But
M
=
aNU,
and
so
s,(N)
>
0.
(13)
Since
s,(i)
I
s,(N)
for
1
i
i
I
N, it follows from (13) that
s,(i)
>
0
for each
i
(1
5
i
i
N).
Thus, every entry of row
t
is
strictly positive, and
so
the checksum of row
t
is strictly
positive. But this contradicts Proposition
1,
which says that
the checksum of every row is
0.
This contradiction completes
the proof.
0
Corollary
3
Let N, the number of members of the carpool, be fixed. Then
there is a number
M’
such that
for
each schedule of arrivals,
136
the table derived by applying Scheduling Algorithm 4 con-
tains
no
entry whose absolute value is larger than
M’.
Proof
Let
M
be as in Theorem
2,
and let
T
be
a
table
derived by applying Scheduling Algorithm
4
to some sched-
ule of arrivals. By Theorem
2,
we know that
no
positive entry
in the table can be larger than
M.
How large in absolute
value can the smallest entry (the negative entry with the
biggest absolute value) in the table be? Let
r
be a row of the
table. Now
no
entry of the table can be larger than
M,
and
there can be at most
N
-
1
positive entries
in
row
r
(because,
by Proposition
1,
the checksum of row ris
0).
Hence, the sum
of the positive entries in row
r
is at most
(N
-
1)M.
Since the
checksum of row
r
is
0,
the absolute value of the sum of the
negative entries in row
r
is equal to the sum of the positive
entries in row
r,
and
so
is
also at most (N
-
1)M.
Therefore,
the absolute value of the smallest (“most negative”) member
of row
r
is at most (N
-
1)M.
Thus, we can take
M’
to be
(N
-
1)M.
0
It
follows from
our
proof of Theorem 2 that an upper
bound
Mon
the size of the biggest entry that can ever appear
in the table is
a#,
where
N
is the number of carpool
members and where
a,
=
0
and
ai+,
=
1
+
ia,
(1
5
i
5
N).
This bound is not the best possible.
For
example, if
N
=
2,
then
our
upper bound is
U,
whereas it is very easy to see that
in this case the actual upper bound
is
only
U/2.
If N
=
3,
then
our
upper bound is
2U,
whereas a careful examination
of the possibilities shows that the actual upper bound is
(5/6)U.
Let
us
define the functionfby lettingf(N)U be the
actual upper bound if there are
N
carpool members. Thus,
f(2)
=
112
andf(3)
=
516.
We note thatf(4)
=
7/6
and
f(5)
=
8/5.
We have not foundf(N) exactly for
N
26.
Proposition
4
The function
f
is monotone and unbounded.
Note
By
monotone,
we mean that if
N,
i
N2, then f(N,)
if(N2). By
unbounded,
we meanf(N) gets arbitrarily large
as
N
gets large.
Proof
Any
score that can be obtained in a carpool with
N,
members can be obtained in a carpool with
N2
2
N,
members: we can simply assume that
N2
-
N,
members of
the larger carpool never participate. Monotonicity follows
immediately.
We now show unboundedness. Let
N
=
2’,
and assume
that the carpool members are
A,,
..A,
A,.
Assume that
on
the
first day, the participants are
A,
and
A,,
and the driver is
A,;
on
the second day, the participants are
A,
and
A,,
and the
driver is
A,;
and
so
on
for a total of N/2 days. Then there is a
second round that begins
on
the ((N/2)
+
I)th day.
On
the
first day of the second round, the participants are
A,
and
A,,
and the driver is
A,;
on
the next day, the participants are
A,
RONALD
FAGlN
AND
JOHN
H.
WILLIAMS
IBM
J.
RES.
DEVELOP.
VOL.
21
0
NO.
2
MARCH
1983
and
A,,
and the driver is
A,;
and
so
on.
Then there is a third
round; on the first day of the third round, the participants are
A,
and
A,,
and the driver is
A,;
and
so
on.
This continues for a
total of
L
log,
NJ
rounds, where
L
XJ
is
the greatest integer
not exceeding
x.
It is straightforward to see that after the
final round,
4’s
score is
r/2
(where
N
=
2‘).
Thus,
f(2‘)
2
r/2.
Hence,
f
is unbounded.
We close the proof by noting another way of showing
unboundedness.
As
before, let
A,,
...,
A,
be the carpool
members. Assume that
on
the first day, everyone partici-
pates, and the driver is
A,.
Assume that
on
the second day,
the participants are
A,,
...,
A,_,,
and the driver is
A,-,,
and
so
on. Thus,
on
the ith day
(1
I
i
I
N
-
l),
the participants
are
A,,
...,
AN-i+,,
and the driver is
AN-,+,.
It is clear that
A,’s
score after
N
-
1
days is
-U/N
-
U/(N
-
1)
-
U/(N
-
2)
-
...
-
U/2,
which gets arbitrarily large in
absolute value
as
N
increases (and which,
in
particular, is
asymptotic to
-
U
log
N).
0
It follows from the proof of Proposition
4
that
f
(N)
2
(1/2)
L
log, NJ .
D. Coppersmith (private communica-
tion) has improved this logarithmic lower bound to a linear
lower bound by using the following argument. Let
N
be the
number of members of the carpool. As in the proof
of
Theorem
2,
let the scores just after time
t
be
s,(
I)
2
s,(2)
2
...
2
s,(N).
Define the “figure of merit” just after time
t
to
be
(N
-
l)s,(l)
+
(N
-
2)s,(2)
+
...
+
(O)s,(N).
We now
define the schedule of arrivals. On each day, the set of
participants consists of two members with the same score.
If
there are no two members with the same score, then the
carpool stops running. If
i
and
j
ride together, and
i
is the
driver, then
i’s
score increases by
U/2
and
j’s
score decreases
by
U/2.
The net effect
on
the figure of merit of increasing
one value
s,(i)
by
U/2
and decreasing
s,(i
+
1)
by
U/2
is to
increase the figure of merit by
U/2.
Further, it is easy to see
that the net effect of reshuffling the scores to keep the
s,(i)’s
nondecreasing can
only
increase the figure
of
merit further.
Keep the carpool running until either
no
two participants
have the same score,
or
until the figure of merit has gone
beyond
N3U,
whichever comes first.
In
the first case (where
the carpool is run until
no
two participants have the same
score), we know that since all carpool members started with a
score
of
0,
and since scores change by
U/2
at a time, the
scores will be at least
U/2
apart. That is,
no
two scores will
be closer together in value than
U/2.
It
is
not hard to verify
that this fact, along with the fact that the sum of the scores is
0,
implies that the largest score is at least
(N
-
1)U/4.
In
the
second case (where the carpool is run until the figure of merit
has gone beyond
N3U),
it
is
clear that the largest score
is
greater than
NU.
So
in either case, the largest score
is
at least
(N
-
1)
U/4,
which is linear in
N,
as promised. Note that
the linear lower bound
is
attained even when no more than
two carpool members ever ride together. Coppersmith also
shows (by a more detailed analysis) a lower bound
of
(N
-
I)U/3,
which is attained even with
no
more than three
carpool members ever riding together.
Coppersmith’s argument, taken together with the proof
of
Theorem
2,
shows that
(N
-
1)/3
If
(N)
5
a,,
where
a,
=
0
and
a,,,
=
1
+
ia,
(1
5
i
I
N).
There is an exponential
gap between these lower and upper bounds. It is an interest-
ing combinatorial problem to tighten these bounds
[
I].
We close this section by noting another interesting combi-
natorial problem. Let us say that a vector
(a,,
...,
a,),
where
a,
2
...
2
ah,
is
an
attainable
vector of
scores
if
there is a
schedule of arrivals such that, starting with a score of
0
for
every member of the carpool, and always applying Schedul-
ing Algorithm
4,
there is a time
t
where the vector
(s,(
l),
...,
s,(N))
of
scores is equal to
(a,,
...,
a,).
We conjecture that
if
(a,,
...,
a,)
is an attainable vector of scores, then
so
is the
negation
(-aN,
...,
-a,).
If
the conjecture is true, then the
M’
of
Corollary
3
and the
M
of Theorem
2
can, of course, be
taken to be the same.
3.
Fairness
In
this section, we discuss a concept of fairness and show that
our scheduling algorithm (Scheduling Algorithm
4)
is fair.
However, we shall see that Scheduling Algorithm
2
(simple
tokens) is not fair. We shall also see that Scheduling Algo-
rithm
l
(simple rotation)
is
fair (when it can be applied), and
that Scheduling Algorithm
3
(subsets) is fair (but it requires
too much bookkeeping).
To help us understand fairness, let us first consider
Scheduling Algorithm
3
(subsets). Scheduling Algorithm
3
is fair
in
the sense that among the times that person
A
rides
precisely with, say,
B
and
C,
the driver is person
A
approxi-
mately
1/3
of the time (with the obvious generalization that
A
is
the driver approximately
Ilk
of the time that he rides
with a fixed subset of
k
-
1
others.) Less restrictively, we
might consider a scheduling algorithm fair if each person is
the driver approximately
Ilk
of the time that he rides with
k
-
1
others (not necessarily a fixed subset
of
k
-
1
others.) Thus, if the carpool consists precisely of
A,
B,
C,
and
D,
then
A
might be expected to drive approximately
1/3
of
the time that he rides with precisely two among
B,
C,
and
D.
In other words, let
cx
be the number of times (through time
t)
that
X
is precisely the set of those participating in the
carpool
on
that day. Then during thosedays that
A
rides with
precisely two among
B,
C,
and
D,
the number
of
times that
we might want
A
to drive is approximately
1
j
(cmc
+ cABD
+
cAcD).
Even less restrictively, assume that through time
t,
person
A
has participated
in
the carpool
on
6,
days when exactly
2
137
IBM
J.
RES. DEVELOP.
VOL.
27
o
NO.
2
o
MARCH
1983
RONALD
FAGIN
AND JOHN H.
WILLIAMS
138
persons participated in the carpool,
on
b,
days when exactly
3
persons participated in the carpool, and
so
on.
Let us define
A's ideal number
of
drives to be the number
Our notion of fairness is that
A
should be the driver of the
carpool car approximately this number
of
times.
We are now ready to give our formal definition of fairness.
We say that a carpool scheduling algorithm is fair
if
for each
N
(where
N
is the number of members of the carpool), there
is a number
P
such that whatever the schedule of arrivals, it
is the case that at each time
t
and for each carpool member
A,
the number of times that A has actually driven differs
from his ideal number
of
drives in absolute value by
no
more
than
P.
We shall show that our scheduling algorithm is fair. We
first prove a simple proposition.
Proposition
5
Let
x
be the number of times that A has actually driven
through time
t,
and let y be
A's
ideal number of drives
through time
t.
Then the number
(x
-
y)U is
A's
entry
in
row t of the table in Scheduling Algorithm
4.
Proof
We prove the proposition by induction
on
t. It is
obviously true
for
t
=
0,
since every entry
in
row
0
is
0,
and in
this case
x
=
y
=
0.
Assume inductively that the statement
of the proposition is true for t
=
m;
we shall show that it
holds for t
=
m
+
1.
Let
x,
be the number of times that
A
has
actually driven through time t, let y, be A's ideal number of
drives through time t, and let A, be A's entry
in
row
t
of
the
table. By inductive assumption, the number
(x,,,
-
y,)U
equals
A,
(that is, A's entry in row
m
of the table). We must
show that the number
(xm+,
-
y,+,)Uequals
A,,,
(that is,
A's
entry in row
m
+
1
of
the table). Assume that there are k
participants in the carpool
at
(on
the day corresponding to)
time
t
+
I.
There are two cases, depending on whether A is
the driver at time
m
+
1.
Case1
andy,+,
=
y,
+
(l/k). Hence,
Aisthedriverattimem+ l.Thenxm+,
=x,
+
I,
-
Y,+l)U
=
(x,
-
Y,)U
+
U(k
~
l)/k.
(15)
But by assumption,
(x,
-
Y,)U
=
A,
(16)
Since A is the driver at time
m
+
1,
it follows from
Scheduling Algorithm
4
that
A,+,
=
A,,,
+
U(k
-
l)/k.
(17)
It follows from (15),
(16).
and
(17)
that
(x,+,
-
y,+,)U
=
A,,,,
which was to be shown.
Case
2
A
is not the driver at time
m
+
1.
Then
x,,,+~
=
x,,
and
Y,,,
=
Y,
+
(I/k).
Hence,
(x,,,+,
-
Y,+,)U
=
(x,
-
y,)U
-
U/k. As in Case
1,
it follows easily that
(x,+,
-
~,+~)Uis A's entry in row
m
+
1.
0
The next theorem discusses the fairness
or
unfairness of
the scheduling algorithms we have discussed. We are most
interested in the result that Scheduling Algorithm
4
is fair.
Theorem6
Scheduling Algorithm
1
(when it applies), Scheduling Algo-
rithm
3,
and Scheduling Algorithm
4
are fair, but Schedul-
ing Algorithm 2 is not fair.
Proof
Recall that a carpool scheduling algorithm isfair if
for
each
N
(where
N
is
the number
of
members
of
the
carpool), there is a number
P
such that whatever the
schedule of arrivals, it is the case that at each time
t
and for
each carpool member A, the number of times that
A
has
actually driven differs from his ideal number of drives in
absolute value by
no
more than
P.
Scheduling Algorithm
1
(simple rotation) is fair (when it
applies) Of course, Scheduling Algorithm
1
is very lim-
ited, since it is not even defined unless every carpool member
participates
in
the carpool
on
every day. If
so,
then it is easy
to see that the desired number
P
above can be taken to be
I.
Scheduling Algorithm
2
(simple tokens)
is
not
fair
As-
sume that there are
6
carpool members A, B, C,
A',
B', and
C', and that the schedule of arrivals is (AA', ABC, AB, AC,
ABC, AB, AC, A'B'C', A'B', A'C'), where the sequence
ABC, AB, AC, A'B'C', A'B', A'C' repeats over and over a
total of
m
times after the initial AA' (and
so
the number of
days is
6m
+
1
.)
We shall show that there is
no
number
P
as
defined above that works for every
m.
On
the first day, when
AA' is the set of carpool participants, either A
or
A' is the
driver. Assume without
loss
of
generality that
A'
is the
driver; otherwise, everything we now say holds when we
replace A, B,
C
by (respectively) A', B', C'. We leave to the
reader the simple verification that under Scheduling Algo-
rithm 2 it follows that
on
each of them days the set of carpool
participants is precisely ABC (respectively, AB
or
AC), the
driver is always A (respectively, B
or
C.) Now there are
exactly 2m
+
1
days that A participates in the carpool when
precisely
2
people participate (namely, A and one of A', B,
or
C),
and there are exactly
m
days that A participates in the
carpool when precisely
3
people participate (namely
A,
B,
and
C).
Thus, A's ideal number of drives is (1/2)(2m
+
1)
+
(1/3)m,
which equals
(4/3)m
+
(1/2). The number of
times that A actually drives is
m
+
1. The difference between
ideal and actual is
(m/3)
-
(1/2), which is not bounded by
any fixed number
P
(as
m
gets large.) This was to be shown.
A'B'C', A'B', A'C', ABC, AB, AC, A'B'C', A'B', A'C',
...,
RONALD
FAGlN
AND
JOHN
H.
WILLIAMS
IBM
J.
RES
DEVELOP
VOL.
27
NO.
2
MARCH
1983
... We propose TCE by aggregating the idea from [13]. In this work, the authors proposed a mathematical model of fairness in participatory thermal comfort provision based on the fairness definition for the carpooling problem [31]. The idea is to compute, each round, a notion of how much of the overall discomfort of a group, based on the group thermal comfort value computed by the strategy, each individual would have to suffer to make the system fair. ...
... Since it would be impossible for a system to be fair in the decision made for each round, the authors also introduce the notion of Accumulated Extra Loss of an individual at a round r as the summation of the Extra Loss the individual has experienced until that round. A strategy would be "fair" if, for the n users in the zone and at the round r, their Accumulated Extra Loss in absolute value is bounded by some constant M which is independent of r [31]. ...
Conference Paper
Full-text available
Heating, Ventilation, and Air Conditioning (HVAC) systems account for 40% to 50% of energy usage in commercial buildings. Thus, innovative ways to control and manage HVAC systems while preserving occupants’ comfort are required. State-of-the-art solutions employ pervasive systems with sensors or smart devices to gauge individual thermal sensations, yet assessing these methods is challenging. Real-world experiments are expensive, limited in access, and often overlook occupant and regional diversity. To address this, we introduce Co-zyBench, a benchmark tool using a Digital Twin (DT) approach for evaluating personalized thermal comfort systems. It employs a co-simulation middleware interfacing between a DT of the smart building and its HVAC system and another DT representing occupants’ dynamic thermal preferences in various spaces. The DTs that support Co-zyBench are generated based on information, including data captured by sensors, of the space in which the thermal comfort system has to be evaluated. Co-zyBench incorporates metrics for energy consumption, thermal comfort, and occupant equality. It also features reference DTs based on standard buildings, HVAC systems, and occupants with diverse thermal preferences.
... Given the general result above, next we focus on the special case of orienting edges of a graph to minimize the maximum imbalance between the in-and out-degrees. Fagin and Williams [FW83] posed the carpooling problem, which corresponds to vector balancing with vectors of the form (0, . . . , 0, 1, 0, . . . ...
... .) ∈ R n , and the graph discrepancy objective is precisely the · ∞ of the signed sum of vectors. [FW83,AAN + 98] use this problem to model fairness in scheduling, where edges represent shared commitments (such as carpooling), orientations give primary and secondary partners of the commitment (e.g., driver and co-driver), and hence the discrepancy measures fairness for individuals, in terms of how many commitments he/she is the primary partner for, relative to the total number of commitments he/she is a part of. ...
... Given the general result above, next we focus on the special case of orienting edges of a graph to minimize the maximum imbalance between the in-and out-degrees. Fagin and Williams [FW83] posed the carpooling problem, which corresponds to vector balancing with vectors of the form (0, . . . , 0, 1, 0, . . . ...
... .) ∈ R , and the graph discrepancy objective is precisely the · ∞ of the signed sum of vectors. [FW83,AAN + 98] use this problem to model fairness in scheduling, where edges represent shared commitments (such as carpooling), orientations give primary Since this algorithm is deterministic, the guarantees also hold against adaptive adversaries: there are Ω( ) discrepancy bounds for no-recourse algorithms against such adversaries, even for the se ing of only arrivals. ...
Preprint
Full-text available
The vector-balancing problem is a fundamental problem in discrepancy theory: given T vectors in $[-1,1]^n$, find a signing $\sigma(a) \in \{\pm 1\}$ of each vector $a$ to minimize the discrepancy $\| \sum_{a} \sigma(a) \cdot a \|_{\infty}$. This problem has been extensively studied in the static/offline setting. In this paper we initiate its study in the fully-dynamic setting with recourse: the algorithm sees a stream of T insertions and deletions of vectors, and at each time must maintain a low-discrepancy signing, while also minimizing the amortized recourse (the number of times any vector changes its sign) per update. For general vectors, we show algorithms which almost match Spencer's $O(\sqrt{n})$ offline discrepancy bound, with ${O}(n\cdot poly\!\log T)$ amortized recourse per update. The crucial idea is to compute a basic feasible solution to the linear relaxation in a distributed and recursive manner, which helps find a low-discrepancy signing. To bound recourse we argue that only a small part of the instance needs to be re-computed at each update. Since vector balancing has also been greatly studied for sparse vectors, we then give algorithms for low-discrepancy edge orientation, where we dynamically maintain signings for 2-sparse vectors. Alternatively, this can be seen as orienting a dynamic set of edges of an n-vertex graph to minimize the absolute difference between in- and out-degrees at any vertex. We present a deterministic algorithm with $O(poly\!\log n)$ discrepancy and $O(poly\!\log n)$ amortized recourse. The core ideas are to dynamically maintain an expander-decomposition with low recourse and then to show that, as the expanders change over time, a natural local-search algorithm converges quickly (i.e., with low recourse) to a low-discrepancy solution. We also give strong lower bounds for local-search discrepancy minimization algorithms.
... The fairness problem in scheduling was initially introduced by Fagin and Williams [3], who abstracted it as the carpool problem for their study. Subsequently, fairness scheduling problems started to emerge in the context of online machine scheduling. ...
Article
Full-text available
An improved slime mold algorithm (IMSMA) is presented in this paper for a multiprocessor multitask fair scheduling problem, which aims to reduce the average processing time. An initial population strategy based on Bernoulli mapping reverse learning is proposed for the slime mold algorithm. A Cauchy mutation strategy is employed to escape local optima, and the boundary-check mechanism of the slime mold swarm is optimized. The boundary conditions of the slime mold population are transformed into nonlinear, dynamically changing boundaries. This adjustment strengthens the slime mold algorithm’s global search capabilities in early iterations and strengthens its local search capability in later iterations, which accelerates the algorithm’s convergence speed. Two unimodal and two multimodal test functions from the CEC2019 benchmark are chosen for comparative experiments. The experiment results show the algorithm’s robust convergence and its capacity to escape local optima. The improved slime mold algorithm is applied to the multiprocessor fair scheduling problem to reduce the average execution time on each processor. Numerical experiments showed that the IMSMA performs better than other algorithms in terms of precision and convergence effectiveness.
... This leads to starvation in the task execution. A very good example of Carpool problem is taken by [42], [43] for explaining fairness in scheduling. Due to unfairness, some tasks may be starved at the expense of others and starvation is not adequately expressed by the performance metrics. ...
Article
Full-text available
The main intent of the cloud computing to provide utilities to the demands of the users that are booming day by day. To meet the requirements, existing scheduling algorithms focus on the improving the performance and neglecting the energy consumed to fulfill those demands. Hence, we propose a new Hybrid Scheduling Algorithm (HS) which is based on the Genetic Algorithm (GA) and Flower Pollination based Algorithm (FPA) for cloud environments. The proposed scheduling algorithm has surpassed in terms of performance across various parameters, i.e. completion time, resource utilization, cost of computation, and energy consumption for both cloud environments than the existing scheduling algorithms (GA and FPA). The simulation results revealed that HS has demonstrated maximum resource utilization with minimum energy consumption in less completion time for the execution of the tasks as compared to the existing scheduling algorithms in both environments. The simulation results have shown that HS has utilization of the resources, 36 % better than GA and 16 % better than FPA in homogeneous environment whereas in heterogenous environment, HS has performed 12% better than GA and 3.8% better than FPA. The performance of HS has an improvement of 2.6% from FPA and 6.9% from the GA for completion time in homogeneous environment whereas the completion time of the HS is reduced by 17.8 % from FPA and 33.7 % from GA in heterogeneous environment. For energy consumption, HS has improved 22% than FPA and 11% from GA in the homogeneous environment and HS is 4 % better than FPA and 14% from GA in heterogeneous environment.
Article
Carpooling has become a practical, cheap, and stress-free way to move around. This project presents the requirement, design and implementation of an enterprise-class application for carpooling following Model-View-Controlol model. The added features, compared to available applications, are different kinds of trips, a check-in system, and social media integration. The two kinds of trips are single trips, which are trips between two cities, and frequent trips which are the ones that commuters do every day. The check-in system enables users to check in meetings points and notify all users about that. Users can also share their activities on the application thanks to social media integration. The application is designed to be scalable, extensible, highly available and with a good performance.
Article
In this column, we will discuss some papers in online algorithms that appeared in 2022. As usual, we make no claim at complete coverage here, and have instead made a selection. If we have unaccountably missed your favorite paper and you would like to write about it or about any other topic in online algorithms, please don't hesitate to contact us!
Article
Full-text available
Taxi sharing is becoming a trendy travel mode in an increasing number of cities. By encouraging two or more passengers to share a taxi, taxi sharing can cut down travel costs, reduce traffic emissions, and relieve traffic congestion. To promote taxi sharing, this paper first reviews the existing taxi sharing practices in cities. The entire process of taxi sharing can be broken up into the following: matching, route choice, and pricing. The current situation is revealed, as well as prospects for future developments. Building on the review, new approaches are proposed to taxi sharing matching, route choice modelling, and pricing schemes to improve taxi sharing practices and broaden their application.
Assume inductively that we have found M -alJ for 1 < p S /; in particular (when p = i) we see that (1) holds. We must find r,^, < t. such that >: Si(i) when 1 < y < ;. Hence, @BULLET? By (1) and (3), it follows that when t = t-, we have 5
  • bullet@bullet@bullet
,(0 > A/ -a.U. (1) We already know that (1) holds when / = 1, since a, = 0. Assume inductively that we have found ;, > /^ > @BULLET@BULLET@BULLET > f, such that s, > M -alJ for 1 < p S /; in particular (when p = i) we see that (1) holds. We must find r,^, < t. such that (/ + ])> M U. Now 5,(7) >: Si(i) when 1 < y < ;. Hence, @BULLET?,(') + @BULLET@BULLET@BULLET + 5,(0 > (5,(0. By (1) and (3), it follows that when t = t-, we have 5,(1) + @BULLET@BULLET@BULLET + 5,(0 > iM -iafJ. (2) (3) (4) Let k be the least value of t such that (4) holds. Note for later use that ^ > 0, since 5^(7) = 0 for eachy. We now show that Si^{i) > M -ia^U.