Skip to main content

Algorithms and complexity for Turaev–Viro invariants


The Turaev–Viro invariants are a powerful family of topological invariants for distinguishing between different 3-manifolds. They are invaluable for mathematical software, but current algorithms to compute them require exponential time. The invariants are parameterized by an integer \(r \ge 3\). We resolve the question of complexity for \(r=3\) and \(r=4\), giving simple proofs that the Turaev–Viro invariants for \(r=3\) can be computed in polynomial time, but computing the invariant for \(r=4\) is #P-hard. Moreover, we describe an algorithm for arbitrary r, which is fixed-parameter tractable with respect to the treewidth of the dual graph of the input triangulation. We show through concrete implementation and experimentation that this algorithm is practical—and indeed preferable—to the prior state of the art for real computation. The algorithm generalises to every triangulated 3-manifold invariant defined from tensor network contraction.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5


  1. 1.

    For these reasons, this work focuses on the family of Turaev–Viro invariants, although our methods can be applied to any other state sum invariants with very little effort. This is briefly explained in Sect. 5.

  2. 2.

    The Manifold Recogniser (Matveev et al. 2012) also implements a backtracking algorithm, but it is not open-source and so comparisons are more difficult.


  1. Alagic, G., Lo, C.: Quantum invariants of \(3\)-manifolds and NP vs. #P. Quantum Inf. Comput. 17(1–2), 125–146 (2017)

    MathSciNet  Google Scholar 

  2. Alagic, G., Jordan, S.P., König, R., Reichardt, B.W.: Estimating Turaev–Viro three-manifold invariants is universal for quantum computation. Phys. Rev. A 82(4), 040302(R) (2010)

    MathSciNet  Article  Google Scholar 

  3. Amir, E.: Approximation algorithms for treewidth. Algorithmica 56(4), 448–479 (2010).

    MathSciNet  Article  MATH  Google Scholar 

  4. Arnborg, S., Corneil, D.G., Proskurowski, A.: Complexity of finding embeddings in a k-tree. SIAM J. Algebraic Discrete Methods 8(2), 277–284 (1987)

    MathSciNet  Article  Google Scholar 

  5. Barrett, J.W., Westbury, B.W.: Invariants of piecewise-linear 3-manifolds. Trans. Am. Math. Soc. 348, 3997–4022 (1996)

    MathSciNet  Article  Google Scholar 

  6. Bodlaender, H.L.: A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM J. Comput. 25(6), 1305–1317 (1996).

    MathSciNet  Article  MATH  Google Scholar 

  7. Bodlaender, H.L., Koster, A.M.C.A.: Treewidth computations. I. Upper bounds. Inf. Comput. 208(3), 259–275 (2010).

    MathSciNet  Article  MATH  Google Scholar 

  8. Bodlaender, H.L., Drange, P.G., Dregi, M.S., Fomin, F.V., Lokshtanov, D., Pilipczuk, M.: A c\({}^{\text{ k }}\) n 5-approximation algorithm for treewidth. SIAM J. Comput. 45(2), 317–378 (2016).

    MathSciNet  Article  MATH  Google Scholar 

  9. Burton, B.A.: Structures of small closed non-orientable 3-manifold triangulations. J. Knot Theory Ramif. 16(5), 545–574 (2007)

    MathSciNet  Article  Google Scholar 

  10. Burton, B.A.: Detecting genus in vertex links for the fast enumeration of 3-manifold triangulations. In: ISSAC 2011: Proceedings of the 36th International Symposium on Symbolic and Algebraic Computation, pp. 59–66. ACM, New York (2011)

  11. Burton, B.A., Budney, R., Pettersson, W., et al.: Regina: software for 3-manifold topology and normal surface theory (1999–2014).

  12. Burton, B.A., Downey, R.G.: Courcelle’s theorem for triangulations (2014) (preprint). arXiv:1403.2926

  13. Burton, B.A., Maria, C., Spreer, J.: Algorithms and complexity for Turaev–Viro invariants. In: Automata, Languages, and Programming—42nd International Colloquium, ICALP 2015, Kyoto, Japan, July 6–10, 2015, Proceedings, Part I, pp. 281–293 (2015)

    Chapter  Google Scholar 

  14. Cantor, D.G., Kaltofen, E.: On fast multiplication of polynomials over arbitrary algebras. Acta Inform. 28(7), 693–701 (1991).

    MathSciNet  Article  MATH  Google Scholar 

  15. Feige, U., Hajiaghayi, M., Lee, J.R.: Improved approximation algorithms for minimum weight vertex separators. SIAM J. Comput. 38(2), 629–657 (2008).

    MathSciNet  Article  MATH  Google Scholar 

  16. Hodgson, C.D., Weeks, J.R.: Symmetries, isometries and length spectra of closed hyperbolic three-manifolds. Exp. Math. 3(4), 261–274 (1994)

    MathSciNet  Article  Google Scholar 

  17. Huszár, K., Spreer, J., Wagner, U.: On the treewidth of triangulated 3-manifolds. In: 34nd International Symposium on Computational Geometry (SoCG 2018), Leibniz International Proceedings in Informatics (LIPICS), vol. 99, pp. 46:1–46:15 (2018)

  18. Kauffman, L.H., Lins, S.: Computing Turaev–Viro invariants for \(3\)-manifolds. Manuscripta Math. 72(1), 81–94 (1991)

    MathSciNet  Article  Google Scholar 

  19. Kirby, R., Melvin, P.: Local surgery formulas for quantum invariants and the Arf invariant. In: Proceedings of the Casson Fest. Geometry and Topology Monographs, vol. 7, pp. 213–233. Geometry and Topology Publishers, Coventry (2004).

  20. Kleiner, B., Lott, J.: Notes on Perelman’s papers. Geom. Topol. 12(5), 2587–2855 (2008)

    MathSciNet  Article  Google Scholar 

  21. Kloks, T.: Treewidth: Computations and Approximations, vol. 842. Springer, Berlin (1994)

    MATH  Google Scholar 

  22. Maria, C., Spreer, J.: A polynomial time algorithm to compute quantum invariants of 3-manifolds with bounded first Betti number. In: Proceedings of the ACM-SIAM Symposium on Discrete Algorithms (SODA 2017), pp. 2721–2732. ACM, New York (2017). arXiv:1607.02218

  23. Markov, I.L., Shi, Y.: Simulating quantum computation by contracting tensor networks. SIAM J. Comput. 38(3), 963–981 (2008).

    MathSciNet  Article  MATH  Google Scholar 

  24. Matveev, S.: Algorithmic Topology and Classification of 3-Manifolds. Algorithms and Computation in Mathematics, vol. 9. Springer, Berlin (2003)

    MATH  Google Scholar 

  25. Matveev, S., et al.: Manifold recognizer. Accessed Aug 2012

  26. Munkres, J.R.: Elements of Algebraic Topology. Addison-Wesley, Menlo Park (1984)

    MATH  Google Scholar 

  27. Robertson, N., Seymour, P.D.: Graph minors. II. Algorithmic aspects of tree-width. J. Algorithms 7(3), 309–322 (1986)

    MathSciNet  Article  Google Scholar 

  28. Toda, S.: PP is as hard as the polynomial-time hierarchy. SIAM J. Comput. 20(5), 865–877 (1991).

    MathSciNet  Article  MATH  Google Scholar 

  29. Turaev, V.G.: Quantum Invariants of Knots and 3-Manifolds. de Gruyter Studies in Mathematics, vol. 18, revised edn. Walter de Gruyter & Co., Berlin (2010).

    Book  MATH  Google Scholar 

  30. Turaev, V.G., Viro, O.Y.: State sum invariants of \(3\)-manifolds and quantum \(6j\)-symbols. Topology 31(4), 865–902 (1992)

    MathSciNet  Article  Google Scholar 

  31. Valiant, L.G.: The complexity of computing the permanent. Theor. Comput. Sci. 8, 189–201 (1979).

    MathSciNet  Article  MATH  Google Scholar 

  32. van Dijk, T., van den Heuvel, J.P., Slob, W.: Computing treewidth with LibTW (2006).

  33. Walker, K.: On Witten’s 3-manifold invariants (1991).

Download references


We would like to thank the anonymous referees for valuable suggestions which helped to improve the paper.

Author information



Corresponding author

Correspondence to Jonathan Spreer.

Additional information

This work is supported by the Australian Research Council (ARC), Projects DP1094516 and DP140104246.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Burton, B.A., Maria, C. & Spreer, J. Algorithms and complexity for Turaev–Viro invariants. J Appl. and Comput. Topology 2, 33–53 (2018).

Download citation


  • Computational topology
  • 3-manifolds
  • Invariants
  • #P-hardness
  • Parameterized complexity

Mathematics Subject Classification

  • 57M27
  • 57Q15
  • 68Q17