Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to Carpool Fairly Moni Naor.

Similar presentations


Presentation on theme: "How to Carpool Fairly Moni Naor."— Presentation transcript:

1 How to Carpool Fairly Moni Naor

2 The carpool problem A group of n people form a carpool.
Each day a subset arrives to a (fixed) gathering point and one of them should drive. Looking for a fair method for determining which person should drive on any given day. What is the criterion for fairness? Given a schedule what is the fair share of each participant How to assign each day a single driver among the people who showed up Want to be as close as possible to the fair share of each participant

3 Example n=5 and 10 days D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 1 2 3 4 5 x What happens if schedule is repeated twice?

4 Fairness Criterion Fairness is a very intuitive yet controversial notion A large part of Game Theory deals with quantifying fairness What is the appropriate criterion in our case? Can start with a list of desiderata… How to measure the unfairness of a given schedule and assignment

5 FWi={1· j · ℓ | i 2 Dj} 1/|Dj|
The FW Share Idea: If the people who show up on a given day had hired a (taxi) driver splitting the cost looks natural. If di people show on day Di they should each `pay’ 1/di Hence, the desired share of a participant is the sum of the inverses of the number of people who showed up on the days he showed up. Terminology: schedule T = D1, D2, … Dℓ where Dj µ [n] corresponds to the people who show up on day j FW-Share for participant i: FWi={1· j · ℓ | i 2 Dj} 1/|Dj| The FW shares sum up to ℓ : i=1n FWi= i=1n { j | i 2 Dj} 1/|Dj|= ℓ

6 The Example with FW Shares
D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 FW-Share 1 2 3 4 5 x 4¢⅓+ ¼ ⅓ +1¾ 4¢⅓+1 10 For repeated schedule differences are very significant!

7 How close can we get to the FW Share?
Given a schedule D1, D2, … want to assign drivers so that the number of times each participant drives is as close as possible to the FW-Share Is it possible? Given that the FW Share may be fractional at best can hope for some rounding of the value Problem: given a schedule and a rounding of the FW Shares preserving the total number of days is it possible to find an assignment of drivers realizing it?

8 What happens when exactly two people show every day the motorpool problem
Can view input as a (multi)graph Node= participants Edges=days Orientation of the edges – who drives on each day Want an orientation of the edges so that the difference between the indegree and outdegree is Small Follows a given list

9 Two people per day If the degrees are all even
can find an orientation with equal indegrees and outdegrees at each node How? Follow the Eulerian Cycle In general: can find an orientation with max difference at most 1 Add a matching to between the nodes with odd degrees There is an even number of them Follow the Eulerian Cycle in the resulting graph Good news: can achieve the FW Share for the motorcycle-pool problem when the schedule is given in advance

10 Generalization: the vector rounding problem
Given a list of n dimensional vectors over the reals V1, V2, … Vℓ Find a list of n dimensional vectors over the integers Z1, Z2, … Zℓ Where each Zj = (zj1, zj2 … zjn) is a rounding of Vj = (vj1, vj2 … vjn) that preserves the sum Preservation Requirements: Each entry is rounded: for all 1 · j · ℓ, 1·i· n b vji c · zji · d vji e Each column sum is preserved: for all 1 · j · ℓ b i=1n vji c · i=1n zji · d i=1n vji e Each row sum is preserved: for all 1·i· n b j=1ℓ vji c · j=1ℓ zji · d j=1ℓ vji e

11 Casting the carpool problem as vector rounding
For each day Dj a vector Vj = (vj1, vj2 … vjn) where for all 1·i· n vji = If there is always a solution to the vector rounding problem satisfying the preservation requirements then: always possible to find an assignment to the carpool problem where each participant i drives either bFWi c or d FWi e times. Given any integer rounding Li of the FWi ’s that preserves their sum always possible to find an assignment to the carpool problem where each participant i drives Li times (the load on i) add a vector V0 where v0i = Li -FWi 1/|Dj| if j 2 Dj 0 otherwise

12 Solving the vector rounding problem
Define an integer linear program where the zji are the variables It has a fractional solution Simply zji = vji Want to argue that it has an integral solution The Preservation Requirements: for all 1 · j · ℓ, 1·i· n b vji c · zji · d vji e for all 1 · j · ℓ b i=1n vji c · i=1n zji · d i=1n vji e for all 1·i· n b j=1ℓ vji c · j=1ℓ zji · d j=1ℓ vji e Claim: all the basic feasible solutions are integral.

13 A flow problem bj=1ℓ i=1n uji c
Flow problems with integral constraints have only integral bfs d i=1n uji e Modified Preservation Requirements: Make uji = vji -b vji c and xji =zji -b vji c for all 1 · j · ℓ, 1·i· n 0 · xji · 1 for all 1 · j · ℓ b i=1nuji c · i=1n xji · d i=1n uji e for all 1·i· n b j=1ℓ uji c · j=1ℓ xji · d j=1ℓ uji e d uji e d j=1ℓ uji e rows columns

14 Alternative proof for the existence of an assignment satisfying the FW Share
Assume wlog all the FWi are integral Start with any assignment and suppose that not all the participants get FWi . Partition them into three sets Set F: Those that drove more than their fair share Set P: those that drove less than their fair share Set Q: those that drove exactly their fair share. Must have F   and P  since the sum over all participants of the difference between the FWi and the actual load is zero. Consider the directed graph on n nodes where each node corresponds to a participant Put a directed edge between any two participants if ever the head drove the tail took a ride. There must be directed path from a node in F to a node in P (going perhaps through Q). Reassign the edges of the path so that all the tails drive instead of all the heads. The sum over P of the difference between FWi and the actual load has decreased by 1 from the integrality assumption it did not go below zero. Therefore we can repeat the above procedure only a finite number of times before all the participants get their fair load.

15 Algorithms for the carpool problem
If we are given the schedule in advance then we can find a good assignment efficiently What happens in the online decision case: we have to decide who drives on day j knowing only D1, D2, … Dj How to measure the unfairness of An assignment Maximum deviation from the FW-Share max1 · i · n|Li -FWi | An algorithm Worst case, average case, expected…

16 The Motorpool problem – the online case
On a fixed set of n nodes a sequence of edges is given one by one Need to orient each edge as it arrives Want to minimize the maximum absolute difference between indegree and outdegree Unfairness of corresponding carpool (=motorpool) problem is half of that Will see: Lower bound Upper bounds The motorpool problem captures the general carpool problem as well as the vector rounding problem

17 Lower Bound To bound the performance of deterministic algorithms:
should describe an adversary who selects the next edge based on current state. Adversary’s Algorithm for creating the edges of a multi-graph: While there is no node with absolute difference at least (n-1)/2 Select a pairs of nodes with the same difference between indegree and outdegree If none exists stop There are at least n different values for the difference – if n is odd at least one is either (n-1)/2 (or larger) or (n-1)/2 (or smaller) if n is even at least one is either n/2 (or larger) or (or smaller) -2 -1 1 2 Claim: for any method of orienting the edges the adversary’s algorithm stops after O(n3) steps.

18 (d’1, d’2,  d’n )  (d1, d2,  dn )+1
Proof of lower bound For any directed multi-graph let d1, d2,  dn be the sorted (ascending) sequence of the absolute differences between the indegree and outdegree Consider the potential function (d1, d2,  dn )=åi=1n idi If (d1, d2,  dn )  n3, then dn must be at least n If nodes corresponding to di and di+1 (where di=di+1) are selected then (d’1, d’2,  d’n )  (d1, d2,  dn )+1 Since id + (i+1)d = i(d-1)+(i+1)(d+1) -1 So adversary stops after at most O(n3) selections. Difference in at least one of the nodes is at least (n-1)/2 Newly sorted Least growth when only two with difference d

19 Local Greedy algorithm
For all pairs of nodes i and j make the orientation of the multi-edges between them as even as possible For an even number of multi-edges – exactly half each way For an odd number break ties according to some rule Tie Breaking rules Arbitrary: difference between indegree and outdegree at most n-1 (unfairness (n-1)/2) A fixed pattern: if i-j < n/2 then i is the first head, otherwise j Difference between indegree and outdegree at most (n-1)/2 (unfairness (n-1)/4). Random: maximum difference between indegree and outdegree is bounded with high probability by (n log n)1/2 If the adversary choosing the edges is oblivious to the orientation, then the graph of the odd edges is randomly oriented. For every node with neighborhood of size m by the Chernoff-Hoefding bound with probability at least (1-1/n2) the discrepancy is at most (m log n)1/2 All neighborhoods have of discrepancy at most (n log n)1/2 with probability at least 1-1/n Better than the deterministic lower bound!

20 From motorpool to vector rounding
Assume wlog that i=1n vji is an integer Consider the bit representation of (vj1, vj2 … vjn) use accuracy t= 2 d log j e (while preserving integrality) Run t motorpool instances simultaneously One for each bit position The tth problem: take the tth bits of (vj1, vj2 … vjn) and partition into pairs that are both 1’s from integrality there is an even number of such vectors Treat the pairs as edges in the motorpool problem, use the orientation to decide which bit to round up (adding 2t ) and which to round down (subtracting 2t ) Procedure preserves i=1n vji Continue with the next problem 12 … t Claim: if the discrepancy of each motorpool problem is bounded by (n,ℓ), then the discrepancy is bounded by 2(n, ℓ). True also for randomized algorithms

21 Global Greedy for general carpool problem
Given the schedule for the first j days only D1, D2, … Dj-1 and the assignment of drivers and day Dj have to decide who drives from Dj Global greedy rule: The driver is the one who will least increase the deviation from the FW-Shares. The one with the largest Li -FWi How to implement Global Greedy: Give people money (same amount initially) No need for more than n/2 On any given day the driver gets 1/d from all d-1 riders Who drives? the poorest one. Theorem: for any adversary scheduling the days the maximum unfairness of Global Greedy is at most (n-1)/2

22 The random label algorithm
Choose for each participant i a label infinite random binary string si 2 {0,1}∞ When i and j are matched let k be largest common prefix of si and sj Orient the edge according to whether si(k+1) or si(k+1) are 1 Switch si(k+1) and sj(k+1) Claim: at any point in time the discrepancy of participant i is bounded by the longest prefix ever used. Claim: for any sequence of edges at any point in time the si’s are random and independent from each other By induction on time Theorem: Maximum unfairness is with high probability O(log ℓ) For ℓ pairs of random strings the maximum common prefix is roughly 2log ℓ k si= … sj= …

23 Properties of the local greedy algorithm
The unfairness of participant i is bounded by the total number of people with whom i interacts (shows up on the same day). even if there is a very large carpool group, but i interacts with only a few of them, (say ni) then his unfairness will be very small (O(ni) deterministically and O((ni log n)1/2) probabilistically). There is no need for maintaining: global information, trusted bookkeeping, e.g. currency. It is enough that every two participants record their mutual history (actually a single bit). Probabilistic analysis of uniformly chosen edges: O(loglog n)

24 Axioms for Fair Sharing
For a given schedule D=D1, D2, … Dℓ want to assign for each participant i a fair share i(D). Requirements from the function : Full Coverage: the sum of the fair shares of all participants equals the total number of days in the schedule i=1n i(D)=ℓ. Symmetry: If two participants i and j have exactly the same schedule, that is they appear on the same set of days, then their fair shares should be the same. i(D)= j(D) Dummy: A participant that never shows on any day has share 0. Concatenation: Given two schedules D1 and D2 consider the schedule D=D1  D2 resulting from the concatenation of the two. Then the fair share of each player i for D is the sum of the fair shares of i for D1 and D2 i(D)=i(D1)+ i(D2).

25 Are the requirements self evident?
Full Coverage: the sum of the fair shares of all participants equals the total number of days in the schedule i=1n i(D)=ℓ. Symmetry: If two participants i and j have exactly the same schedule, the fair shares should be the same. i(D)= j(D) Dummy: A participant that never shows on any day has share 0. Concatenation: if D=D1  D2 then i(D)=i(D1)+ i(D2). We want to cover all days Essence of fairness What else can you require from someone who never shows up Ask some fitness clubs… If we don’t past behavior to unduly influence future returns

26 Uniqueness of FW Shares
Theorem: The FW Share is the unique one satisfying Full Coverage, Symmetry, Dummy and Concatenation. Proof: Concatenation implies: the fair share for ℓ days is just the sum of the fair shares for each day considered individually Full Coverage, Symmetry and Dummy imply that for a schedule consisting of day Dj only the fair share must be 1/|Dj| for those in Dj and 0 for the rest. Each one of the properties Full Coverage, Symmetry, Dummy and Concatenation is essential for uniqueness Conclusion: If someone objects to the load defined by FW, then they should point out which axiom they disagree with

27 Game Theory and the Shapley Value
Cooperative Game Theory: games where the outcome of the game is a coalition Coalitional games with transferable payoff defined by set N of players function v:2N  R assigning every non-empty S µ N a real number v(S). v(S) is viewed as the total payoff to be partitioned among the members of S Interesting question: Which coalition will be formed and what payoff each member should receive? There are many solution concepts for such games, with different axiomatic characterizations of the payoff vector. Shapley Value: The marginal contribution of i to S : i(S)=v(S [ {i}) - v(S) The Shapley value of i: i(v,N) = 1/|N|! P 2 P i(Si(P)) where P is the set of all possible |N|! orderings of N Si(P) is the set of players appearing before i in the order P. View: expected contribution of i to its predecessors given a random order of the players. Suggested by Lloyd Shapley in 1953 Has been used as a power index (voting) and for cost allocation

28 Shapley Value and Carpooling
Given a schedule D for the carpool problem define a coalitional game vD : The set N of players is the set of [n] participants. The value vD(S) of any subset S µ N is the number of days members of S showed up, i.e. vD(S) = |{1 · j · ℓ| Dj Å S   }| The marginal contribution of i to S i(S)=v(S [ {i}) - v(S) The Shapley value of i: i(v,N) = 1/|N|! P 2 P i(Si(P)) Theorem: for each player i the Shapley value of the game is: i(vD,N) ={1· j · ℓ | i 2 Dj} 1/|Dj|= FWi EP 2 P [i(Si(P))] = {j|i2Dj} Pr[i is first to arrive]= {j|i 2 Dj} 1/|Dj|

29 Objections and Counterobjections
For a given payoff vector an objection of player i against player j is an argument ``give me more or I will leave the game causing you to lose." A counterobjection is an argument ``It is true that if you leave then I will lose, but if I leave you lose at least as much" The Shapley value is the unique value where every objection is balanced by a counterobjection If we expect this sort of negotiation: the FW share is the reasonable expectation for a carpool to agree on

30 Further Research Can you find a probabilistic online algorithm where the unfairness is bounded by log n (and not log ℓ) Lower bound is (log n)1/3) What about trust and global information The random label algorithm needs a lot of trust For global greedy need currency The local greedy does not require trust, but best case is also the worst case Requires memory n Fairness of queuing [Raz, Levy, Avi-Itzhak] The fraction of the time a customer served is similar to those in the queue with him. Similar questions to what we have seen: offline vs. online…

31 References R. Fagin and J. Williams, A fair carpool scheduling algorithm, IBM Journal of Research and Development, M. Ajtai et al, Fairness in Scheduling, J. Algorithms 29(2), 1998, M. Naor, On Fairness in the Carpool Problem, R. Tijdman, The Chairman Assignment Problem, Discrete Math. 32 (1980) Adam Kalai, personal communication Osborne and Rubinstein, A Course in Game Theory, MIT Press, 1994.


Download ppt "How to Carpool Fairly Moni Naor."

Similar presentations


Ads by Google