# Computing the all-pairs longest chains in the plane

## Abstract

Many problems on sequences and on circular-arc graphs involve the computation of longest chains between points in the plane. Given a set *S* of *n* points in the plane, we consider the problem of computing the matrix of longest chain lengths between all pairs of points in *S*, and the matrix of “parent” pointers that describes the *n* longest chain trees. We present a simple sequential algorithm for computing these matrices. Our algorithm runs in *O(n*^{2}) time, and hence is optimal. We also present a rather involved parallel algorithm that computes these matrices in *O(log*^{2}n) time using *O(n*^{2}/log n) processors in the CREW PRAM model. These matrices enables us to report, in *O*(1) time, the length of a longest chain between any two points in *S* by using one processor, and the actual chain by using *k* processors, where *k* is the number of points of *S* on that chain. The space complexity of the algorithms is *O(n*^{2}).

## Preview

Unable to display preview. Download preview PDF.

## References

- [1]A. Aggarwal and J. Park. “Notes on Searching in Multidimensional Monotone Arrays (Preliminary Version),”
*Proc. 29th Annual IEEE Symposium on Foundations of Computer Science*, 1988, pp, 497–512.Google Scholar - [2]A. Apostolico, M. J. Atallah, and S. E. Hambrusch. “New Clique and Independent Set Algorithms for Circle Graphs,”
*Discrete Appl. Math.*, Vol. 36, 1992, pp. 1–24.CrossRefGoogle Scholar - [3]A. Apostolico, M. J. Atallah, L. L. Larmore, and H. S. McFaddin. “Efficient Parallel Algorithms for String Editing and Related Problems,”
*SIAM J. Comput.*19 (5), 1990, pp. 968–988.CrossRefGoogle Scholar - [4]M. J. Atallah and D. Z. Chen. “Parallel Rectilinear Shortest Paths with Rectangular Obstacles,”
*Computational Geometry: Theory and Applications*, 1, 1991, pp. 79–113.CrossRefGoogle Scholar - [5]M. J. Atallah and S. R. Kosaraju. “An Efficient Parallel Algorithm for the Row Minima of a Totally Monotone Matrix,”
*Proc. 2nd ACM-SIAM Symp. on Discrete Algorithms*, San Francisco, California, 1991, pp. 394–403. (Accepted for publication in*J. of Algorithms.*)Google Scholar - [6]O. Berkman and U. Vishkin. “Finding Level-Ancestors in Trees,” Tech. Rept. UMIACS-TR-91-9, University of Maryland, 1991.Google Scholar
- [7]O. Berkman and U. Vishkin. Personal communication.Google Scholar
- [8]R. P. Brent. “The Parallel Evaluation of General Arithmetic Expressions,”
*J. of the ACM*, Vol. 21, No. 2, 1974, pp. 201–206.CrossRefGoogle Scholar - [9]B. M. Chazelle. “Optimal Algorithms for Computing Depths and Layers,”
*Proc. of the 20th Allerton Conference on Communications. Control and Computing*, 1983, pp. 427–436.Google Scholar - [10]R.B.K. Dewar, S.M. Merritt, and M. Sharir. “Some Modified Algorithms for Dijkstra's Longest Upsequence Problem,”
*Acta Informatica*, Vol. 18, No. 1, 1982, pp. 1–15.CrossRefGoogle Scholar - [11]E.W. Dijkstra. “Some Beautiful Arguments Using Mathematical Induction,”
*Acta Informatica*, Vol. 13, No. 1, 1980, pp. 1–8.CrossRefGoogle Scholar - [12]S. Even, A. Pnueli, and A. Lempel. “Permutation Graphs and Transitive Graphs,”
*Journal of the ACM*, Vol. 19, No. 3, 1972, pp. 400–410.CrossRefGoogle Scholar - [13]M.L. Fredman. “On Computing the Length of Longest Increasing Subsequences,”
*Discrete Mathematics*, 1975, pp. 29–35.Google Scholar - [14]F. Gavril. “Algorithms for a Maximum Clique and a Maximum Independent Set of a Circle Graph,”
*Networks*, 1973, pp. 261–273.Google Scholar - [15]F. Gavril. “Algorithms on Circular-Arc Graphs,”
*Networks*, 1974, pp. 357–369.Google Scholar - [16]U.I. Gupta, D.T. Lee, and Y.-T. Leung. “Efficient Algorithms for Interval Graphs and Circular Arc Graphs,”
*Networks*, 1982, pp. 459–467.Google Scholar - [17]W.-L. Hsu. “Maximum Weight Clique Algorithms for Circular-Arc Graphs and Circle Graphs,”
*SIAM J. on Computing*, 1985, pp. 224–231.Google Scholar - [18]A. Pnueli, A. Lempel, and S. Even. “Transitive Orientation of Graphs and Identification of Permutation Graphs,”
*Canadian Journal of Math.*23, 1, 1971, pp. 160–175.Google Scholar - [19]D. Rotem and U. Urrutia. “Finding Maximum Cliques in Circle Graphs,”
*Networks*, 1981, 1pp. 269–278.Google Scholar - [20]R. E. Tarjan and U. Vishkin. “An Efficient Parallel Biconnectivity Algorithm,”
*SIAM J. Comput.*14 (4), 1985, pp. 862–874.MathSciNetGoogle Scholar