Next Article in Journal
The Spatial Regime Conversion Method
Previous Article in Journal
On the Concept of Algebraic Crystallography
Previous Article in Special Issue
Graph Theoretic Analyses of Tessellations of Five Aperiodic Polykite Unitiles
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

Counting Tree-like Multigraphs with a Given Number of Vertices and Multiple Edges

Discrete Mathematics and Computational Intelligence Laboratory, Department of Mathematics, Quaid-i-Azam University, Islamabad 45320, Pakistan
*
Author to whom correspondence should be addressed.
Mathematics 2025, 13(21), 3405; https://doi.org/10.3390/math13213405 (registering DOI)
Submission received: 20 July 2025 / Revised: 18 October 2025 / Accepted: 23 October 2025 / Published: 26 October 2025
(This article belongs to the Special Issue Graph Theory and Applications, 3rd Edition)

Abstract

The enumeration of chemical graphs plays a crucial role in cheminformatics and bioinformatics, especially in the search for novel drug discovery. These graphs are usually tree-like multigraphs, or they consist of tree-like multigraphs attached to a central core. In both configurations, the tree-like components play a key role in determining the properties and activities of chemical compounds. In this work, we propose a dynamic programming approach to precisely count the number of tree-like multigraphs with a given number of n vertices and Δ multiple edges. Our method transforms multigraphs into rooted forms by designating their unicentroid or bicentroid as the root and then defining a canonical representation based on the maximal subgraphs rooted at the root’s children. This canonical form ensures that each multigraph is counted only once. Recursive formulas are then established based on the number of vertices and multiple edges in the largest subgraphs rooted at the root’s children. The resulting algorithm achieves a time complexity of O(n2(n+Δ(n+Δ2·min{n,Δ}))) and space complexity of O(n2(Δ3+1)). Extensive experiments demonstrate that the proposed method scales efficiently, being able to count multigraphs with up to 200 vertices (e.g., (200, 26)) and up to 50 multiple edges (e.g., (90, 50)) in under 15 min. In contrast, the available state-of-the-art tool Nauty runs out of memory beyond moderately sized instances, as it relies on explicit generation of all candidate multigraphs. These results highlight the practical advantage and strong potential of the proposed method as a scalable tool for chemical graph enumeration in drug discovery applications.
Keywords: trees; chemical graphs; graph isomorphism; enumeration; dynamic programming trees; chemical graphs; graph isomorphism; enumeration; dynamic programming

Share and Cite

MDPI and ACS Style

Ilyas, M.; Hayat, S.; Azam, N.A. Counting Tree-like Multigraphs with a Given Number of Vertices and Multiple Edges. Mathematics 2025, 13, 3405. https://doi.org/10.3390/math13213405

AMA Style

Ilyas M, Hayat S, Azam NA. Counting Tree-like Multigraphs with a Given Number of Vertices and Multiple Edges. Mathematics. 2025; 13(21):3405. https://doi.org/10.3390/math13213405

Chicago/Turabian Style

Ilyas, Muhammad, Seemab Hayat, and Naveed Ahmed Azam. 2025. "Counting Tree-like Multigraphs with a Given Number of Vertices and Multiple Edges" Mathematics 13, no. 21: 3405. https://doi.org/10.3390/math13213405

APA Style

Ilyas, M., Hayat, S., & Azam, N. A. (2025). Counting Tree-like Multigraphs with a Given Number of Vertices and Multiple Edges. Mathematics, 13(21), 3405. https://doi.org/10.3390/math13213405

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop