Complexity issues in tree-based version control

  • Naomi Nishimura
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 382)


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.


Base Version Version Control Special Node Node Addition Isomorphic Subgraph 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Ka]
    Richard M. Karp, “On the Complexity of Combinatorial Problems,” Networks, 5, pp. 45–68, 1975.Google Scholar
  2. [N]
    Naomi Nishimura, “Complexity Issues In Tree-Based Version Control,” Technical Report 212/88, Master's Thesis, University of Toronto, 1988.Google Scholar
  3. [R]
    Marc J. Rochkind, “The Source Code Control System,” IEEE Transactions on Software Engineering SE-1, pp. 364–370, 1975.Google Scholar
  4. [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
  5. [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
  6. [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
  7. [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
  8. [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
  9. [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
  10. [Wi]
    Wilhelm, “A Modified Tree-to-Tree Correction Problem,” Information Processing Letters 12, 3, pp. 127–132, 1981.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1989

Authors and Affiliations

  • Naomi Nishimura
    • 1
  1. 1.Department of Computer ScienceUniversity of TorontoCanada

Personalised recommendations