Presentation is loading. Please wait.

Presentation is loading. Please wait.

From marriage problem to t sailor assignment and AdWords

Similar presentations


Presentation on theme: "From marriage problem to t sailor assignment and AdWords"— Presentation transcript:

1 From marriage problem to t sailor assignment and AdWords
MATCHING: from marriage to sailor to AdWords G. Hernandez UofM / UNAL Colombia  From marriage problem to t sailor assignment and AdWords Based on: “The Mathematics Of 1950’s Dating: Who wins The Battle of The Sexes?”` from Great Theoretical Ideas in Computer Science “New Market Models and Algorithms'‘ talk form V. Vazirani

2 Outline Matching , Assignment and Correspondence Problems
The Stable Marriage Problem Gale-Shapley Algorithm Linear Assignment Problem Kuhn-Munkres Algorithm The Sailor Assignment Problem KM extension EMOAs, HMOAs The Google AdWords Problem

3 1. Matching's , assignments and correspondence problems

4 There are n (agents, boys, sailors, bets)
and n (agents, girls, sailors, adwords) We may have restrictions on the agents can perform the particular tasks We may have preference lists or a cost of assigning an agent to a task, or both Question: How do we pair, match, assign, make them correspond off in an optimal way ?

5 2. The Stable Marriage Problem
The Traditional Marriage Problem 1 2 3 Taken from

6 Question: How do we pair them off?
Dating Scenario There are n boys and n girls Each girl has her own ranked preference list of all the boys Each boy has his own ranked preference list of the girls The lists have no ties Question: How do we pair them off?

7 3,2,5,1,4 3,5,2,1,4 1 1 1,2,5,3,4 5,2,1,4,3 2 2 4,3,2,1,5 4,3,5,1,2 3 3 1,3,4,2,5 1,2,3,4,5 4 4 1,2,4,5,3 2,3,4,1,5 5 5

8 More Than One Notion of What Constitutes A “Good” Pairing
Maximizing total satisfaction Hong Kong and to an extent the USA Maximizing the minimum satisfaction Western Europe Minimizing maximum difference in mate ranks Sweden Maximizing people who get their first choice Barbie and Ken Land

9 Rogue Couples - Instability
Suppose we pair off all the boys and girls Now suppose that some boy and some girl prefer each other to the people to whom they are paired They will be called a rogue couple

10 Why be with them when we can be with each other?

11 What use is fairness, if it is not stable?
Any list of criteria for a good pairing for “marriage” must include stability. If the pairing can be challenged in an open market it is doomed if it contains a rogue couple. Que aplicacion es equilibrada si no es estable? Doomed = fatal

12 Stable Pairings A pairing of boys and girls is called stable if it contains no rogue couples

13 Stable Pairings A pairing of boys and girls is called stable if it contains no rogue couples 3,2,1 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

14 The Traditional Marriage Algorithm
Female Worshipping Males String

15 The Traditional Marriage Algorithm
Gale-Shapley For each day that some boy gets a “No” do: Morning Each girl stands on her balcony Each boy proposes to the best girl whom he has not yet crossed off Afternoon (for girls with at least one suitor) To today’s best: “Maybe, return tomorrow” To any others: “No, I will never marry you” Evening Any rejected boy crosses the girl off his list If no boys get a “No”, each girl marries boy to whom she just said “maybe”

16 The Traditional Marriage Algorithm
3,1,2 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

17 The Traditional Marriage Algorithm
3,1,2 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

18 The Traditional Marriage Algorithm
3,1,2 X 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

19 The Traditional Marriage Algorithm
3,1,2 X 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

20 The Traditional Marriage Algorithm
3,1,2 X X 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

21 The Traditional Marriage Algorithm
3,1,2 X X 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

22 The Traditional Marriage Algorithm
3,1,2 X X 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

23 The Traditional Marriage Algorithm
3,1,2 3,2,1 1 1 1,2,3 2,1,3 2 2 3,2,1 3,1,2 3 3

24 The TMA always terminates in at most n2 days.
A “master list” of all n of the boys lists starts with a total of n x n = n2 girls on it Each day that at least one boy gets a “No”, so at least one girl gets crossed off the master list Therefore, the number of days is bounded by the original size of the master list TMA always produces a male-optimal, female-pessimal pairing. A “master list” of all n of the boys lists starts with a total of n x n = n2 girls on it Each day that at least one boy gets a “No”, so at least one girl gets crossed off the master list Therefore, the number of days is bounded by the original size of the master list A boy’s optimal girl is the highest ranked girl for whom there is some stable pairing in which the boy gets her

25 TMA Related problems! Weighted matching Stable roommates
hospitals/residents problem hospitals/residents problem with couples

26 Current real applications of TMA!
National Resident Matching Program The National Resident Matching Program (NRMP) is a private, not-for-profit corporation established in 1952 to provide a uniform date of appointment to positions in graduate medical education (GME) in the United States.

27 3. The Linear Assignment Problem
Tasks Agents r0,0 1 1 r1, r1,2 r1,3 … r1,n r2,1 r2,2 r2,3 … r2,n : rn, rn,2 rn,3 … rn,n . n! assignments 2 2 3 3 . . rn,n n n Complete Bipartite Graph

28 LAP Kuhn-Munkres Algorithm
The Kuhn- Munkers (Hungarian) algorithm is used to find an optimum (maximum or minimum weight) matching in a complete bipartite graph in time O(n3 ) Step 1:  For each row of the matrix, find the smallest element and subtract it from every element in its row. 

29 LAP Kuhn-Munkres Algorithm
Step 2:  Find a zero (Z) in the resulting matrix.  If there is no starred zero in its row or column, star Z. Repeat for each element in the matrix. Step 3:  Cover each column containing a starred zero.  If n columns are covered, the starred zeros describe a complete set of unique assignments.  In this case STOP.

30 LAP Kuhn-Munkres Algorithm
Step 2:  Find a zero (Z) in the resulting matrix.  If there is no starred zero in its row or column, star Z. Repeat for each element in the matrix. Step 3:  Cover each column containing a starred zero.  If n columns are covered, the starred zeros describe a complete set of unique assignments.  In this case STOP.

31 LAP Kuhn-Munkres Algorithm
Step 4: Find a uncovered zero and prime it.  If there is no starred zero in the row containing this primed zero, Go to Step 5.  Otherwise, cover this row and uncover the column containing the starred zero. Continue in this manner until there are no uncovered zeros left. Save the smallest uncovered value and Go to Step 6. Step 5:  Construct a series of alternating primed and starred zeros as follows.  Let Z0 represent the uncovered primed zero found in Step 4.  Let Z1 denote the starred zero in the column of Z0 (if any). Let Z2 denote the primed zero in the row of Z1 (there will always be one).  Continue until the series terminates at a primed zero that has no starred zero in its column.  Unstar each starred zero of the series, star each primed zero of the series, erase all primes and uncover every line in the matrix.  Return to Step 3. Step 6:  Add the value found in Step 4 to every element of each covered row, and subtract it from every element of each uncovered column.  Return to Step 4 without altering any stars, primes, or covered lines.

32 LAP Kuhn-Munkres Algorithm
Step: 4 Step: 6 Step: 4 Step: 5 Step: 3 Final Solution

33 LAP Kuhn-Munkres Algorithm
Thm(Konig)

34 LAP Kuhn-Munkres Algorithm
Ford-Fulkersonn

35 4. The Sailor Assignment Problem
Sailors 120,000/year 1,000-10,000 to be assigned every two weeks Commanders Jobs database XML DB Four objectives TS PCS SR CR Detailers 200

36 MK algorithm applied to SAP
Sailors Jobs 2 3 4 5 1 6 7 dummy SAP is multi-objective whereas LAP is single-objective. Solution: use of weight vectors In case of SAP, we do not have a complete bipartite graph (many infinite values for big instances with). Solution: sparse matrix represent. Sometimes we do not have a complete matching (conflicts), in those case MK does not work. Solution: The use of dummy jobs. Problems

37 Sparse Matrix representation
MK algorithm applied to SAP 1 2 3 . n r1,1 r1,2 k r1,k …. FTS1,1 FPCS1,1 FSR1,1 FCR1,1 Job ID Sailor-Job Information Reduced rating Sailor Array (List) Sparse Matrix representation Weight vectors r0,0 r0,1  …  rd0  …  r1,0 r1,1  …   rd1 …  : : rn,0 rn,  …    … rdn r0,0 r0,1  …  r1,0 r1,1  …  : rn,0 rn,  …  Dummy jobs After adding dummy jobs in the matrix

38 MK algorithm applied to SAP
SAP Instances properties and improvements in execution time

39 Evolutionary algorithms applied to SAP
Simple GAs / Gale-Sapley, Garret et al, 05. EMOAs, Hybird= EMOAs + Local Search, Gale-Sapley, Garret et al, 07 EMOAs with KM initialization, Dasgupta, Hernandez, Garret et al, 08

40 Evolutionary algorithms applied to SAP
Simple GAs / Gale-Sapley, Garret et al, 05. EMOAs, Hybird= EMOAs + Local Search, Gale-Sapley, Garret et al, 07 EMOAs with KM initialization, Dasgupta, Hernandez, Garret et al, 08

41 EMOAs = NSGAII , SPEA2

42 RESULTS KM(287) NSGAII NGSA(300)-KM (5)

43 Paid for each “impression”
4. The AdWords Problem Web QUERY Google Yahoo! MSN Paid for each “impression” links! Pais when someone clicks on Advertisers

44

45 Cartagena Orlando

46

47 New algorithmic and game-theoretic questions
Monika Henzinger, 2004: Find on-line algorithm to maximize Google’s revenue. Queries are coming on-line. Instantaneously decide which bidder gets it.

48 APP The Adwords Problem

49 The Adwords Problem: Search Engine N advertisers;
Daily Budgets B1, B2, …, BN Each advertiser provides bids for keywords he is interested in. Search Engine

50 The Adwords Problem: Search Engine N advertisers;
Daily Budgets B1, B2, …, BN Each advertiser provides bids for keywords he is interested in. Search Engine queries (online)

51 The Adwords Problem: Search Engine N advertisers;
Daily Budgets B1, B2, …, BN Each advertiser provides bids for keywords he is interested in. Search Engine Select one Ad Advertiser pays his bid queries (online)

52 The Adwords Problem: Search Engine N advertisers;
Daily Budgets B1, B2, …, BN Each advertiser provides bids for keywords he is interested in. Search Engine Select one Ad Advertiser pays his bid queries (online) Maximize total revenue Online competitive analysis - compare with best offline allocation

53 The Adwords Problem: Search Engine N advertisers;
Daily Budgets B1, B2, …, BN Each advertiser provides bids for keywords he is interested in. Search Engine Select one Ad Advertiser pays his bid queries (online) Maximize total revenue Example – Assign to highest bidder: only ½ the offline revenue

54 Example: Book CD LOST Revenue 100$ Bidder 1 Bidder 2 Bidder1 Bidder 2
$1 $0.99 $0 Book Queries: 100 Books then 100 CDs CD B1 = B2 = $100 Bidder Bidder 2 Algorithm Greedy LOST Revenue 100$

55 Example: Book CD Revenue 199$ Bidder 1 Bidder 2 Bidder1 Bidder 2
$1 $0.99 $0 Book Queries: 100 Books then 100 CDs CD B1 = B2 = $100 Bidder Bidder 2 Optimal Allocation Revenue 199$

56 Generalizes online bipartite matching
Each daily budget is $1, and each bid is $0/1. In the mathematical field of graph theory, a bipartite graph is a graph whose vertices can be divided into two disjoint sets V1 and V2 such that every edge connects a vertex in V1 and one in V2; that is, there is no edge between two vertices in the same set.

57 Online bipartite matching
advertisers (boys) queries (girls)

58 Online bipartite matching
advertisers (boys) queries (girls)

59 Online bipartite matching
advertisers (boys) queries (girls)

60 Online bipartite matching
advertisers (boys) queries (girls)

61 Online bipartite matching
advertisers (boys) queries (girls)

62 Online bipartite matching
advertisers (boys) queries (girls)

63 Online bipartite matching
advertisers (boys) queries (girls)

64 Online bipartite matching
Karp, Vazirani & Vazirani, 1990: Online optimal (1-1/e =0.63)n matching . 2n nodes bipartite graph Perfect matching (n pairs). Any deterministic online algorithm has expected value <= RANDOM (adversary) 1/2n Ranking aleatorio

65 Online bipartite matching
RANDOM Algorithm . NO FUNCION BIEN POR QUE ES FACIL DE ENGA;AR Ranking beneficia a un nodo que no ha sido escogido

66 Online bipartite matching
queries (girls) advertisers (boys) n/2 : n/2 :

67 Online bipartite matching
queries (girls) advertisers (boys) n/2 : n/2 :

68 Online bipartite matching
advertisers (boys) queries (girls) Any deterministic online algorithm has expected value on this instance <= (1-1/e)n n/2 : :

69 Online bipartite matching
Karp, Vazirani & Vazirani, 1990: RANKING: Rank by random permutation the boys vertices at the beging As each girl arrives, match her to the eligible boy, if any, of highest rank. Expected number of pairs n (1-1/e) + o(n) Optimal. Ranking aleatorio

70 Online bipartite matching
Kalyanasundaram & Pruhs, 2000: On-line deterministic algorithm: 1-1/e factor algorithm for b-matching: Daily budgets $b, bids $0/1, b>>1 Awards the query to the interested advertiser who has the highest unspent budget. Asigna el query al que tiene el mas alto presupuesto sin gastar

71 Adwords Problem Mehta, Saberi, Vazirani & Vazirani, 2005:
1-1/e algorithm, assuming budgets>>bids. bids = 0, 1 or 2. Natural extension of KP00 that assigns the query to the highest bidder, in case of ties: the largest remaining budget. strictly smaller and Bounded Away from 1-1/e. Tratar de generalizar el anterior alg deterministico.

72 Adwords Problem Mehta, Saberi, Vazirani & Vazirani, 2007:
1-1/e algorithm, assuming budgets>>bids. A bidder pays only if the user clicks on his ad. Advertisers have different daily budgets. Instead of charging a bidder his actual bid, the search engine company charges him the next highest bid. Multiple ads can appear with the results of a query. Advertisers enter at different times. Optimal!

73 New Algorithmic Technique
Idea: Use both bid and fraction of left-over budget

74 New Algorithmic Technique
Idea: Use both bid and fraction of left-over budget Correct tradeoff given by tradeoff-revealing family of LP’s

75 New Algorithmic Technique
The optimal tradeoff function is: ψ(x) = 1 – e -x

76 Algorithm Allocate the next query to the bidder i maximizing the product of his bid and ψ(T(i)), where T(i) is the fraction of the bidder´s budget which has been spent so far, i.e., T(i) = mi / bi , where bi is the total budget of bidder i, mi is the amount of money spent by bidder i when the query arrives. The algorithm assumes that the daily budget of advertisers is large compared to their bids.

77 d*ψ(rank / n) Randomized Technique
The randomized algorithm CHOSES a random permutation of ADVERTISERS in advance, and rank the ads in order of Where d is the bid and n is the total number of advertisers and rank is the advertiser’s rank in the permutation d*ψ(rank / n)

78 Algorithm Google, then, will maximize its profits if it allocates queries to the advertiser with the highest value of d*ψ(f), where d is the bid and f is rank of the fraction of the budget that has not yet been spent.

79 Research directions The current algorithm assumes that Google has no advance information about each day´s sequence of queries when, in fact, it does. Theoretic Angle: A ranking algorithm should minimize manipulation of the market by encouraging advertisers to reveal their true valuations for a given keyword and their true daily budgets.

80 What is needed today? An inherently algorithmic theory of
market equilibrium New models that capture new markets

81 Beginnings of such a theory, within
Algorithmic Game Theory Started with combinatorial algorithms for traditional market models New market models emerging

82 Open issues Strongly poly algs for approximating
nonlinear convex programs equilibria Insights into congestion control protocols?

83 Open issues Borgs et al, gave some evidence that it is impossible to design a truthful mechanism in the presence of budget constraints. [BCI+05]

84 References D. Gale and L. S. Shapley: College Admissions and the Stability of Marriage, American Mathematical Monthly 69, 9-14, 1962. R.M. Karp, U.V. Vazirani, and V.V. Vazirani. An optimal algorithm for online bipartite matching. In proceedings of the 22nd Annual ACM Symposium on Theory of Computing, 1990. Mehta, A.   Saberi, A.   Vazirani, U.   Vazirani, V.   AdWords and Generalized On-line Matching. Journal of the ACM 2007. C. Borgs, J. Chayes, N. Inmmorlica, M. Mahdian, and A. Saberi. Multi-unit auctions with budget-constrained bidders. In ACM conference on electronic commerce B. Kalyanasundaram and K.R. Pruhs. An optimal deterministic algorithm for online b -matching. Theoretical Computer Science, 233(1{2):319{-25, 2000. Computer Scientists Optimize Innovative Ad Auction, SIAM News, Volume 38, Number 3, April 2005.


Download ppt "From marriage problem to t sailor assignment and AdWords"

Similar presentations


Ads by Google