This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Open AccessArticle
Counting Tree-like Multigraphs with a Given Number of Vertices and Multiple Edges
by
Muhammad Ilyas
Muhammad Ilyas ,
Seemab Hayat
Seemab Hayat and
Naveed Ahmed Azam
Naveed Ahmed Azam *
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
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 and space complexity of . 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.
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
Article Access Statistics
For more information on the journal statistics, click
here.
Multiple requests from the same IP address are counted as one view.