5
Resistance Distance in Graphs and Random Walks JOSÉ LUIS PALACIOS Departamento de Cómputo Científico y Estadística, Universidad Simón Bolívar, Apartado 89,000, Caracas, Venezuela Received 1 May 2000; accepted 20 May 2000 ABSTRACT: We study the resistance distance on connected undirected graphs, linking this concept to the fruitful area of random walks on graphs. We provide two short proofs of a general lower bound for the resistance, or Kirchhoff index, of graphs on N vertices, as well as an upper bound and a general formula to compute it exactly, whose complexity is that of inverting an N × N matrix. We argue that the formulas for the resistance in the case of the Platonic solids can be generalized to all distance-transitive graphs. c 2001 John Wiley & Sons, Inc. Int J Quantum Chem 81: 29–33, 2001 Key words: resistance distance; effective resistance; commute times; Platonic solids; distance-transitive graphs Introduction T he resistance, or Kirchhoff index, R(G) of a connected undirected graph G = (V, E), with vertex set V ={1, 2, ... , N} and edge set E, was de- fined by Klein and Randi´ c [1] as R(G) = X i<j R ij , (1) where R ij is the effective resistance between vertices i and j as computed with Ohm’s law when all the edges of G are considered to be unit resistors. The quantity R ij is shown in [1] to be a distance function on the set of vertices, and it is introduced together with the index R(G) as an alternative to the usual graph theoretical distance and the indices this clas- Correspondence to: J. L.Palacios; e-mail: [email protected]. sic distance generates. For the relationships between the different indices and their uses in chemistry, the reader is referred to Refs. [2 – 5] In their recent paper, Lukovits et al. [6], com- puted the value of R(G) for K N (the complete graph on N vertices), C N (the N-cycle), and four of the Pla- tonic graphs and showed that for any graph G on N vertices, R(G) R(K N ). (2) It is the purpose of this article to discuss the fruitful connection between electric networks and random walks on graphs, to provide two short proofs of (2) as well as an upper bound and a general formula to compute the resistance of any connected undirected graph exactly, whose complexity is that of inverting an N × N matrix. We also give closed form formu- las in the case of distance-transitive graphs, which includes the particular case of the Platonic solids. International Journal of Quantum Chemistry, Vol. 81, 29–33 (2001) c 2001 John Wiley & Sons, Inc.

Resistance distance in graphs and random walks

Embed Size (px)

Citation preview

Page 1: Resistance distance in graphs and random walks

Resistance Distance in Graphs andRandom Walks

JOSÉ LUIS PALACIOSDepartamento de Cómputo Científico y Estadística, Universidad Simón Bolívar, Apartado 89,000,Caracas, Venezuela

Received 1 May 2000; accepted 20 May 2000

ABSTRACT: We study the resistance distance on connected undirected graphs, linkingthis concept to the fruitful area of random walks on graphs. We provide two short proofsof a general lower bound for the resistance, or Kirchhoff index, of graphs on N vertices, aswell as an upper bound and a general formula to compute it exactly, whose complexity isthat of inverting an N ×N matrix. We argue that the formulas for the resistance in the caseof the Platonic solids can be generalized to all distance-transitive graphs. c© 2001 JohnWiley & Sons, Inc. Int J Quantum Chem 81: 29–33, 2001

Key words: resistance distance; effective resistance; commute times; Platonic solids;distance-transitive graphs

Introduction

T he resistance, or Kirchhoff index, R(G) of aconnected undirected graph G = (V, E), with

vertex set V = {1, 2, . . . , N} and edge set E, was de-fined by Klein and Randic [1] as

R(G) =∑i<j

Rij, (1)

where Rij is the effective resistance between verticesi and j as computed with Ohm’s law when all theedges of G are considered to be unit resistors. Thequantity Rij is shown in [1] to be a distance functionon the set of vertices, and it is introduced togetherwith the index R(G) as an alternative to the usualgraph theoretical distance and the indices this clas-

Correspondence to: J. L.Palacios; e-mail: [email protected].

sic distance generates. For the relationships betweenthe different indices and their uses in chemistry, thereader is referred to Refs. [2 – 5]

In their recent paper, Lukovits et al. [6], com-puted the value of R(G) for KN (the complete graphon N vertices), CN (the N-cycle), and four of the Pla-tonic graphs and showed that for any graph G on Nvertices,

R(G) ≥ R(KN). (2)

It is the purpose of this article to discuss the fruitfulconnection between electric networks and randomwalks on graphs, to provide two short proofs of (2)as well as an upper bound and a general formula tocompute the resistance of any connected undirectedgraph exactly, whose complexity is that of invertingan N × N matrix. We also give closed form formu-las in the case of distance-transitive graphs, whichincludes the particular case of the Platonic solids.

International Journal of Quantum Chemistry, Vol. 81, 29–33 (2001)c© 2001 John Wiley & Sons, Inc.

Page 2: Resistance distance in graphs and random walks

PALACIOS

Random Walks on Graphs

On a connected undirected graph G = (V, E) suchthat the edge between vertices i and j is given a resis-tance rij (or equivalently, a conductance Cij = 1/rij),we can define the random walk on G as the Markovchain Xn, n ≥ 0, that from its current vertex v jumpsto the neighboring vertex w with probability pvw =Cvw/C(v), where C(v) = ∑

w: w∼v Cvw, and w ∼ vmeans that w is a neighbor of v. There may be aconductance Czz from a vertex z to itself, giving riseto a transition probability from z to itself, thoughthe most studied case of these random walks ongraphs, the simple random walk, excludes the loops(the presence or absence of loops does not changethe values of the effective resistances) and considersall rij’s to be equal to 1, which is the case consideredin [6] and in what follows.

The hitting time (also called the passage time)Tb of the vertex b is the number of jumps the walkneeds to reach b, formally

Tb = inf{n > 0 : Xn = b}.The expected value of Tb when the walk is started atthe vertex a is denoted by EaTb. The expected com-mute time between vertices a and b is defined asEaTb + EbTa.

When studying random walks on graphs fromthe viewpoint of electric networks, a thorough workreadily accessible to the beginner is found in thebook of Doyle and Snell [7]. There one can find afull account of the probabilistic interpretations ofvoltage, current flow, and effective resistance, withsome interesting applications such as the solutionsof the classical ruin problem and of the problem ofrecurrence or transience for random walks on the N-dimensional grid. Two other mandatory referencesin this context are the papers of Chandra et al. [8]and Tetali [9]. In the first they prove the followingrelation between commute times and effective resis-tances:

EaTb + EbTa = 2|E|Rab. (3)

In the second, besides a one-sided generalizationof (3), there is a proof of an old electrical result,Foster’s theorem (see Ref. [10]), that has been redis-covered several times [1, 11] and which we will usebelow, stating ∑

i∼j

Rij = N − 1. (4)

We begin to apply the preceding references giv-ing two different proofs of the inequality (2).

First Proof. A well-known electric fact discussedin [7], known as the monotonicity principle, statesthat if in an electric network the resistance of a givenresistor is increased (respectively decreased), thenthe effective resistance between any two verticesin the original network is less than (respectivelygreater than) or equal to the effective resistance be-tween those same vertices in the modified network.

Now, any graph G on N vertices may be thoughtof as the final result of deleting from KN a collectionof edges. Each deletion means replacing a resistor ofvalue 1 from KN by a resistor of infinite resistance,and thus, by the monotonicity principle RK

ij ≤ RGij

for any pair i, j, where RKij and RG

ij are the effective re-sistances between i and j in, respectively, KN and G.Adding over all i < j yields the desired inequality.

Second Proof. By definition

R(G) =∑i<j

Rij =∑i∼j

Rij +∑i6∼j

Rij

≥∑i∼j

Rij = N − 1 = R(KN).

In the previous line, the first equality is Foster’stheorem applied to G, and the second equality isFoster’s theorem applied to KN.

Obviously, the second proof has the added virtuethat it identifies the value of R(KN).

A question related to the lower bound (2) is tofind the graph on N vertices which maximizes the re-sistance. This turns out to be the linear graph on Nvertices, for which R(G) = 1

6 (N3 − N). To see whythis is true, we notice that if a graph contains a cycle,deleting an edge from the cycle yields a connectedgraph with an increase in the effective resistances,by the monotonicity principle invoked in the firstproof of the lower bound. Thus the maximal resis-tance must be found among graphs without cycles,that is, among trees. Now, given a tree on N vertices,let us assume it has two leaves l1 and l2 with a com-mon neighbor v; then, removing the edge (l1, v) andadding the new edge (l1, l2) creates a new tree thathas one less leaf and larger resistance than the orig-inal tree, as can be seen by direct computation. It isnot difficult to generalize this idea to get an algo-rithm that increases the resistance of the tree as itdecreases the number of leaves until the tree is leftwith only two leaves, that is, until it becomes thelinear graph on N vertices.

30 VOL. 81, NO. 1

Page 3: Resistance distance in graphs and random walks

RESISTANCE DISTANCE IN GRAPHS AND RANDOM WALKS

Computations of R(G)

Formula (3) can be viewed in two ways: on theone hand, if we know how to find an effective resis-tance using symmetry, some electric trick, etc., thenwe have a way to compute a commute time; on theother hand, we could use classical ways to computeEaTb and EbTa to find Rab.

An example of the first viewpoint is the com-putation of hitting times between opposite verticesof the Platonic graphs, which possess a numberof symmetry properties (they are vertex-, arc-, anddistance-transitive) guaranteeing EaTb = EbTa sothat formula (3) simplifies to EaTb = |E|Rab. Ef-fective resistances between opposite vertices (thoseat maximal distance form one another) of the Pla-tonic graphs are easy to find, because all vertices ata given distance from a fixed vertex can be gluedtogether (or in electric parlance, shortened), simpli-fying the computations. For details, the reader isreferred to Ref. [12].

The second viewpoint allows us to compute R(G)with an easily programmable method which inessence consists of inverting an N × N matrix andadding up all its entries. By the definition and (3)

R(G) = 12|E|

∑i<j

(EiTj + EjTi),

and by Markov chain theory (see Ref. [13]), if P isthe transition matrix of the walk under considera-tion, I is the N × N identity matrix, and W is theN × N matrix all of whose rows are copies of thevector w = (1/2|E|)[d(1), d(2), . . . , d(N)], where d(i) isthe number of neighbors of the vertex i, also knownas the degree of i (in Markov chain lingo, w is thestationary distribution), then from the matrix

Z = (I − P+W)−1,

we get all expected hitting times as

EiTj = Z( j, j)− Z(i, j)w( j)

.

Thus

R(G) = 12|E|

∑i

∑j

Z( j, j)− Z( i, j)w( j)

= 12|E|

∑j

1w( j)

[(N − 1)Z( j, j)−

∑i 6= j

Z(i, j)]

.

(5)

Formula (5) allows us to verify the results ofLukovits et al. [6] found with direct arguments us-

ing Ohm’s laws and Schlegel graphs; their result forthe icosahedron is wrong and should be replacedwith 28. Also, missing from their study is the re-sistance for the dodecahedron that turns out to be182.67.

It should be pointed out that in Refs. [1] and [5]one can find alternative ways to compute R(G) withthe same complexity of inverting an N × N ma-trix. It should also be pointed out that the problemof obtaining these inverses can be broken downinto smaller tasks when there is a cutpoint in thegraph, with impressive savings of computational ef-fort, particularly in the case of trees, as is shown inRef. [14].

Alternatively, we could find the resistance forthe Platonic graphs using the results of van Steen-wijk [15], who cleverly uses the superpositionprinciple to find the following table of effectiveresistances (here, as in Ref. [6], Ri denotes theeffective resistance between vertices at distance i):

Graph |V| |E| R1 R2 R3 R4 R5

Tetrahedron 4 6 12

Octahedron 6 12 512

12

Icosahedron 12 30 1130

715

12

Cube 8 12 712

34

56

Dodecahedron 20 30 1930

910

1615

1715

76

Then we use the fact that for any of these graphswe can compute their resistance thus: if n(k), k ≥ 1denotes the cardinality of the set {(i, j) : d(i, j) = k},then

R(G) =∑

d(i,j)= 1

Ri,j +∑

d(i,j)= 2

Rij +∑

d(i,j)= 3

Rij + · · ·

= R1n(1)+ R2n(2)+ R3n(3)+ · · · . (6)

This can be made even easier if we use the fact that

n(k) = ∣∣{j : d(i, j) = k}∣∣ |V|

2; (7)

that is, for a fixed vertex i we count the number ofvertices at a distance k from it, and then multiply by|V| and divide by 2 to avoid double counting. Then(6) becomes, for instance

for the icosahedron: 1130 (30)+ 7

15 (30)+ 12 (6) = 28;

for the dodecahedron: 1930 (30)+ 9

10 (60)+ 1615 (60)

+ 1715 (30)+ 7

6 (10) = 5483 .

INTERNATIONAL JOURNAL OF QUANTUM CHEMISTRY 31

Page 4: Resistance distance in graphs and random walks

PALACIOS

One can generalize the range of applicability offormula (6) by noticing that the only requirementon the graph is that all effective resistances betweenvertices at a given distance k be the same for all pos-sible distances. This can be achieved if for every fourvertices u, v, w, z such that d(u, v) = d(w, z), there is agraph automorphism α (i.e., a bijection in the vertexset that preserves adjacencies) such that α(u) = wand α(v) = z. Such graphs are said to be distance-transitive, and there is a considerable amount ofresearch on these graphs. See Ref. [16] for details.

We prove next a couple of propositions show-ing how this generalization might work and howuseful it is to connect random walks to resistancedistance. We notice first that for distance-transitivegraphs, the condition of the effective resistances de-pending only on the distance implies that the hittingtimes depend only on the distance between the ver-tices in question, so that we may replace EiTj byET(s) whenever we have d(i, j) = s. Also, let M =max{d(i, j) : i, j ∈ V}; that is, let M be the maxi-mal distance between pairs of vertices in G, usuallycalled the diameter of G; it may happen that for agiven vertex i ∈ G there is a single vertex j at dis-tance M, or it may happen that there is more thanone sharing that property. In the first case we saythat G has opposite vertices at distance M (this oc-curs, for instance, in all Platonic graphs except thetetrahedron, and all even cycles, but not in odd cy-cles). Then we can prove

Proposition 1. If G is a distance-transitive graphwith opposite vertices at distance M then

RM = 1|E| + RM−1.

Proof. Assume i and j are such that d(i, j) = M, andlet d be the number of neighbors of a vertex. Wecompute EiTj by conditioning on where the walk isbefore taking its last jump into j. This yields

EiTj = 1+ 1d

∑k∼j

EiTk. (8)

By hypothesis, all k in the summation are such thatd(i, k) =M− 1, so that (8) becomes

ET(M) = 1+ 1d

∑k∼j

ET(M− 1). (9)

But there are d identical summands in the sum in (9);therefore

ET(M) = 1+ ET(M− 1). (10)

Multiplying (10) by 2 to obtain commute times anddividing by 2|E| to obtain effective resistances viaEquation (3), we get the desired result.

This property was noticed by van Steenwijk [16]for the particular case of the Platonic graphs. Nextwe prove

Proposition 2. If G is an N vertex, a distance-transi-tive graph with opposite vertices at distance 2, then

R(G) = N − 1+ (N − 1− d)Nd

,

where d is the number of neighbors of a vertex.

Proof. By (6) we have

R(G) = R1n(1)+ R2n(2)

= N − 1+ R2∣∣{j : d(i, j) = 2

}∣∣N2

. (11)

By the previous proposition, R2 = (1/|E|)+ R1 =(N/|E|), and obviously, |{j : d(i, j) = 2}| = N − 1− d.Replacing these equations in (11), together with thefact that |E| = Nd/2 yields the desired result.

Proposition 2 applies to the octahedron and toall Cayley graphs Cay (Zn, Un), where n is odd andcomposite or a power of 2. Here Zn is the commu-tative ring of integers modulo n and Un is the setof units of Zn, that is, those elements of Zn whichpossess a multiplicative inverse and which happento be the nonzero integers less than n, which are rel-atively prime with n. For more details on this lastexample, see Ref. [17].

ACKNOWLEDGMENTS

The author, on sabbatical leave from Universi-dad Simón Bolívar, Caracas, wishes to thank theIbero-American Science and Technology EducationConsortium ISTEC and the department of Electri-cal and Computer Engineering of the University ofNew Mexico, for their support. Thanks are due toProfessor Johan Jonasson for suggesting the lineargraph for the upper bound.

References

1. Klein, D. J.; Randic, M. J Math Chem 1993, 12, 81.2. Bonchev, D.; Balaban, A. T.; Liu, X. Y.; Klein, D. J. Int J Quan-

tum Chem 1994, 50, 1.

32 VOL. 81, NO. 1

Page 5: Resistance distance in graphs and random walks

RESISTANCE DISTANCE IN GRAPHS AND RANDOM WALKS

3. Gutman, I.; Mohar, B. J Chem Inf Comput Sci 1996, 36,982.

4. Klein, D. J. Match 1997, 35, 7.

5. Klein, D. J.; Zhu, H. Y. J Math Chem 1998, 23,179.

6. Lukovits, I.; Nikolic, S.; Trinajstic, N. Int J Quantum Chem1999, 71, 217.

7. Doyle, P. G.; Snell, J. L. Random Walks and Electrical Net-works; The Mathematical Association of America: Washing-ton, DC, 1984.

8. Chandra, A. K.; Raghavan, P.; Ruzzo, W. L.; Smolensky, R.;Tiwari, P. The electrical resistance of a graph captures itscommute and cover times; In Proceedings of the TwentyFirst Annual ACM Symposium on Theory of Computing,Seattle, 1989, pp. 574–586.

9. Tetali, P. J Theor Probab 1991, 4, 101.

10. Foster, R. M. In Contributions to Applied Mechanics (Reiss-ner Aniversary Volume); Edwards Brothers: Ann Arbor, MI,1949, pp. 333–340.

11. Weinberg, L. IRE Trans Cir Th 1958, 5, 8.12. Palacios, J. L. Adv Appl Probab 1993, 26, 820.13. Grinstead, C. M.; Snell, J. L. Introduction to Probabil-

ity; American Mathematical Society: Providence, RI, 1997;Chapter 11.

14. Kirkland, S. J.; Neumann, M. SIAM J Matrix Anal Appl 1999,20, 860.

15. van Steenwijk, F. J. Am J Phys 1998, 66, 90.16. Buckley, F.; Harary, F. Distance in Graphs; Addison-Wesley:

Redwood City, CA, 1990; Chapter 8.17. Palacios, J. L.; Renom, J. M.; Berrizbeitia, P. Statist Probab

Lett 1999, 43, 25.

INTERNATIONAL JOURNAL OF QUANTUM CHEMISTRY 33