Efficient pebbling for list traversal synopses

  • Authors:
  • Yossi Matias;Ely Porat

  • Affiliations:
  • School of Computer Science, Tel Aviv University,;Department of Mathematics and Computer Science, Bar-Ilan University, Ramat-Gan, Israel

  • Venue:
  • ICALP'03 Proceedings of the 30th international conference on Automata, languages and programming
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

We show how to support efficient back traversal in a unidirectional list, using small memory and with essentially no slowdown in forward steps. Using O(lg n) memory for a list of size n, the i'th back-step from the farthest point reached so far takes O(lg i) time worst case, while the overhead per forward step is at most epsilon for arbitrary small constant Ɛ 0. An arbitrary sequence of forward and back steps is allowed. A full trade-off between memory usage and time per back-step is presented: k vs. kn1/k and vice versa. Our algorithm is based on a novel pebbling technique which moves pebbles on a "virtual binary tree" that can only be traversed in a pre-order fashion. The list traversal synopsis extends to general directed graphs, and has other interesting applications, including memory efficient hash-chain implementation. Perhaps the most surprising application is in showing that for any program, arbitrary rollback steps can be efficiently supported with small overhead in memory, and marginal overhead in its ordinary execution. More concretely: Let P be a program that runs for at most T steps, using memory of size M. Then, at the cost of recording the input used by the program, and increasing the memory by a factor of O(lg T) to O(M lg T), the program P can be extended to support an arbitrary sequence of forward execution and rollback steps, as follows. The i'th rollback step takes O(lg i) time in the worst case, while forward steps take O(1) time in the worst case, and 1 + Ɛ amortized time per step.