Presentation is loading. Please wait.

Presentation is loading. Please wait.

How to Carpool Fairly Moni Naor. The carpool problem A group of n people form a carpool. – Each day a subset arrives to a (fixed) gathering point and.

Similar presentations


Presentation on theme: "How to Carpool Fairly Moni Naor. The carpool problem A group of n people form a carpool. – Each day a subset arrives to a (fixed) gathering point and."— 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 D1D1 D2D2 D3D3 D4D4 D5D5 D6D6 D7D7 D8D8 D9D9 D 10 1234512345 xxxxxx xxxx xxxxxx xxxxxx x xxxxxxxx xxxxxx xxxxxx xxxxxxxx xxxx 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 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 d i people show on day D i they should each `pay’ 1/d i 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 = D 1, D 2, … D ℓ where D j µ [n] corresponds to the people who show up on day j FW-Share for participant i : FW i =  { 1 · j · ℓ | i 2 Dj } 1/|D j | The FW shares sum up to ℓ :  i=1 n FW i =  i=1 n  { j | i 2 Dj } 1/|D j |= ℓ

6 The Example with FW Shares D1D1 D2D2 D3D3 D4D4 D5D5 D6D6 D7D7 D8D8 D9D9 D 10 FW-Share 1234512345 xxxxxx xxxx xxxxxx xxxxxx x xxxxxxxx xxxxxx xxxxxx xxxxxxxx xxxx 4 ¢⅓ + ¼ ⅓ +1¾ 1 ½ 2 ½ 4 ¢⅓ +1 ⅓ ½ ⅓⅓ 1¼ ⅓⅓ ¼½ 10 For repeated schedule differences are very significant!

7 How close can we get to the FW Share? Given a schedule D 1, D 2, … 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 V 1, V 2, … V ℓ Find a list of n dimensional vectors over the integers Z 1, Z 2, … Z ℓ Where each Z j = (z j 1, z j 2 … z j n ) is a rounding of V j = (v j 1, v j 2 … v j n ) that preserves the sum Preservation Requirements: Each entry is rounded: for all 1 · j · ℓ, 1 · i · n b v j i c · z j i · d v j i e Each column sum is preserved: for all 1 · j · ℓ b  i= 1 n v j i c ·  i= 1 n z j i · d  i= 1 n v j i e Each row sum is preserved: for all 1 · i · n b  j= 1 ℓ v j i c ·  j= 1 ℓ z j i · d  j= 1 ℓ v j i e

11 Casting the carpool problem as vector rounding For each day D j a vector V j = (v j 1, v j 2 … v j n ) where for all 1 · i · n v j i = 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 b FW i c or d FW i e times. –Given any integer rounding L i of the FW i ’s that preserves their sum always possible to find an assignment to the carpool problem where each participant i drives L i times (the load on i ) add a vector V 0 where v 0 i = L i -FW i 1/|D j | if j 2 D j 0 otherwise

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

13 A flow problem Modified Preservation Requirements: Make u j i = v j i - b v j i c and x j i =z j i - b v j i c for all 1 · j · ℓ, 1 · i · n 0 · x j i · 1 for all 1 · j · ℓ b  i= 1 n u j i c ·  i= 1 n x j i · d  i= 1 n u j i e for all 1 · i · n b  j= 1 ℓ u j i c ·  j= 1 ℓ x j i · d  j= 1 ℓ u j i e rowscolumns d u j i e d  i=1 n u j i e b  j=1 ℓ  i=1 n u j i c d  j=1 ℓ u j i e Flow problems with integral constraints have only integral bfs

14 Alternative proof for the existence of an assignment satisfying the FW Share Assume wlog all the FW i are integral Start with any assignment and suppose that not all the participants get FW i. 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 FW i 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 FW i 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 D 1, D 2, … D j How to measure the unfairness of –An assignment Maximum deviation from the FW-Share max 1 · i · n |L i -FW i | –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) Claim : for any method of orienting the edges the adversary’s algorithm stops after O(n 3 ) steps. 012-2  

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

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/n 2 ) 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= 1 n v j i is an integer Consider the bit representation of (v j 1, v j 2 … v j n ) –use accuracy t= 2 d log j e (while preserving integrality) – Run t motorpool instances simultaneously One for each bit position The t th problem: take the t th bits of (v j 1, v j 2 … v j n ) 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 2 t ) and which to round down (subtracting 2 t ) Procedure preserves  i= 1 n v j i Continue with the next problem 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 0.1100110010 12 … t

21 Global Greedy for general carpool problem Given the schedule for the first j days only D 1, D 2, … D j-1 and the assignment of drivers and day D j have to decide who drives from D j Global greedy rule: The driver is the one who will least increase the deviation from the FW-Shares. The one with the largest L i -FW i 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 s i 2 {0,1} ∞ When i and j are matched let k be largest common prefix of s i and s j Orient the edge according to whether s i (k+1) or s i (k+1) are 1 Switch s i (k+1) and s j (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 s i ’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 2 log ℓ s i = 01100110010110… s j =01100101011001… k

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 n i ) then his unfairness will be very small ( O(n i ) deterministically and O((n i 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 D D For a given schedule D=D 1, D 2, … 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 D  i= 1 n  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. DD  i (D)=  j (D) Dummy : A participant that never shows on any day has share 0. DDD=DD D DD Concatenation : Given two schedules D 1 and D 2 consider the schedule D=D 1  D 2 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 D 1 and D 2 DDD  i (D)=  i (D 1 )+  i (D 2 ).

25 Are the requirements self evident? D Full Coverage : the sum of the fair shares of all participants equals the total number of days in the schedule  i= 1 n  i (D)=ℓ. Symmetry : If two participants i and j have exactly the same schedule, the fair shares should be the same. DD  i (D)=  j (D) Dummy : A participant that never shows on any day has share 0. D=DDDDD Concatenation : if D=D 1  D 2 then  i (D)=  i (D 1 )+  i (D 2 ). 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 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 D j only the fair share must be 1/|D j | for those in D j and 0 for the rest. Theorem : The FW Share is the unique one satisfying Full Coverage, Symmetry, Dummy and Concatenation. 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:2 N  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 (S i (P)) where – P is the set of all possible |N|! orderings of N – S i (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 D D Given a schedule D for the carpool problem define a coalitional game v D : The set N of players is the set of [n] participants. DThe value v D ( S) of any subset S µ N is the number of days members of S showed up, i.e. D v D (S) = |{1 · j · ℓ| D j Å 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 (S i (P)) Theorem: for each player i the Shapley value of the game is : D  i ( v D,N ) =  { 1 · j · ℓ | i 2 Dj } 1/|D j |= FW i E P 2 P [  i (S i (P))] =  {j|i 2 Dj} Pr[i is first to arrive]=  {j|i 2 Dj} 1/|D j |

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, 1983. M. Ajtai et al, Fairness in Scheduling, J. Algorithms 29(2), 1998, www.wisdom.weizmann.ac.il/~naor/PAPERS/carpool_abs.html M. Naor, On Fairness in the Carpool Problem, www.wisdom.weizmann.ac.il/~naor/PAPERS/fair_abs.html 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. The carpool problem A group of n people form a carpool. – Each day a subset arrives to a (fixed) gathering point and."

Similar presentations


Ads by Google