Download presentation
Presentation is loading. Please wait.
Published byCameron Caroline Page Modified over 9 years ago
1
1 Finite-State Online Algorithms and Their Automated Competitive Analysis Takashi Horiyama Kazuo Iwama Jun Kawahara Graduate School of Informatics, Kyoto University, Japan
2
2 What is the Automated Analysis? Analysis of algorithms Automated Analysis by a computer. We construct a general framework for automated analysis. Apply to … Online Knapsack Problem the competitive ratio upper bound 1.334 1.301 this method tight from the theoretical point of view, we need comprehensive performance analysis reduce # of cases by professional sense and techniques ordinary approach our approach (explained later)
3
3 Online Knapsack Problem (OKP) The player has a bin (size: 1.0) Input items: u 1, u 2,… (0 < u i <= 1.0) The player does not know next item. Action : puts it into the bin or discards it Goal: to maximize the content of the bin 0.6 0.7 0.4 0.6 0.7 Online Ex.) 0.6, 0.7, 0.4 are given in this order. If he knows his future inputs … 0.6 0.4
4
4 Evaluation Measure The online algorithm is evaluated by the Competitive Ratio (CR). CR = the benefit of Offline the benefit of Online Ex) 0.6, 0.7, 0.4 are given in this order. CR =1.42 1 0.7 Online 0.7 If Offline choose … 0.6 0.4 this benefit is 0.7 this benefit is 1 worst case of
5
5 0.4 0.3 0.2 0.4 Relaxation of the Condition The optimal CR of the 1-bin Online Knapsack Problem (OKP) is 1.618 [Iwama, Taketomi, 2002] We introduce a buffer bin which allows exchanging items between the two bins. Revocable Online Knapsack Problem (ROKP) 0.5 0.3 0.2 0.4 relaxation of the condition main binbuffer bin benefit = main bin
6
6 Our Main Results upper 1.334 13 case analysis by hand [ Iwama, Masanishi 2003 ] lower 1.281 lower 1.301 upper 1.301 automated analysis old new result CR OKP upper bound 1.618 lower bound 1.618 CR ROKP
7
7 Brief History of Our Project upper 1.334 lower 1.281 old (by hand) CR [ Iwama, Masanishi 2003 ] 1.334 automated analysis 1.281 By improving the base algorithm 1.301 important hint
8
8 Automated Proof by a Computer This is the theoretical and mathematical proof. two major difficulties –Each input item takes a real value between 0 and 1. –The number of states must be finite (# of items in the bin also). cf) a numerical simulation 0.0398 0.0319 0.9912 0.5764 0.7843 0.7490 0.5983 0.0432 0.2763 0.8468 0.9678 0.3982 0.6355 0.6631 0.6097 0.9667 0.3445 0.6335 … 0.6219 0.9784 0.9735 0.5505 0.1740 0.6999 0.8499 0.6960 0.6565 generate random values as item sizes, and calculate the CR
9
9 Past Results Using a Computer The four color problem [Appel and Haken, 1977] Kepler conjecture [Hales 1997] A 7/8-approximation algorithm for MAX 3SAT [Zwick, 2002] A computer is used to enumerate the finite pattern in above problems. our method We deal with infinite items directly. (representing finite states)
10
10 Proof of the lower bound (1.301) 0.409 0.680 0.769 The player X discards… (Case 1) 0.680 item. (Case 2) 0.409 item. (Case 3) 0.769 item. (t: a real root of 4x 3 + 5x 2 – x – 4 = 0) Theorem 1 Let X be any online algorithm for ROKP. Then CR(X) > 1/t – ε = 1.301. Proof: The adversary inputs 0.608, 0.409, 0.769.
11
11 Proof of the lower bound (1.301) 0.680, 0.409, 0.769 0.680 0.409 0.769 CR= 1.301 input discard input 0.320 (Case 1) discards 0.680. The Adversary inputs 0.320 (and stops). CR = 0.680 + 0.320 0.769 = 1.301 adversary (Offline) player X (Online) 0.680 0.409 0.769 0.320 0.680 0.409 0.769 0.320 0.680 0.769
12
12 Proof of the lower bound (1.301) 0.680, 0.409, 0.769 0.680 0.409 0.769 0.592 CR= 1.301 input discard input 0.320 CR= 1.301 input 0.591 (Case 1) discards 0.680. (Case 2) discards 0.409. (Case 3) discards 0.769. The Adversary inputs 0.320. CR = 0.680 + 0.320 0.769 = 1.301 The Adversary inputs 0.591. CR = 0.409 + 0.591 0.769 = 1.301 The next input is 0.592. input
13
13 Adversary’s Strategy for the lower bound (1.301) 0.680 0.409 0.769 0.592 CR= 1.301 0.680 0.409 0.592 0.320, 0.359 CR= 1.471 CR= 1.301 CR= 1.401 CR= 1.301 CR= 1.301 CR= 1.304 discard 0.680 0.409 0.320 0.359 input 0.320 CR= 1.301 input 0.591 input 0.320 input 0.591 input 0.320 input 0.680 0.680, 0.409, 0.769 input
14
14 Outline of the Proof lower 1.301 upper 1.301 prove by using a computer ROKP Design an online algorithm A. Theorem2 The online algorithm A achieves the CR 1.301. CR 1. Enumerate all states 2. Prove CR < 1.301 for each state The process of the proof already proved now proving
15
15 Designing Online Algorithm A When the item u is given... ・ If room exists for the current item, hold u. ・ If the main bin has benefit >= t, then discard all the other items. ・ Otherwise discard some item(s). t =1 / 1.301 = 0.77 XSSSXL 01 0.590.23 0.41 0.54 0.77 MM ML LL 1-t1-t 1-t21-t2 t2t2 t 2t-1 0.46 MS 2-2t ALG decides discarding item(s) into bins. the classification on the sizes of the items
16
16 How to Discard items If there are two or more items in the same class, the player discards one of them. ex) LL, LL, MM --> discard LL If there are two items in SS and an item in LL, SS + SS discard LL. SS + SS >= LL for all combinations --> discard SS. Otherwise (exception), –MS, ML, LL --> discard ML. –MM, ML, LL --> discard ML.
17
17 Proof of the upper bound State 0 SS is given SS State 1 MS is given MS State 2 … LL is given … LL State 3 2. Prove CR < 1.301 for each state. 1. Enumerate all states (making state diagram). SS State 4 SS CR < 1.301 …
18
18 1. Enumerate all states. empty SSMSMMMLLLSS, SSSS, MSSS, MM MS SS MM END STATE ML LL SS, LL ? t ≦ SS + ML ≦ 1 SS MS MM ML LL
19
19 Can SS and LL be held in the same bin? case by case. 0.3 0.6 0.4 0.7 SS LL SS LL SS + LL <= 1SS + LL > 1 can hold the twocannot other case division SS + MS < t SS + MS >= t SS : 0.23 ~ 0.41 L L : 0.59 ~ 0.77
20
20 Can SS and LL be held in the same bin? SS 1 State i SS 1 State j LL 1 LL 1 is given, and SS 1 + LL 1 ≦ 1 LL 1 is given, and SS 1 + LL 1 > 1 SS 1 State k LL 1 SS 1 + LL 1 ≦ 1 SS 1 + LL 1 > 1 necessary to memorize as ‘condition’ END_STATE
21
21 If items are discarded,… empty LLSS, LL … SS … SS, LL LL LL H ALG selects discarding item(s) among SS, LL, LL. … … necessary to memorize as ‘history’ LL
22
22 Why states are finite? state : current items, history, and condition “Current items” are finite clearly (XS can be ignored). “History” is finite. Because we need not memorize more number. For example, the player can put at most two items in MS into one bin. We memorize “MS + H2 ” which means “MS × two or more”. t =1 / 1.301 = 0.77 XSSSXL 01 0.590.23 0.41 0.54 0.77 MM ML LL 1-t1-t 1-t21-t2 t2t2 t 2t-1 0.46 MS 2-2t
23
23 Why states are finite? state : current items, history, and condition “Current items” are finite clearly. “History” is finite. Because we need not to memorize more number. “Condition” is also finite. Because the form of the inequality is given below. t =1 / 1.301 = 0.77 XSSSXL 01 0.590.23 0.41 0.54 0.77 MM ML LL 1-t1-t 1-t21-t2 t2t2 t 2t-1 0.46 MS 2-2t ○ + ○ ≦ 1○ + ○ < t○ ≦ ○ ○ + ○ > 1 ○ + ○ ≧ t
24
24 Generated the State Diagram generated by the Java Program our state diagram has 276 states.
25
25 Outline of the Proof lower 1.301 upper 1.301 prove by using a computer ROKP Design online algorithm A. Theorem2 The online algorithm A achieves the CR 1.301. CR 1. Enumerate all states 2. Prove CR < 1.301 for each state The process of the proof already proved now proving
26
26 the proof of CR<1.301 (1) CR = the best possible sum of the items in the bin the best possible sum of the items in the history for checking CR < αset up to inequalities the benefit of Offline the benefit of Online (α = 1.301)
27
27 ∀ the combination G in the history, ∃ the combination A in the bin, and is satisfied. the proof of CR<1.301 (2) ∀ the combination G in the history, ∀ the combination A in the bin, and (sum of items in G) ≧ α× (sum of items in A) is satisfied. converse of the The summation of items in G The summation of items in A < α< α is never satisfied
28
28 the proof of CR<1.301 (3) Ex) state : current SS 1, SS 2, LL 1, history SS H 1, condition SS 1 + LL 1 > 1, SS H 1 + LL 1 > 1,… We suppose G = {SS 2,SS H 1 } as the comb. in history. possible comb. of Online is {SS 1 },{SS 2 },{SS 1,SS 2 },{LL 1 }. SS 2 + SS H 1 ≧ α × (SS 1 ) SS 2 + SS H 1 ≧ α × (SS 2 ) SS 2 + SS H 1 ≧ α × (SS 1 + SS 2 ) SS 2 + SS H 1 ≧ α × (LL 1 ) further, the range of class 1-t < SS 1 ≦ 1-t 2 1-t < SS 2 ≦ 1-t 2 1-t < SS H 1 ≦ 1-t 2 t 2 < LL 1 ≦ t inequalities of the condition SS 1 + LL 1 > 1 SS H 1 + LL 1 > 1 … Our purpose is to prove these inequalities are never satisfied. We prove this for all comb. in history.
29
29 t = -5/12 + 1/12(649 - 6Sqrt[10293])^(1/3) + 1/12(649 + 6Sqrt[10293])^(1/3) α = 1 / t Developer`InequalityInstance[ {a (SS1) <= SS2 + Ll1,a (SS2) <= SS2 + Ll1,a (SS1 + SS2) <= SS2 + Ll1,a (Ll1) <= SS2 + Ll1, SS1 + SS2 1, SS1 + Ll1>1, SS1 + Ll2>1, SS2 + Ll1>1, SS2 + Ll2>1, SS3 + Ll1>1, SS3 + Ll2>1, Ll1 Ll2, …continue -t + 1 < SS1 <= -t^2 + 1, -t + 1 < SS2 <= -t^2 + 1, -t + 1 < SS3 <= -t^2 + 1, t^2 < Ll1 <= t, t^2 < Ll2 <= t }, {SS1, SS2, SS3, Ll1, Ll2} ] We check the existence of the solutions of the inequalities by Mathematica. There are 1715 cases.
30
30 Results and Conclusion Generate state diagram: at less than 10 seconds by Athlon XP 2600. Our state diagram has 276 states. checking CR < 1.301: 1715 sets of inequalities. solved by Mathematica at 30 minutes. We prove CR < 1.301 for all states. Are there any application which can use this method?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.