Computing Diameter in the Streaming and Sliding-Window Models * Joan Feigenbaum † Dept. of Computer Science Yale University feigenbaum-joan@cs.yale.edu Sampath Kannan ‡ Dept. of Computer & Information Science University of Pennsylvania kannan@cis.upenn.edu Jian Zhang § Dept. of Computer Science Yale University zhang-jian@cs.yale.edu December 23, 2002 Abstract We investigate the diameter problem in the streaming and sliding-window models. We show that, for a stream of n points or a sliding window of size n, any exact algorithm for diameter requires Ω(n) bits of space. We present a simple ²-approximation 1 algorithm for computing the diameter in the streaming model. Our main result is an ²-approximation algorithm that maintains the diameter in two dimensions in the sliding windows model using O( 1 ² 3/2 log 3 n(log R + log log n + log 1 ² )) bits of space, where R is the maximum, over all windows, of the ratio of the diameter to the minimum non-zero distance between any two points in the window. 1 introduction In recent years, massive data sets have become increasingly important in a wide range of ap- plications. In many applications, the input can be viewed as a data stream [12, 7] that the * This work was supported by the DoD University Research Initiative (URI) program administered by the Office of Naval Research under Grant N00014-01-1-0795. † Supported in part by ONR grant N00014-01-1-0795 and NSF grants CCR-0105337, CCR-TC-0208972, ANI- 0207399, and ITR-0219018. ‡ Supported in part by NSF grant CCR-0105337. § Supported by NSF grant CCR-0105337. 1 Denote by A the output of an algorithm and by T the value of the function that the algorithm wants to compute. We say A²-approximates T if (1 + ²)T ≥ A ≥ (1 - ²)T . 1