You are on page 1of 6

Applied Mathematics Letters 18 (2005) 307–312

www.elsevier.com/locate/aml

Wiener index for graphs and their line graphs with arbitrary large
cyclomatic numbers✩
Andrey A. Dobrynin∗, Leonid S. Mel’nikov
Sobolev Institute of Mathematics, Siberian Branch of the Russian Academy of Sciences, Novosibirsk 630090, Russia

Received 1 October 2003; received in revised form 1 March 2004; accepted 1 March 2004

Abstract

The Wiener number, W (G), is the sum of the distances of all pairs of vertices in a graph G. Infinite families
of graphs with increasing cyclomatic number and the property W (G) = W (L(G)) are presented, where L(G)
denotes the line graph of G. This gives a positive (partial) answer to an open question posed in an earlier paper by
Gutman, Jovašević, and Dobrynin.
© 2004 Elsevier Ltd. All rights reserved.
Keywords: Distance in graphs; Graph invariant; Wiener index; Line graph; Cyclomatic number

1. Introduction
In this paper we are concerned with finite undirected connected graphs. The vertex and edge sets of
G are denoted by V (G) and E(G), respectively. The cyclomatic number µ of a graph G is defined as
µ(G) = |E(G)| − |V (G)| + 1. If u and v are vertices of G, then the number of edges in the shortest path
connecting them is said to be their distance and is denoted by d(u, v).

✩ This work was financially supported by the Russian Foundation for Basic Research (project codes 02-01-00039 and
04-01-00715).
∗ Corresponding author. Tel.: +7 3832332594; fax: +7 3832332598.
E-mail addresses: dobr@math.nsc.ru (A.A. Dobrynin), omeln@math.nsc.ru (L.S. Mel’nikov).

0893-9659/$ - see front matter © 2004 Elsevier Ltd. All rights reserved.
doi:10.1016/j.aml.2004.03.007
308 A.A. Dobrynin, L.S. Mel’nikov / Applied Mathematics Letters 18 (2005) 307–312

The sum W (G) of distances between all pairs of vertices of the graph G is the Wiener index (or Wiener
number) of G, named after chemist H. Wiener who first studied it in 1947 for acyclic structures [1]:

W (G) = d(u, v).
{u,v}⊆V (G)

The same quantity is known also as the distance of a graph or graph transmission [2,3]. Mathematical
properties and chemical applications of the Wiener index have been intensively studied in the last
thirty years [2–8]. This graph invariant belongs to the molecular structure-descriptors, called topological
indices, that are successfully used for the design of molecules with desired properties, including
pharmacologic and biological activity [9–11].
The line graph, L(G), of a graph G has the vertex set V (L(G)) = E(G), and two distinct vertices of
the graph L(G) are adjacent if the corresponding edges of G have a common endvertex. The concept of
line graph has found various applications in chemical research [12,13].
In this article we deal with graphs satisfying the following property:
W (G) = W (L(G)). (1)
It was shown that the Wiener index of a tree and its line graph are always distinct [14]. It is a
well-known fact that n-vertex graph G is isomorphic to L(G) if and only if G is the simple cycle
Cn . Therefore, the equality (1) holds for simple cycles in a trivial manner. For other unicyclic graphs,
W (L(G)) < W (G). Therefore, if a cycle-containing graph, except a simple cycle, satisfies the equality
(1), then it has at least two cycles [15–17]. There are exactly 26 minimal bicyclic graphs of order 9
having property (1) [16,17]. Series of bicyclic graphs with increasing order have been constructed in [15].
Minimal tricyclic graphs with property (1) have 12 vertices (71 graphs) [17]. The following question was
put forward in [17]:
Do there exist graphs with cyclomatic number µ having property (1) for every µ ≥ 4?
In this paper, we give a partial answer to this question by constructing two infinite families of graphs
with increasing cyclomatic number.

2. Graphs with increasing cyclomatic number


Our main result is:
Theorem. For any k > 0, there is a connected graph G with µ(G) > k and such that W (G) =
W (L(G)).
Consider the graph G and its line graph L(G) shown in Fig. 1. A dashed line between two subgraphs
of L(G) means that every vertex of one subgraph is adjacent to every vertex of the other subgraph. The
graph G has µ + s + r + 3 vertices and the cyclomatic number µ.
It is straightforward to prove that the Wiener indices of G and L(G) are given, respectively, by
W (G) = 2sµ + 2rµ + 3sr + s 2 + r 2 + 5s + 5r + µ2 + 3µ + 4,
W (L(G)) = (6sµ + 6rµ + 4sr + s 2 + r 2 + 5s + 5r + 6µ2 + 8µ + 2)/2.
Equality (1) leads to the following quadratic equation with respect to the parameters s, r and µ:
s 2 + s(2r + 5 − 2µ) − (2rµ − r 2 − 5r + 4µ2 + 2µ − 6) = 0.
A.A. Dobrynin, L.S. Mel’nikov / Applied Mathematics Letters 18 (2005) 307–312 309

Fig. 1. Families of graphs including graphs with property (1).

A suitable root of this equation is equal to



2µ − 2r − 5 + 20µ2 − 12µ + 1
s= .
2
The number s is an integer if and only if the radicand is an odd perfect square, i.e. 20µ2 − 12µ + 1 = y 2
for some odd integer y. Applying substitution x = 10µ − 3, the last equality can be rewritten as the
following Diophantine equation:
x 2 − 5y 2 = 4. (2)
This is a well-known equation in the number theory, namely, the Pell equation [18,19]. It has an infinite
number of solutions. All solutions of (2) are generated by the following explicit formulae for integer
n > 0:
 √ n  √ n
3+ 5 + 3− 5
xn = ,
  2n  
√ n √ n
3+ 5 − 3− 5
yn = √ .
2n 5
Consider now graphs H and L(H ) depicted in Fig. 1. The graph H has µ + s + r + 2 vertices and the
cyclomatic number µ. It is straightforward to prove that the Wiener indices of H and L(H ) are given,
respectively, by
W (H ) = 2sµ + 2rµ + 3sr + s 2 + r 2 + 2s + 2r + µ2 + µ + 1,
W (L(H )) = (6sµ + 6rµ + 4sr + s 2 + r 2 + s + r + 6µ2 )/2.
From Eq. (1), we have
s 2 + s(2r + 3 − 2µ) − (2rµ − r 2 − 3r + 4µ2 − 2µ − 2) = 0
and

2µ − 2r − 3 + 20µ2 − 20µ + 1
s= .
2
310 A.A. Dobrynin, L.S. Mel’nikov / Applied Mathematics Letters 18 (2005) 307–312

Table 1
Solutions of recurrent equations (4)
n xn yn ±4 n xn yn ±4 n xn yn ±4 n xn yn ±4
0 1 1 − 6 29 13 − 12 521 233 − 18 9349 4181 −
1 3 1 + 7 47 21 + 13 843 377 + 19 15127 6765 +
2 4 2 − 8 76 34 − 14 1364 610 − 20 24476 10946 −
3 7 3 + 9 123 55 + 15 2207 987 + 21 39603 17711 +
4 11 5 − 10 199 89 − 16 3571 1597 − 22 64079 28657 −
5 18 8 + 11 322 144 + 17 5778 2584 + 23 103682 46368 +

The number s is an integer if and only if 20µ2 − 20µ + 1 = x 2 for some odd integer x. Using substitution
y = 2µ − 1, the last equality can be presented as the following Pell equation:
x 2 − 5y 2 = −4. (3)
Solutions of (3) can be found from the explicit equation for odd n (even n give solutions of (2)):
 √ n
√ 1 + 5
xn + yn 5 = .
2n−1
The recurrent relations of the Pell equations (2) and (3) are more convenient for our purpose [19]:

xn = (xn−1 + 5yn−1 )/2
(4)
yn = (xn−1 + yn−1 )/2
where x0 = 1 and y0 = 1. All odd n generate solutions for (2) and even n generate solutions for (3).
The first solutions of (4) are presented in Table 1. Here the sign of the right part of (2) and (3) is also
indicated.
To construct an infinite sequence of graphs with increasing cyclomatic number that satisfy (1), we find
an infinite sequence of solutions of (4) with integer µs.
Consider the family based on the graph G. Since µ = (x + 3)/10, the last digit of x must be equal
to 7. From system (4), we can write the following equations:

xn+12 = 161xn + 360yn
yn+12 = 72xn + 161yn .
It is easy to see that xn+12 ≡ xn (mod 10), i.e. the last digits of xn+12 and xn are always equal. The last
digit depends on the initial solution. Starting with the solution x3 = 7 and y3 = 3 (see Table 1), we obtain
the first subfamily of the required graphs. The respective values of xn and yn are presented in Table 2 for
n = 3, 15, 27, . . .. Applying the initial solution x7 = 47 and y7 = 21 (see Table 1), we obtain the second
subfamily. Table 2 contains all corresponding xn and yn for n = 7, 19, 31, . . .. It should be noted that
yn+12 and yn are always odd integers and, therefore, µ is an integer.
Because of
y−5
s +r = µ+ ,
2
there are at least
 
2µ + y − 5
+1
4
A.A. Dobrynin, L.S. Mel’nikov / Applied Mathematics Letters 18 (2005) 307–312 311

Table 2
Solutions of the Pell equation x 2 − 5y 2 = 4 for the graph G
n xn yn µ N s W
3 7 3 1 1 0 8
7 47 21 5 7 13 408
15 2207 987 221 357 712 874716
19 15127 6765 1513 2447 4893 41065844
27 710647 317811 71065 114985 229968 90622230128
31 4870847 2178309 487085 788119 1576237 4257307018128
39 228826127 102334155 22882613 37024845 74049688 9395871416050884
43 1568397607 701408733 156839761 253772063 507544125 441405950984700908

Table 3
Solutions of the Pell equation x 2 − 5y 2 = −4 for the graph H
n xn yn µ N s W
0 1 1 1 1 0 3
4 11 5 3 4 7 118
6 29 13 7 11 20 777
10 199 89 45 72 143 35676
12 521 233 117 189 376 243919
16 3571 1597 799 1292 2583 11443890
18 9349 4181 2091 3383 6764 78426645
22 64079 28657 14329 23184 46367 3684111480
24 167761 75025 37513 60697 121392 25251079323
28 1149851 514229 257115 416020 832039 1186258356910
30 3010349 1346269 673135 1089155 2178308 8130732212001
34 20633239 9227465 4613733 7465176 14930351 381971253873492
36 54018521 24157817 12078909 19544085 39088168 2618069858979175
40 370248451 165580141 82790071 133957148 267914295 122993552950080618
42 969323029 433494437 216747219 350704367 701408732 843010351976279085

nonisomorphic graphs with property (1) for given µ. The fifth column of Table 2 contains the number N
of such graphs. As an illustration, the Wiener index for graphs with the maximal value of s (r = 0) is
shown in the last column. The first line of the table corresponds to the cycle C4 .
Consider now the family based on the graph H . In this case, we need solutions of (4) with odd y and x.
Using (4), we can write the following system:

xn+6 = 9xn + 20yn
yn+6 = 4xn + 9yn .
It is obvious that, if xn and yn are both odd, then xn+6 and yn+6 are also odd. Starting with the initial
solutions x0 = 1, y0 = 1 and x4 = 11, y4 = 5 (see Table 1), we obtain two subfamilies of the
required graphs. The corresponding solutions xn and yn are presented in Table 3 for n = 0, 6, 12, . . .
and n = 4, 10, 16, . . ., respectively.
Since
x −3
s +r = µ+ ,
2
312 A.A. Dobrynin, L.S. Mel’nikov / Applied Mathematics Letters 18 (2005) 307–312

there are at least


 
2µ + x − 3
+1
4
nonisomorphic graphs having property (1) for given µ. The number N of such graphs is presented in
Table 3. The Wiener index for graphs with the maximal s (r = 0) is shown in the last column. The first
line of the table corresponds to the triangle C3 . √
The order of all constructed graphs is asymptotically equal to (2 + 5)µ ≈ 4.236µ when µ → ∞.
We conjecture that these graphs are minimal among all graphs with given cyclomatic number satisfying
property (1).

Acknowledgements
The authors are greatly indebted to the referees for their valuable comments and helpful suggestions.

References
[1] H. Wiener, Structural determination of paraffin boiling points, J. Amer. Chem. Soc. 69 (1947) 17–20.
[2] R.C. Entringer, D.E. Jackson, D.A. Snyder, Distance in graphs, Czechoslovak Math. J. 26 (1976) 283–296.
[3] J. Plesnik, On the sum of all distances in a graph or digraph, J. Graph Theory 8 (1984) 1–21.
[4] I. Gutman, O.E. Polansky, Mathematical Concepts in Organic Chemistry, Springer-Verlag, Berlin, 1986.
[5] N. Trinajstić, Chemical Graph Theory, CRC Press, Boca Raton, 1992.
[6] S. Nikolić, N. Trinajstić, Z. Mihalić, The Wiener index: developments and applications, Croat. Chem. Acta 68 (1995)
105–129.
[7] A.A. Dobrynin, R. Entringer, I. Gutman, Wiener index for trees: theory and applications, Acta Appl. Math. 66 (2001)
211–249.
[8] A.A. Dobrynin, I. Gutman, S. Klavzar, P. Zigert, Wiener index of hexagonal systems, Acta Appl. Math. 72 (2002) 247–294.
[9] J. Devillers, A.T. Balaban (Eds.), Topological Indices and Related Descriptors in QSAR and QSPR, Gordon and Breach,
Reading, UK, 1999.
[10] R. Todeschini, V. Consonni, Handbook of Molecular Descriptors, Wiley-VCH, Weinheim, 2000.
[11] M. Karelson, Molecular Descriptors in QSAR/QSPR, Wiley, New York, 2000.
[12] I. Gutman, E. Estrada, Topological indices based on the line graph of the molecular graph, J. Chem. Inf. Comput. Sci. 36
(1996) 541–543.
[13] I. Gutman, L. Popović, B.K. Mishra, M. Kaunar, E. Estrada, N. Guevara, Application of line graphs in physical chemistry.
Predicting surface tension of alkanes, J. Serb. Chem. Soc. 62 (1997) 1025–1029.
[14] F. Buckley, Mean distance of line graphs, Congr. Numer. 32 (1981) 153–162.
[15] I. Gutman, L. Pavlović, More on distance of line graphs, Graph Theory Notes N.Y. 33 (1997) 14–18.
[16] I. Gutman, V. Jovašević, A.A. Dobrynin, Smallest graphs for which the distance of the graph is equal to the distance of its
line graph, Graph Theory Notes N.Y. 33 (1997) 19.
[17] A.A. Dobrynin, I. Gutman, V. Jovašević, Bicyclic graphs and their line graphs with the same Wiener index, Diskretn. Anal.
Issled. Oper. Ser 2 4 (2) (1997) 3–9 (in Russian).
[18] D. Redmond, Number Theory: An Introduction, Marcel Dekker, New York, Basel, 1996.
[19] J. Robertson, Solving the generalized Pell equation, 2002, p. 24. http://hometown.aol.com/jpr2718/pelleqns.html.

You might also like