# advertising-2 - CS 345 Data Mining Online algorithms Search...

This preview shows pages 1–13. Sign up to view the full content.

CS 345 Data Mining Online algorithms Search advertising

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Online algorithms ± Classic model of algorithms ² You get to see the entire input, then compute some function of it ² In this context, “offline algorithm” ± Online algorithm ² You get to see the input one piece at a time, and need to make irrevocable decisions along the way ± Similar to data stream models
Example: Bipartite matching 1 2 3 4 a b c d Girls Boys

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example: Bipartite matching 1 2 3 4 a b c d M = {(1,a),(2,b),(3,d)} is a matching Cardinality of matching = |M| = 3 Girls Boys
Example: Bipartite matching 1 2 3 4 a b c d Girls Boys M = {(1,c),(2,b),(3,d),(4,a)} is a perfect matching

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Matching Algorithm ± Problem: Find a maximum-cardinality matching for a given bipartite graph ² A perfect one if it exists ± There is a polynomial-time offline algorithm (Hopcroft and Karp 1973) ± But what if we don’t have the entire graph upfront?
Online problem ± Initially, we are given the set Boys ± In each round, one girl’s choices are revealed ± At that time, we have to decide to either: ² Pair the girl with a boy ² Don’t pair the girl with any boy ± Example of application: assigning tasks to servers

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Online problem 1 2 3 4 a b c d (1,a) (2,b) (3,d)
Greedy algorithm ± Pair the new girl with any eligible boy ² If there is none, don’t pair girl ± How good is the algorithm?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Competitive Ratio ± For input I, suppose greedy produces matching M greedy while an optimal matching is M opt Competitive ratio = min all possible inputs I (|M greedy |/|M opt |)
Analyzing the greedy algorithm ± Consider the set G of girls matched in M opt but not in M greedy ± Then it must be the case that every boy adjacent to girls in G is already matched in M greedy ± There must be at least |G| such boys ² Otherwise the optimal algorithm could not have matched all the G girls ± Therefore |M greedy | ¸ |G| = |M opt -M greedy | |M greedy |/|M opt | ¸ 1/2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Worst-case scenario 1 2 3 4 a b c (1,a) (2,b) d
This is the end of the preview. Sign up to access the rest of the document.

## This document was uploaded on 03/04/2012.

### Page1 / 37

advertising-2 - CS 345 Data Mining Online algorithms Search...

This preview shows document pages 1 - 13. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online