Abstract
Version control systems are designed to allow the efficient storage of and access to multiple versions of programs. In many systems, a few versions are stored in their entirety as lines of text and the remaining versions are stored as differences between versions, recorded as modifications, additions, and removals of lines. Since the structure underlying most programs is not a list of lines, but instead a tree, it makes sense to consider storing programs as trees. We introduce a natural model for version control of program trees. We present a polynomial time algorithm that takes as input two trees and produces a difference that requires the smallest amount of space to store. However, if we store programs as directed acyclic graphs (DAGs) the problem of determining such a difference is NP-complete. Another problem of interest is that of computing, for an arbitrary pair of versions, a difference between versions such that the amount of time needed to reconstruct the second version from the first version is the least possible. We show this problem to be NP-complete for both trees and DAGs.
Preview
Unable to display preview. Download preview PDF.
References
Richard M. Karp, “On the Complexity of Combinatorial Problems,” Networks, 5, pp. 45–68, 1975.
Naomi Nishimura, “Complexity Issues In Tree-Based Version Control,” Technical Report 212/88, Master's Thesis, University of Toronto, 1988.
Marc J. Rochkind, “The Source Code Control System,” IEEE Transactions on Software Engineering SE-1, pp. 364–370, 1975.
James A. Storer and Thomas G. Szymanski, “Data Compression via Textual Substitution,” Journal of the Association for Computing Machinery 29, 4, pp. 928–951, October 1982.
Kuo-Chung Tai, “The Tree-to-Tree Correction Problem,” Journal of the Association for Computing Machinery 26, 3, pp. 422–433, July 1979.
Walter Tichy, “Design, Implementation, Evaluation of a Revision Control System,” Proceedings of the 6th International Conference on Software Engineering, pp. 58–67, 1982.
Walter Tichy, “The String-to-String Correction Problem with Block Moves,” ACM Transactions on Computer Systems 2, 4, pp. 309–321, November 1984.
R. A. Wagner, “On the Complexity of the Extended String-to-String Correction Problem,” Proceedings of the Seventh Annual ACM Symposium on Theory of Computing, pp. 218–223, 1975.
R. A. Wagner and M. J. Fischer, “The String-to-String Correction Problem,” Journal of the Association for Computing Machinery 21, pp. 168–173, 1974.
Wilhelm, “A Modified Tree-to-Tree Correction Problem,” Information Processing Letters 12, 3, pp. 127–132, 1981.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1989 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nishimura, N. (1989). Complexity issues in tree-based version control. In: Dehne, F., Sack, J.R., Santoro, N. (eds) Algorithms and Data Structures. WADS 1989. Lecture Notes in Computer Science, vol 382. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-51542-9_39
Download citation
DOI: https://doi.org/10.1007/3-540-51542-9_39
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-51542-5
Online ISBN: 978-3-540-48237-6
eBook Packages: Springer Book Archive