skip to main content
research-article

NodeGit: Diffing and Merging Node Graphs

Published:05 December 2023Publication History
Skip Abstract Section

Abstract

The use of version control is pervasive in collaborative software projects. Version control systems are based on two primary operations: diffing two versions to compute the change between them and merging two versions edited concurrently. Recent works provide solutions to diff and merge graphics assets such as images, meshes and scenes. In this work, we present a practical algorithm to diff and merge procedural programs written as node graphs. To obtain more precise diffs, we version the graphs directly rather than their textual representations. Diffing graphs is equivalent to computing the graph edit distance, which is known to be computationally infeasible. Following prior work, we propose an approximate algorithm tailored to our problem domain. We validate the proposed algorithm by applying it both to manual edits and to a large set of randomized modifications of procedural shapes and materials. We compared our method with existing state-of-the-art algorithms, showing that our approach is the only one that reliably detects user edits.

Skip Supplemental Material Section

Supplemental Material

References

  1. David B Blumenthal, Nicolas Boria, Johann Gamper, Sébastien Bougleux, and Luc Brun. 2020. Comparing heuristics for graph edit distance computation. The VLDB journal 29, 1 (2020), 419--458.Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. David B Blumenthal, Sébastien Bougleux, Johann Gamper, and Luc Brun. 2018. Ring based approximation of graph edit distance. In Structural, Syntactic, and Statistical Pattern Recognition: Joint IAPR International Workshop, S+ SSPR 2018, Beijing, China, August 17--19, 2018, Proceedings. Springer, 293--303.Google ScholarGoogle Scholar
  3. David B Blumenthal and Johann Gamper. 2017. Improved lower bounds for graph edit distance. IEEE Transactions on Knowledge and Data Engineering 30, 3 (2017), 503--516.Google ScholarGoogle ScholarCross RefCross Ref
  4. David B Blumenthal and Johann Gamper. 2020. On the exact computation of the graph edit distance. Pattern Recognition Letters 134 (2020), 46--57.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. David B Blumenthal, Johann Gamper, Sébastien Bougleux, and Luc Brun. 2021. Upper bounding graph edit distance based on rings and machine learning. International Journal of Pattern Recognition and Artificial Intelligence 35, 08 (2021), 2151008.Google ScholarGoogle ScholarCross RefCross Ref
  6. Nicolas Boria, David B Blumenthal, Sébastien Bougleux, and Luc Brun. 2020. Improved local search for graph edit distance. Pattern Recognition Letters 129 (2020), 19--25.Google ScholarGoogle ScholarCross RefCross Ref
  7. H. Bunke. 1997. On a Relation Between Graph Edit Distance and Maximum Common Subgraph. Pattern Recogn. Lett. 18, 9 (1997).Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Claudio Calabrese, Gabriele Salvati, Marco Tarini, and Fabio Pellacini. 2016. cSculpt: a system for collaborative sculpting. ACM Trans. Graph. 35, 4 (2016).Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Edoardo Carra and Fabio Pellacini. 2019. SceneGit: A Practical System for Diffing and Merging 3D Environments. ACM Trans. Graph. 38, 6, Article 159 (2019), 15 pages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Guilherme Cavalcanti, Paulo Borba, and Paola Accioly. 2017. Evaluating and Improving Semistructured Merge. Proc. ACM Program. Lang. 1, OOPSLA, Article 59 (oct 2017), 27 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Scott Chacon. 2009. Pro Git. Apress.Google ScholarGoogle Scholar
  12. Hsiang-Ting Chen, Tovi Grossman, Li-Yi Wei, Ryan M. Schmidt, Björn Hartmann, George Fitzmaurice, and Maneesh Agrawala. 2014. History Assisted View Authoring for 3D Models. In Proc. SIGCHI.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Hsiang-Ting Chen, Li-Yi Wei, and Chun-Fa Chang. 2011. Nonlinear revision control for images. ACM Trans. Graph. 30 (2011).Google ScholarGoogle Scholar
  14. Fernando Chirigati, Juliana Freire, David Koop, and Cláudio Silva. 2013. VisTrails provenance traces for benchmarking. In ACM International Conference Proceeding Series.Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Timothee Cour, Praveen Srinivasan, and Jianbo Shi. 2007. Balanced Graph Matching. In Advances in Neural Information Processing Systems 19, B. Schölkopf, J. C. Platt, and T. Hoffman (Eds.).Google ScholarGoogle Scholar
  16. Jonathan D. Denning, William B. Kerr, and Fabio Pellacini. 2011. MeshFlow: Interactive Visualization of Mesh Construction Sequences. ACM Trans. Graph. 30, 4 (2011).Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Jonathan D. Denning and Fabio Pellacini. 2013. MeshGit: Diffing and Merging Meshes for Polygonal Modeling. ACM Trans. Graph. 32, 4 (2013).Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Jonathan D. Denning, Valentina Tibaldo, and Fabio Pellacini. 2015. 3DFlow: Continuous Summarization of Mesh Editing Workflows. ACM Trans. Graph. 34, 4 (2015).Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Jozef Doboš, Carmen Fan, Sebastian Friston, and Charence Wong. 2018. Screen Space 3D Diff: A Fast and Reliable Method for Real-time 3D Differencing on the Web. In Proceedings of the 23rd International ACM Conference on 3D Web Technology (Web3D '18).Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Jozef Doboš, Kristian Sons, Dmitri Rubinstein, Philipp Slusallek, and Anthony Steed. 2013. XML3DRepo: a REST API for version controlled 3D assets on the web. In Web3D.Google ScholarGoogle Scholar
  21. Jozef Doboš and Anthony Steed. 2012a. 3D Diff: an interactive approach to mesh differencing and conflict resolution. In SIGGRAPH Asia Technical Briefs.Google ScholarGoogle Scholar
  22. Jozef Doboš and Anthony Steed. 2012b. 3D revision control framework. In Web3D.Google ScholarGoogle Scholar
  23. Jean-Rémy Falleri, Floréal Morandat, Xavier Blanc, Matias Martinez, and Martin Monperrus. 2014. Fine-grained and accurate source code differencing. In ACM/IEEE International Conference on Automated Software Engineering, ASE '14, Vasteras, Sweden - September 15 -- 19, 2014. 313--324.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Xinbo Gao, Bing Xiao, Dacheng Tao, and Xuelong Li. 2010. A Survey of Graph Edit Distance. Pattern Analysis and Applications 13, 1 (2010).Google ScholarGoogle Scholar
  25. Floraine Grabler, Maneesh Agrawala, Wilmot Li, Mira Dontcheva, and Takeo Igarashi. 2009. Generating Photo Manipulation Tutorials by Demonstration. ACM Trans. Graph. 28, 3 (2009).Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Tovi Grossman, Justin Matejka, and George W. Fitzmaurice. 2010. Chronicle: capture, exploration, and playback of document workflow histories. In UIST.Google ScholarGoogle Scholar
  27. Nicholas Kong, Tovi Grossman, Björn Hartmann, Maneesh Agrawala, and George Fitzmaurice. 2012. Delta: A Tool for Representing and Comparing Workflows. In Proc. SIGCHI (CHI '12).Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Gonzalo Navarro. 2001. A Guided Tour to Approximate String Matching. ACM Comput. Surv. 33, 1 (2001), 31--88.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Michel Neuhaus and Horst Bunke. 2007. Bridging the Gap between Graph Edit Distance and Kernel Machines. World Scientific Publishing.Google ScholarGoogle Scholar
  30. Onshape. 2014. Full-cloud 3d cad system. https://www.onshape.com/.Google ScholarGoogle Scholar
  31. Bryan O'Sullivan. 2009. Mercurial: The Definitive Guide. O'Reilly Media.Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Mateusz Pawlik and Nikolaus Augsten. 2015. Efficient Computation of the Tree Edit Distance. ACM Trans. Database Syst. 40, 1, Article 3 (2015), 40 pages.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Kaspar Riesen and Horst Bunke. 2009. Approximate graph edit distance computation by means of bipartite graph matching. Image and Vision Computing 27, 7 (2009), 950--959. 7th IAPR-TC15 Workshop on Graph-based Representations (GbR 2007). Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Kaspar Riesen, Andreas Fischer, and Horst Bunke. 2017. Improved graph edit distance approximation with simulated annealing. In Graph-Based Representations in Pattern Recognition: 11th IAPR-TC-15 International Workshop, GbRPR 2017, Anacapri, Italy, May 16--18, 2017, Proceedings 11. Springer, 222--231.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Gabriele Salvati, Christian Santoni, Valentina Tibaldo, and Fabio Pellacini. 2015. Mesh-Histo: collaborative modeling by sharing and retargeting editing histories. ACM Trans. Graph. 34, 6 (2015).Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Pep Santacruz and Francesc Serratosa. 2020. Error-tolerant graph matching in linear computational cost using an initial small partial matching. Pattern Recognition Letters 134 (2020), 10--19.Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Christian Santoni, Gabriele Salvati, Valentina Tibaldo, and Fabio Pellacini. 2018. LevelMerge: Collaborative Game Level Editing by Merging Labeled Graphs. IEEE CG&A 38, 4 (2018).Google ScholarGoogle Scholar
  38. Dana Shapira and James A Storer. 2007. Edit distance with move operations. Journal of discrete algorithms 5, 2 (2007), 380--392.Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Marcelo Sousa, Isil Dillig, and Shuvendu K. Lahiri. 2018. Verified Three-Way Program Merge. Proc. ACM Program. Lang. 2, Article 165 (2018), 29 pages.Google ScholarGoogle Scholar
  40. Kaizhong Zhang. 1989. The editing distance between trees: algorithms and applications. Ph.D. thesis, New York University (1989).Google ScholarGoogle Scholar
  41. K. Zhang and D. Shasha. 1989. Simple Fast Algorithms for the Editing Distance Between Trees and Related Problems. SIAM J. Comput. 18, 6 (1989).Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Kaizhong Zhang, Rick Statman, and Dennis Shasha. 1992. On the editing distance between unordered labeled trees. Inform. Process. Lett. 42, 3 (1992), 133--139.Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. NodeGit: Diffing and Merging Node Graphs

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM Transactions on Graphics
        ACM Transactions on Graphics  Volume 42, Issue 6
        December 2023
        1565 pages
        ISSN:0730-0301
        EISSN:1557-7368
        DOI:10.1145/3632123
        Issue’s Table of Contents

        Copyright © 2023 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 5 December 2023
        Published in tog Volume 42, Issue 6

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
      • Article Metrics

        • Downloads (Last 12 months)106
        • Downloads (Last 6 weeks)20

        Other Metrics

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader