Graph Threading

Authors Erik D. Demaine , Yael Kirkpatrick , Rebecca Lin

Thumbnail PDF


  • Filesize: 4.32 MB
  • 18 pages

Document Identifiers

Author Details

Erik D. Demaine
  • Computer Science and Artificial Intelligence Lab, Massachusetts Institute of Technology, Cambridge, MA, USA
Yael Kirkpatrick
  • Department of Mathematics, Massachusetts Institute of Technology, Cambridge, MA, USA
Rebecca Lin
  • Computer Science and Artificial Intelligence Lab, Massachusetts Institute of Technology, Cambridge, MA, USA


We thank Anders Aamand, Kiril Bangachev, Justin Chen, Alison Martin, Surya Mathialagan, and Zhecheng Wang for insightful discussions. We also thank anonymous reviewers for their helpful comments.

Cite AsGet BibTex

Erik D. Demaine, Yael Kirkpatrick, and Rebecca Lin. Graph Threading. In 15th Innovations in Theoretical Computer Science Conference (ITCS 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 287, pp. 38:1-38:18, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)


Inspired by artistic practices such as beadwork and himmeli, we study the problem of threading a single string through a set of tubes, so that pulling the string forms a desired graph. More precisely, given a connected graph (where edges represent tubes and vertices represent junctions where they meet), we give a polynomial-time algorithm to find a minimum-length closed walk (representing a threading of string) that induces a connected graph of string at every junction. The algorithm is based on a surprising reduction to minimum-weight perfect matching. Along the way, we give tight worst-case bounds on the length of the optimal threading and on the maximum number of times this threading can visit a single edge. We also give more efficient solutions to two special cases: cubic graphs and the case when each edge can be visited at most twice.

Subject Classification

ACM Subject Classification
  • Mathematics of computing → Graph algorithms
  • Shortest walk
  • Eulerian cycle
  • perfect matching
  • beading


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Therese C. Biedl, Prosenjit Bose, Erik D. Demaine, and Anna Lubiw. Efficient algorithms for Petersen’s matching theorem. Journal of Algorithms, 38(1):110-134, 2001. Google Scholar
  2. J. A. (John Adrian) Bondy. Graph Theory with Applications. North Holland, New York, 1980-1976. Google Scholar
  3. Jeffrey Bosboom, Charlotte Chen, Lily Chung, Spencer Compton, Michael Coulombe, Erik D. Demaine, Martin L. Demaine, Ivan Tadeu Ferreira Antunes Filho, Dylan Hendrickson, Adam Hesterberg, Calvin Hsu, William Hu, Oliver Korten, Zhezheng Luo, and Lillian Zhang. Edge matching with inequalities, triangles, unknown shape, and two players. Journal of Information Processing, 28:987-1007, 2020. URL:
  4. Carina Chela. The original Finnish Christmas ornament. this is FINLAND, December 2013. URL:
  5. Norishige Chiba and Takao Nishizeki. Arboricity and subgraph listing algorithms. SIAM Journal on Computing, 14(1):210-223, 1985. URL:
  6. Maria Chudnovsky and Paul Seymour. Perfect matchings in planar cubic graphs. Combinatorica, 32(4):403-424, 2012. URL:
  7. D. de Caen. An upper bound on the sum of squares of degrees in a graph. Discrete Mathematics, 185(1):245-248, 1998. Google Scholar
  8. Alfred Errera. Du colorage des cartes. Mathesis, 36:56-60, 1922. Google Scholar
  9. Herbert Fleischner. Eulerian graphs and related topics. North-Holland, Amsterdam, 1990. Google Scholar
  10. Zvi Galil, Silvio Micali, and Harold Gabow. An O(EVlog V) algorithm for finding a maximal weighted matching in general graphs. SIAM J. Comput., 15:120-130, February 1986. URL:
  11. James Green. Beadwork in the arts of Africa and beyond. The Metropolitan Museum of Art, July 2018. URL:
  12. Yuki Igarashi, Takeo Igarashi, and Jun Mitani. Beady: Interactive beadwork design and construction. ACM Trans. Graph., 31(4), July 2012. URL:
  13. Joelle Jackson. Heavenly harmony: The universal language of Finnish himmeli. Smithsonian Center for Folklife and Cultural Heritage, July 2021. URL:
  14. Bih-Yaw Jin and Chiachin Tsoo. Bead sculptures and bead-chain interlocking puzzles inspired by molecules and nanoscale structure, 2019. URL:
  15. Alison Martin. Optimization of threading paths. Twitter, November 2021. URL:
  16. Silvio Micali and Vijay V. Vazirani. An O(√|v| ⋅ |E|) algoithm for finding maximum matching in general graphs. In 21st Annual Symposium on Foundations of Computer Science (sfcs 1980), pages 17-27, 1980. URL:
  17. Rodakis. Push puppet. URL:
  18. Saskia Solomon. A vanishing craft reappears. The New York Times, September 2022. URL:
  19. Wikipedia. Straw mobile, April 2023. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail