Complexity issues in tree-based version control
- 657 Downloads
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.
KeywordsBase Version Version Control Special Node Node Addition Isomorphic Subgraph
Unable to display preview. Download preview PDF.
- [Ka]Richard M. Karp, “On the Complexity of Combinatorial Problems,” Networks, 5, pp. 45–68, 1975.Google Scholar
- [N]Naomi Nishimura, “Complexity Issues In Tree-Based Version Control,” Technical Report 212/88, Master's Thesis, University of Toronto, 1988.Google Scholar
- [R]Marc J. Rochkind, “The Source Code Control System,” IEEE Transactions on Software Engineering SE-1, pp. 364–370, 1975.Google Scholar
- [SS]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.Google Scholar
- [Ta]Kuo-Chung Tai, “The Tree-to-Tree Correction Problem,” Journal of the Association for Computing Machinery 26, 3, pp. 422–433, July 1979.Google Scholar
- [Ti1]Walter Tichy, “Design, Implementation, Evaluation of a Revision Control System,” Proceedings of the 6th International Conference on Software Engineering, pp. 58–67, 1982.Google Scholar
- [Ti2]Walter Tichy, “The String-to-String Correction Problem with Block Moves,” ACM Transactions on Computer Systems 2, 4, pp. 309–321, November 1984.Google Scholar
- [Wa]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.Google Scholar
- [WF]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.Google Scholar