Mathematics, cilt.13, sa.15, 2025 (SCI-Expanded)
It is well-known that the necessary and sufficient condition for a connected graph tobe unicyclic is that its omega invariant, a recently introduced graph invariant useful incombinatorial and topological calculations, is zero. This condition could be stated as thecondition that the order and the size of the graph are equal. Using a recent result sayingthat the length of the unique cycle could be any integer between 1 and n − a1 where a1 is the number of pendant vertices in the graph, two explicit labeling algorithms are provided that attain these extremal values of the first and second Zagreb indices by means of an application of the well-known rearrangement inequality. When the cycle has the maximum length, we obtain the situation where all the pendant vertices are adjacent to the support vertices, the neighbors of the pendant vertices, which are placed only on the unique cycle. This makes it easy to calculate the second Zagreb index, as the contribution of the pendant edges to such indices is fixed, implying that we can only calculate these indices for the edges on the cycle.