Journal of Mathematical Chemistry

, Volume 56, Issue 5, pp 1437–1444 | Cite as

Computing the maximal canonical form for trees in polynomial time

  • Gunnar Brinkmann
Original Paper


Known algorithms computing a canonical form for trees in linear time use specialized canonical forms for trees and no canonical forms defined for all graphs. For a graph \(G=(V,E)\) the maximal canonical form is obtained by relabelling the vertices with \(1,\ldots ,|V|\) in a way that the binary number with \(|V|^2\) bits that is the result of concatenating the rows of the adjacency matrix is maximal. This maximal canonical form is not only defined for all graphs but even plays a special role among the canonical forms for graphs due to some nesting properties allowing orderly algorithms. We give an \(O(|V|^2)\) algorithm to compute the maximal canonical form of a tree.


Tree Canonical form Structure enumeration 


  1. 1.
    G. Brinkmann, Fast generation of cubic graphs. J. Graph Theory 23(2), 139–149 (1996)CrossRefGoogle Scholar
  2. 2.
    Z. Du, Wiener indices of trees and monocyclic graphs with given bipartition. Int. J. Quantum Chem. 112, 1598–1605 (2012)CrossRefGoogle Scholar
  3. 3.
    I.A. Faradžev, Constructive enumeration of combinatorial objects, in Colloques Internationaux C.N.R.S. No260—Problèmes Combinatoires et Théorie des Graphes, (Orsay, 1976), pp. 131–135Google Scholar
  4. 4.
    R. Grund, Konstruktion schlichter graphen mit gegebener gradpartition. Bayreuth. Math. Schriften 44, 73–104 (1993)Google Scholar
  5. 5.
    G. Li, F. Ruskey, The advantages of forward thinking in generating rooted and free trees, in 100th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), (1999), pp. 939–940Google Scholar
  6. 6.
    M. Meringer, Fast generation of regular graphs and construction of cages. J. Graph Theory 30(2), 137–146 (1999)CrossRefGoogle Scholar
  7. 7.
    R.C. Read (ed.), Graph Theory and Computing (Academic Press, New York, 1972)Google Scholar
  8. 8.
    R.C. Read, Every one a winner. Ann. Discrete Math. 2, 107–120 (1978)CrossRefGoogle Scholar
  9. 9.
    M. Suzuki, H. Nagamochi, T. Akutsu, Efficient enumeration of monocyclic chemical graphs with given path frequencies. J. Cheminform. 6, 31 (2014)CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Applied Mathematics, Computer Science and StatisticsGhent UniversityGhentBelgium

Personalised recommendations