Quantum Algorithms for Quantum Algorithms for Evaluating M IN Evaluating M IN -M -M AX AX Trees Trees Richard Cleve Dmitry Gavinsky D. L. Yonge-Mallo Institute for Quantum Computing, University of Waterloo January 30, 2008 TQC – Tokyo, Japan
Motivation Motivation ● Why do we care about algorithms for M algorithms for M IN - IN - M AX trees, anyway? M AX trees ● What is so special about the quantum quantum algorithms for M IN -M AX trees that I'm algorithms about to present? – The ideas behind them don't work in a The ideas behind them don't work in a classical setting! classical setting! – Conversely, the classical ideas don't work in a quantum setting! 2
Why do we care about M Why do we care about M IN IN -M -M AX AX trees? trees? M IN -M AX trees arise in the analysis of deterministic games of perfect information between two players who alternate taking turns 3
Why do we care about M Why do we care about M IN IN -M -M AX AX trees? trees? M IN -M AX trees arise in the analysis of deterministic games of perfect information between two players who alternate taking turns MIN MAX MAX MAX 4 1 2 5 7 8 6 9 3 4
What is a M IN -M AX tree? What is a M IN -M AX tree? internal nodes are M IN and M AX gates at alternating levels; ● leaves x 1 ,...,x N take on values from some ordered set; ● value is value of root as a function of x 1 ,...,x N . ● MIN MAX MAX MAX 4 1 2 5 7 8 6 9 3 5
Evaluating a M IN -M AX tree Evaluating a M IN -M AX tree 4 MIN 4 8 9 MAX MAX MAX 4 8 9 7 1 2 5 6 3 6
Alpha-beta pruning Alpha-beta pruning 4 MIN 4 ⩾ 5 ⩾ 6 MAX MAX MAX 4 8 9 7 1 2 5 6 3 7
M IN -M AX trees and A ND -O R trees M IN -M AX trees and A ND -O R trees ● An A A ND -O R tree is just a M M IN -M AX tree ND -O R tree IN -M AX tree restricted to the values {0,1}! restricted to the values {0,1} ● So M IN -M AX is at least as hard as A ND -O R . 0 MIN 0 1 1 MAX MAX MAX 0 1 0 0 1 1 1 1 0 8
M IN -M AX trees and A ND -O R trees M IN -M AX trees and A ND -O R trees ● An A A ND -O R tree is just a M M IN -M AX tree ND -O R tree IN -M AX tree restricted to the values {0,1}! restricted to the values {0,1} ● So M IN -M AX is at least as hard as A ND -O R . 0 AND 0 1 1 OR OR OR 0 1 0 0 1 1 1 1 0 9
You can also turn M IN You can also turn M IN -M -M AX AX trees into A trees into A ND ND -O -O R R trees trees root root ⩾ v ? MIN AND threshold v MAX OR x k x k ⩾ v 10
You can also turn M You can also turn M IN IN -M -M AX AX trees into A trees into A ND ND -O -O R R trees trees root root ⩾ 5? 4 0 MIN AND threshold 5 0 1 1 4 8 9 OR OR OR MAX MAX MAX 0 1 0 0 1 1 1 1 0 7 4 1 2 5 8 6 9 3 This immediately suggests binary search... 11
Combining A ND Combining A ND -O -O R R and binary search and binary search root root ⩾ 5? 4 0 MIN AND threshold 5 0 1 1 4 8 9 OR OR OR MAX MAX MAX 0 1 0 0 1 1 1 1 0 7 4 1 2 5 8 6 9 3 Is root ⩾ 5? No. ● 12
Combining A Combining A ND ND -O -O R R and binary search and binary search root root ⩾ 3? 4 1 MIN AND threshold 3 1 1 1 4 8 9 OR OR OR MAX MAX MAX 1 1 0 0 1 1 1 1 1 7 4 1 2 5 8 6 9 3 Is root ⩾ 5? No. ● Is root ⩾ 3? Yes. ● 13
Combining A Combining A ND ND -O -O R R and binary search and binary search root root ⩾ 4? 4 1 MIN AND threshold 4 1 1 1 4 8 9 OR OR OR MAX MAX MAX 1 1 0 0 1 1 1 1 0 7 4 1 2 5 8 6 9 3 } Is root ⩾ 5? No. ● Is root ⩾ 3? Yes. root = 4 ● Is root ⩾ 4? Yes. ● 14
Combining A Combining A ND ND -O -O R R and binary search and binary search We can consider two models of ordered non-binary data... ● in the input value input value query model, we have direct access to x 1 ,...,x N through a black box; ● in the comparison comparison query model, we are restricted to making comparisons of the form [x j < x k ] . 15
Problems with combining A ND -O R Problems with combining A ND -O R and binary search and binary search We need to find the midpoint find the midpoint of subintervals of the form [α, β] . In the comparison query model, the midpoint of an interval cannot be directly computed. In the input query model, if the numerical range is too large, the binary search may not converge in a logarithmic number of steps. 16
Saks-Wigderson algorithm Saks-Wigderson algorithm Saks and Wigderson [SW86] showed that... ● the optimal classical classical randomized algorithm for A ND -O R tree evaluation makes Θ(N Θ(N 0.7537... 0.7537... ) ) queries; ● there is an algorithm for M IN -M AX tree evaluation which makes this number of queries, using A ND -O R tree evaluation as a subroutine. 17
Saks-Wigderson algorithm Saks-Wigderson algorithm MAX v MIN AND MIN MAX OR x k x k ⩾ v T N = 3/2 T N/2 + O(N 0.7537... ) 0.7537... ) This implies a Θ(N Θ(N 0.7537... ) algorithm. 18
Quantum algorithm for A Quantum algorithm for A ND ND -O -O R R trees trees ● There is a lower bound of Ω(N 1/2 ) [BS04] ● There is a “more-or-less” matching algorithm that makes O(N 1/2+ε ) queries [FGG07, CCJY07, A07+CRŠZ07] 19
Quantum algorithm for A Quantum algorithm for A ND ND -O -O R R trees trees ● There is a lower bound of Ω(N 1/2 ) [BS04] ● There is a “more-or-less” matching algorithm that makes O(N 1/2+ε ) queries [FGG07, CCJY07, A07+CRŠZ07] The “obvious question”... Do these results generalize to Do these results generalize to M IN -M AX tree evaluation? M IN -M AX tree evaluation? 20
“Quantum Saks-Wigderson” Quantum Saks-Wigderson” “ MAX v MIN AND MIN MAX OR x k x k ⩾ v 0.5 0.5 T N = 3/2 T N/2 + O(N 0.7537... ) 0.5850... ) This implies an O(N O(N 0.5850... ) algorithm. 21
Can we do better? Can we do better? ● We could try to analyze the A ND -O R tree algorithm and try to apply it directly to M IN -M AX trees... ● A better idea better idea: perform a binary search binary search... root root ⩾ v ? MIN AND pivot v MAX OR x k x k ⩾ v 22
Can we do better? Can we do better? But haven't we already ● We could try to analyze the A ND -O R tree algorithm established that this approach is full of problems? and try to apply it directly to M IN -M AX trees... ● A better idea better idea: perform a binary search binary search... root root ⩾ v ? MIN AND pivot v MAX OR x k x k ⩾ v 23
Solution: use random pivots Solution: use random pivots ● A better idea better idea: perform a binary search binary search using random pivots random pivots. ● Classically, finding a random pivot is as hard as searching, which can take Ω(N) queries to do even once! ● We have a quantum algorithm to find a pivot with cost O(√N): Grover's search Grover's search! 24
Quantum algorithm for Quantum algorithm for evaluating M evaluating M IN IN -M -M AX AX trees trees ● A better idea better idea: perform a binary search binary search using random pivots random pivots. root root ⩾ v ? MIN AND random pivot v MAX OR x k x k ⩾ v 25
Quantum algorithm for Quantum algorithm for evaluating M evaluating M IN IN -M -M AX AX trees trees ● The algorithm runs for O(log N) stages. ● Each stage costs O(√N loglog N). T o amplify the subroutines to lower the error probability to O(1/log(N))... 26
Quantum algorithm for Quantum algorithm for evaluating M evaluating M IN IN -M -M AX AX trees trees ● The algorithm runs for O(log N) stages. ● Each stage costs O(√N loglog N). It turns out that this is unnecessary! (Using a trick involving a stack...) 27
Quantum algorithm for Quantum algorithm for evaluating M evaluating M IN IN -M -M AX AX trees trees ● The algorithm runs for O(log N) stages. ● Each stage costs O(√N). This gives a quantum algorithm for evaluating M IN -M AX trees... T otal cost: O(√N log N) O(√N log N) 1/2+ε ) This is O(N O(N 1/2+ε ) for an arbitrarily small constant ε. 28
Obtaining the optimal move Obtaining the optimal move ● If the values of the leaves x 1 ,...,x N are distinct, this is easy. ● Otherwise, we can use the quantum minimum/maximum finding algorithm [DH96]. MIN MAX MAX MAX 4 1 2 5 7 8 6 9 3 29
Summary Summary ● Classically Classically, the Saks-Wigderson reduction 0.7537... ) from M IN -M AX to A ND -O R uses ϴ(N ϴ(N 0.7537... ) queries. ● Calling the quantum A quantum A ND -O R subroutine ND -O R subroutine 0.5850... ) results in an O(N O(N 0.5850... ) algorithm, which is not optimal! ● The classical algorithms are based on examining the subtrees of the tree. 30
Summary Summary ● Our quantum algorithm quantum algorithm performs a binary search using random pivots and requires O(N 1/2+ε 1/2+ε ) ) queries, which is (close to) O(N optimal. optimal ● Conversely, binary search is too costly for a classical algorithm. – The ideas behind the quantum algorithm The ideas behind the quantum algorithm don't work in the classical setting! don't work in the classical setting! 31
Recommend
More recommend