TY - JOUR
T1 - Space–Time Trade-offs for Stack-Based Algorithms
AU - Barba, Luis
AU - Korman, Matias
AU - Langerman, Stefan
AU - Sadakane, Kunihiko
AU - Silveira, Rodrigo I.
N1 - Funding Information:
We thank the anonymous referee for their thorough proofread as well as for pointing us to []. We also thank Mikkel Abrahamsen for useful discussions and comments. M.K was partially supported by the Secretary for Universities and Research of the Ministry of Economy and Knowledge of the Government of Catalonia, the European Union, and the JST, ERATO, Kawarabayashi Large Graph Project. R.S. was partially supported by FP7 Marie Curie Actions Individual Fellowship PIEF-GA-2009-251235 and by FCT through grant SFRH/BPD/88455/2012. M.K and R.S. were also supported by projects MINECO MTM2012-30951 and Gen. Cat. DGR2009SGR1040 and by ESF EUROCORES program EuroGIGA-ComPoSe IP04-MICINN project EUI-EURC-2011 4306. R. Silveira was also affiliated with Universitat Politècnica de Catalunya (UPC), Barcelona, Spain. S. Langerman is Directeur de Recherches du F.R.S.-FNRS.
Publisher Copyright:
© 2014, Springer Science+Business Media New York.
PY - 2015/8/19
Y1 - 2015/8/19
N2 - In memory-constrained algorithms, access to the input is restricted to be read-only, and the number of extra variables that the algorithm can use is bounded. In this paper we introduce the compressed stack technique, a method that allows to transform algorithms whose main memory consumption takes the form of a stack into memory-constrained algorithms. Given an algorithm $$\mathcal {A}$$A that runs in $$O(n)$$O(n) time using a stack of length Θ(n), we can modify it so that it runs in O(n2logn/2s) time using a workspace of $$O(s)$$O(s) variables (for any s∈o(logn)) or O(n1+1/logp) time using O(plogpn) variables (for any 2≤p≤n). We also show how the technique can be applied to solve various geometric problems, namely computing the convex hull of a simple polygon, a triangulation of a monotone polygon, the shortest path between two points inside a monotone polygon, a 1-dimensional pyramid approximation of a 1-dimensional vector, and the visibility profile of a point inside a simple polygon. Our approach improves or matches up to a O(logn) factor the running time of the best-known results for these problems in constant-workspace models (when they exist), and gives a trade-off between the size of the workspace and running time. To the best of our knowledge, this is the first general framework for obtaining memory-constrained algorithms.
AB - In memory-constrained algorithms, access to the input is restricted to be read-only, and the number of extra variables that the algorithm can use is bounded. In this paper we introduce the compressed stack technique, a method that allows to transform algorithms whose main memory consumption takes the form of a stack into memory-constrained algorithms. Given an algorithm $$\mathcal {A}$$A that runs in $$O(n)$$O(n) time using a stack of length Θ(n), we can modify it so that it runs in O(n2logn/2s) time using a workspace of $$O(s)$$O(s) variables (for any s∈o(logn)) or O(n1+1/logp) time using O(plogpn) variables (for any 2≤p≤n). We also show how the technique can be applied to solve various geometric problems, namely computing the convex hull of a simple polygon, a triangulation of a monotone polygon, the shortest path between two points inside a monotone polygon, a 1-dimensional pyramid approximation of a 1-dimensional vector, and the visibility profile of a point inside a simple polygon. Our approach improves or matches up to a O(logn) factor the running time of the best-known results for these problems in constant-workspace models (when they exist), and gives a trade-off between the size of the workspace and running time. To the best of our knowledge, this is the first general framework for obtaining memory-constrained algorithms.
KW - Constant workspace
KW - Memory constrained algorithms
KW - Space–time trade-off
KW - Stack algorithms
UR - http://www.scopus.com/inward/record.url?scp=85027920816&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85027920816&partnerID=8YFLogxK
U2 - 10.1007/s00453-014-9893-5
DO - 10.1007/s00453-014-9893-5
M3 - Article
AN - SCOPUS:85027920816
VL - 72
SP - 1097
EP - 1129
JO - Algorithmica
JF - Algorithmica
SN - 0178-4617
IS - 4
ER -