Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instructor: Shengyu Zhang 1. Offline algorithms Almost all algorithms we encountered in this course assume that the entire input is given all at once.

Similar presentations


Presentation on theme: "Instructor: Shengyu Zhang 1. Offline algorithms Almost all algorithms we encountered in this course assume that the entire input is given all at once."— Presentation transcript:

1 Instructor: Shengyu Zhang 1

2 Offline algorithms Almost all algorithms we encountered in this course assume that the entire input is given all at once. An exception: Secretary problem.  The input is given gradually.  We need to respond to each candidate in time.  We care about our performance compared to the best one in hindsight. 2

3 Online algorithms The input is revealed in parts. An online algorithm needs to respond to each part (of the input) upon its arrival. The responding actions cannot be canceled/revoked later. We care about the competitive ratio, which compares the performance of an online algorithm to that of the best offline algorithm.  Offline: the entire input is given beforehand. 3

4 Ski rental 4

5 Offline algorithm 5

6 Deterministic algorithm 6

7 Randomized algorithm 7

8 Integer programming 8

9 Solution 9

10 Relaxation 10

11 The relaxation doesn’t lose anything 11

12 Dual LP 12

13 13

14 Property 1 14

15 Property 1 15

16 16

17 Property 2 17

18 18

19 Turning into an online algorithm 19 … rentbuy

20 Expected cost 20

21 21

22 22

23 Optimality: Both deterministic and randomized algorithms are optimal.  No better competitive ratio is possible. Reference: The design of competitive online algorithms via a primal dual approach, Niv Buchbinder and Joseph Naor, Foundations and Trends in Theoretical Computer Science, Vol. 3, pp. 93-263, 2007. Next: Another learning algorithm 23

24 Stock market Simplification: Only consider up or down. 24

25 Which expert to follow? 25

26 Which expert to follow? Each day, stock market goes up or down. At the end of the day, we’ll see whether the market actually goes up or down. We lose 1 if our prediction was wrong. 26

27 After a year, we’ll see with hindsight that one expert is the best.  But, of course, we don’t know who in advance. We’ll think “If we had followed his advice…” Theorem: We have a method to perform close to the best expert!  We don’t assume anything about the experts. They may not know what they are talking about. They may even collaborate in any bad manner. 27

28 Method and intuition 28

29 Randomized Weighted Majority Decrease your weight! Probability is proportional to weight 29

30 Example (n=5, T=6, ε = 1/4) 12345ourreal 1 1, ↑ 1, ↓1, ↑1, ↓↑↑ 2 1, ↑1, ↓0.75, ↑1, ↑0.75, ↑↑↑ 3 1, ↑0.75, ↑0.75, ↓1, ↓0.75, ↑↓↓ 4 0.5625, ↑0.75, ↓ 0.5625, ↑↑↓ 5 0.5625, ↓0.4219, ↑0.75, ↑0.75, ↓0.4219, ↓↓↑ 6 0.4219, ↑ 0.75, ↓0.5625, ↑0.3164, ↑↓↓ loss 441252 Numbers: weight Arrows: predications. Red: wrong. 30

31 31

32 Proof 32

33 33

34 34

35 Extensions 35

36 Summary Online algorithms:  The input is revealed in parts.  We need to respond to each part upon its arrival.  The responding actions cannot be revoked later. competitive ratio: performance of an online algorithm vs. performance of the best offline algorithm. Primal-dual method. Multiplicative weight update method. 36


Download ppt "Instructor: Shengyu Zhang 1. Offline algorithms Almost all algorithms we encountered in this course assume that the entire input is given all at once."

Similar presentations


Ads by Google