In 1998, Pandu Rangan et al. proved that locating theg-centroid for an arbitrary graph is ᏺᏼ-hard by reducing the problem of finding the maximum clique size of a graph to the g-centroid location problem. They have also given an efficient polynomial time algorithm for locating theg-centroid for maximal outerplanar graphs, Ptolemaic graphs, and split graphs. In this paper, we present anO(nm) time algorithm for locating theg-centroid for cographs, wherenis the number of vertices andmis the number of edges of the graph.
1. Introduction
In this introductory section, we present some basic terminology of graph theory and a strong motivation for the study ofg-centroid location problem.
A graphGconsists of a finite nonempty setV=V(G) ofverticestogether with a set E=E(G) of unordered pairs of distinct vertices ofV. The paire= {u,v}of vertices inE is called anedgeofG. We also write an edgee= {u,v}ase=uv.
Ife=uv∈E, thenuandvare calledadjacentvertices andeisincidentwith each of its two verticesuandv.
Thedegreeof a vertexu, denoted byd(u), is the number of edges incident with it. Fori≥1, theithneighbourhoodofu∈V(G) is defined asNi(u)= {v∈V(G)|d(u,v)
=i}. We callN1(u) by simplyN(u).
Theeccentricityof a vertexu, denoted bye(u), is defined ase(u)=max{d(u,v) :v∈ V(G)}, whered(u,v) is the distance betweenuandv.
A graph isself-centeredif the eccentricity of a vertex is the same as that of every other vertices. The length of any longest geodesic inGis called thediameterofG.
LetG1=(V1,E1) andG2=(V2,E2) be two graphs. Thejoinof G1 andG2, denoted
byG=G1∨G2, has the vertex setV=V1∪V2and the edge setE=E1∪E2∪ {uv|u∈
V1,v∈V2}.
For further common terms not explicitly mentioned here, reference may be made (with suitable changes) to Bondy and Murty [1], Buckley and Harary [2], or Parthasarathy [12].
Copyright©2005 Hindawi Publishing Corporation
4 3
5 2
1
Figure1.1
Several types of convexity in graphs have been studied in the past modeled on similar concepts in Euclidean space and topology. But the most important and the natural type of graph convexity is thegeodetic convexity(g-convexity for short). This was introduced and studied by several researchers. See, for example, Mulder [9], Nieminen [10], Duchet [3], and Soltan and Chepo˘ı [13].
We now give the definition ofg-centroid through theg-convexity for graphs.
Definition 1.1. A setS⊆V isgeodetic convex(g-convex for short) if for every pair of verticesu,v∈S, all vertices on anyu−vshortest path (also called ageodesic path) belong toS.
From the above definition, it easily follows that a singleton set, vertex pair of an edge, and the whole vertex setV(G) areg-convex sets ofG. We call them as trivialg-convex sets. Also ifSis a clique (Sinduces a complete subgraph ofG), thenSis ag-convex set ofG.
Any communication network can be naturally modeled as a graph where the vertices represent either computers or intermediate message processors and the edges represent interconnections between them. In most of the communication networks, information between any two nodes tends to flow through any shortest path connecting them (e.g., paths with least hop count in case of distance vector protocols, and least weighted paths in case of link state routing protocols in the internetwork). Thus ag-convex set is basically a set of nodes that isclosedwith respect to the flow of information.
Definition 1.2. LetG=(V,E) be any connected graph. Forv∈V, theg-weightw(v)= max{|S|:Sis ag-convex set ofGnot containingv}. Letgc(G)=min{w(v) :v∈V}. Then gc(G) is called theg-centroidal numberofGand the verticesvfor whichw(v)=gc(G) are called theg-centroidalvertices. Theg-centroidCg(G) is the set of allg-centroidal vertices ofG(i.e.,g-centroid is a set of vertices which satisfies the min-max relation).
Forv∈V(G), we denote bySv=Sv(G), any maximumg-convex set ofGnot contain-ingv.
In Mitchell [8], theg-centroid for trees plays the role of a “telephone center” through which maximum number of calls can pass at any given time for an optimal load balancing in a telephone network.
In [4], Gerstel and Zaks have discussed an application ofg-centroid in distributed computing, in particular, to the message passing model of a distributed asynchronous networks. They have proved that given a network with a tree topology, choosing a g-centroidal vertex and then routing all the information through it is the best possible strategy in case of worst case complexity of any distributed sorting algorithm.
In [7], Kang and Ault gave some properties of theg-centroid for a tree and indicated some possible application in information retrieval.
However, in all the above three papers, the authors have considered only tree networks. These results can be extended for arbitrary graphs, which we present in our future papers. Thus the problem of locating theg-centroid of a graph gained importance. In [11] Pandu Rangan et al. have proved that locating theg-centroid for an arbitrary graph is ᏺᏼ-hard by reducing the problem of finding the maximum clique size of a graph to the problem of locating theg-centroid.
However, in practice, the underlaying topology of any application network will have some special graph properties like being acyclic or belong to a special classes of perfect graphs. Severalᏺᏼ-hard orᏺᏼ-complete problems for arbitrary graphs have a nicer polynomial time algorithm on special classes of perfect graphs. For more detail on perfect graphs and the algorithmic aspects on perfect graphs, see Golumbic [5].
Among several classes of perfect graphs, chordal graphs, permutation graphs, and cographs are the most important ones due to their practical application. In this paper, we consider cographs and present a polynomial time algorithm for locating theg-centroid.
We now give the definitions of some special classes of perfect graphs considered in this paper. First we define the permutation graphs.
Letπ be a permutation of the sequence 1, 2,. . .,n. The graphG(π)=(V,E) for the permutationπis defined as follows:
V= {1, 2,. . .,n}andi j∈Eif and only if (i−j)(πi−1−π−j1)<0, whereπi−1is the pre-image ofiunder the permutationπ.
An undirected graphGis called apermutation graphif there exists a permutationπ such thatGis isomorphic toG(π) for some permutationπ.
A graphGis adistance hereditary graphif for any two verticesu,vofG, the distance be-tweenuandvinGis the same as that of the distance betweenuandvin every connected induced subgraph containing both.
A graph is acomplement reducible graph(popularly known ascograph) if it can be re-duced to an empty graph by successively taking complements with in components (West [14]).
2. Structural results for cographs
In this section, we present some structural results on cographs using some of the well-known earlier results. Using these results, we present anO(nm) time algorithm for locat-ing theg-centroid. Our structural characterizations can also used to provide polynomial time algorithm for otherᏺᏼ-hard orᏺᏼ-complete problems on cographs.
Several characterizations of cographs are known. But the most important one is the following.
Proposition 2.1. A graph G is a cograph if and only if it contains noP4 (a path on4
vertices) as an induced subgraph.
As an immediate observation, we have the following results which specifies the maxi-mum diameter and the properties of induced subgraphs of cographs.
Corollary2.2. LetGbe a connected cograph. Then for anyu∈V, the eccentricitye(u)≤ 2. That is, if a cograph is connected, then its diameter is at most two.
Even though cographs can be disconnected, in this paper, we consider only connected cographs. Thus the graphs considered in this paper will have diameter at most two.
Proposition2.3. Any induced subgraph of a cograph is again a cograph. The following proposition is true for any arbitrary graph.
Proposition2.4. LetGbe any connected graph andu∈V(G). For anySu,Su∩N(u)is either empty or induces a complete subgraph ofG. Further, ife(u)=1, thenSuis a maximum clique ofG− {u}.
Proof. Letx,y∈Su∩N(u). Ifx and yare nonadjacent, thenx,u, yis a geodesic path joiningxand y. SinceSuisg-convex, this requiresu∈Su, a contradiction. Thusxy∈E and henceSu∩N(u) induces a complete subgraph ofG.
The second part of the proposition follows from the maximality ofSu. We now discuss about theg-centroid ofGwhenGhas a vertex of eccentricity one.
Proposition2.5. LetG be a cograph. LetU= {u1,u2,. . .,ur}be the set of all vertices of G with eccentricity one (and therefore degreen−1). IfG=G−U is disconnected, then Cg(G)=U.
Proof. LetM1,M2,. . .,Msbe the maximum cliques of G of size ω(G)=ω and M=
∩s
i=1Mi. FromProposition 2.4, it follows thatw(ui)=ω+r−1. We split our discussion into two cases depending upon whetherMis empty or not.
Case 1 (M is empty). In this case for each vertexx ofG, we can find an i, 1≤i≤s, such thatx /∈Mi. ThusU∪Mi is ag-convex ofG (as it is a clique) not containingx with cardinalityr+ω. Therefore,w(x)> w(ui). By the arbitrariness ofx, it follows that Cg(G)=U.
Proposition2.6. LetGbe a cograph andGbe defined as in the previous proposition. IfG is connected, thenGis a self-centered cograph of diameter two.
Proof. FromProposition 2.3,Gis again a cograph. SinceGis connected, byCorollary 2.2,eG(u)≤2 for every vertexu∈V(G). We claim thatGhas no vertex of eccentricity
one. On the contrary, ifuis a vertex of eccentricity one inG, thenuis adjacent to every vertex ofG. Sinceui’s are adjacent to every vertex ofG, it follows thatuis adjacent to every vertex ofG. ThuseG(u)=1. This contradicts the definition ofG; henceeG(u)=2
for everyu∈G.
We now analyze the structure of self-centered cographs.
Proposition2.7. LetGbe a self-centered cograph of diameter two and letube a vertex of G. Then the following hold.
(1)If eitherN(u)is disconnected andN2(u)is connected or if both are disconnected,
then for everyx∈N(u)andy∈N2(u),xy∈E. That is,G−u= N(u) ∨ N2(u).
(2)If bothN(u)andN2(u)are connected, thenG−u= A ∨ (N2(u)∪B), where
Ais the set of vertices ofN(u)having a descendant inN2(u)andB=N(u)−A. Also Ais an incomplete graph.
(3)IfN(u)is connected andN2(u)is disconnected, then there exists a pair of non
adjacent verticesx1,x2ofN(u)such thatx1 andx2are adjacent to every vertex of
N2(u).
Proof. (1) LetN(u)be disconnected andN2(u)be connected. Letx∈N(u) andy∈
N2(u). LetC1 be the component ofN(u)containingx. Letx1 be any parent of y in
N(u). Ifx1belongs to a componentC2different fromC1, then by considering the pathy,
x1,u,x, we havexy∈E(asGhas no inducedP4). Supposex1∈C1. LetC2be any other
component ofN(u)andx2∈C2. Consider the path y,x1,u,x2. Since this is not an
induced path,yx2∈E. But, then, as beforexy∈E.
In the above proof, we have not used the fact thatN2(u) is connected. Therefore,
even ifN2(u)is disconnected,xy∈E.
(2) LetAbe the set of all vertices inN(u) having a descendant inN2(u).
We prove this case through the following three claims:
(1) every vertex ofAis adjacent to every other vertex ofN2(u);
(2) every vertex ofAis adjacent to every other vertex ofN(u)−A;
(3)Ainduces an incomplete graph, that is,Ahas a pair of nonadjacent vertices. Claim 2.8. Each vertex ofAis adjacent to every vertex ofN2(u).
Let x∈A. Let z be any arbitrary vertex of N2(u). Ifxz∈E, then we are through.
Ifxz /∈E, we establish a contradiction. Let y be a descendant ofx in N2(u). Let y=
y y1 z N2(u) x
A N(u)
Figure2.1
C1 C2
y1 y2
x1 x2 N(u)
Figure2.2
exists asN2(u)is connected. Nowu,x,y,y1is a path on 4 vertices implyingxy1∈E.
Extending the argument, we can show thatxz∈E.
Claim 2.9. LetB=N(u)−A. Then for everyx∈Aandx1∈B,xx1∈E.
This follows by considering a vertexyinN2(u) and the pathx1,u,x,y.
Claim 2.10. Ainduces an incomplete graph.
Assume the contrary. Letx∈A. By Claims2.8and2.9,xis adjacent to every vertex ofBas well asN2(u). Therefore, the degree ofx,d(x)=n−1 and hence the eccentricity
e(x)=1. This contradicts our assumption thatGis a self centered cograph of diameter two. ThusAis an incomplete graph.
(3) LetN(u)be connected andN2(u)be disconnected.
First we show that there exists a vertexx1ofN(u) adjacent to every vertex ofN2(u).
LetC1andC2be any two components ofN2(u)and let yi∈Ci,i=1, 2. Letxibe an ancestor ofyiinN(u) (seeFigure 2.2). As by the arguments inClaim 2.8,x1is adjacent
to every vertex ofC1 andx2is adjacent to every vertex ofC2. Ifx1 andx2are different,
then consider the path y1,x1,u,x2. SinceGis a cograph, this path must have a chord.
The possible chords arex1x2and y1x2. Ify1x2∈E, thenx2is adjacent to every vertex of
C1andC2. Ifx1x2∈E, then by considering the pathy1,x1,x2,y2, we can show that either
x1orx2is adjacent to every vertex ofC1andC2. In a similar fashion, we can extend this
to show thatN(u) contains a vertexx1adjacent to every vertex ofN2(u).
Nowe(x1)=2. Letx2be an eccentric vertex forx1. Sincex1is adjacent to every vertex
ofN2(u) and tou,x2∈N(u). We now show thatx2is also adjacent to every vertex of
Proof. Letu∈V(G). Ifu∈U, then byProposition 2.4,Suinduces a complete subgraph ofG.
Supposeu /∈U. Consider anSu. If possible, contrary to our assumption, letx,ybe a pair of nonadjacent vertices inSu. From the remark succeedingProposition 2.4, bothx andycannot belong toN(u) asN(u)∩Suis complete. Thus, either bothxandyare in N2(u), or one is inN(u) and the other is inN2(u). We split our discussion into four cases
and in every case, we deduce the contradiction thatu∈Su. Case 1. N(u)is disconnected andN2(u)is connected.
Then by (1) orProposition 2.7,x,ybelong toN2(u). LetC1andC2be any two
com-ponents ofN(u). Letxi∈Cifori=1, 2. From (1) ofProposition 2.7,xxiandyxi∈E fori=1, 2. Thusx,xi,yis anx−ygeodesic path fori=1, 2. Hence,xi∈Suand sub-sequentlyu∈Su (sincexi’s are nonadjacent andx1,u,x2 is a geodesic path). This is a
contradiction to the definition ofSu.
Case 2. BothN(u)andN2(u)are disconnected.
Then in a similar fashion we can show thatu∈Su. Case 3. BothN(u)andN2(u)are connected.
Suppose thatx∈N(u) andy∈N2(u). Then by (2) of Proposition 2.7,x∈B. Since
Ais incomplete,Ahas a pair of nonadjacent vertices, sayx1andx2. ByProposition 2.7,
xxi,yxi∈Efori=1, 2. Then as beforeu∈Su, a contradiction.
Similarly ifx,y∈N2(u), then alsoxi∈Sufori=1, 2 and henceu∈Su. Case 4. N(u)is connected andN2(u)is disconnected.
From (3) ofProposition 2.7,N(u) has a pairx1,x2of nonadjacent vertices adjacent to
every vertex ofN2(u). Ifx,y∈N2(u), then as beforeu∈Su, which is a contradiction. If x∈N(u) and y∈N2(u) and ifxis not adjacent tox1, then by considering the pathy,
x1,u,x, we can show thatxy∈E, which is a contradiction. Therefore, in this case,x is
adjacent to bothx1andx2. Consequently,x,xi,yfori=1, 2 are geodesics joiningxand
y. Therefore,x1,x2∈Suand henceu∈Su.
The above proposition is true even ifUis empty (i.e., whenG=G). Combining all the above propositions, we have the following theorem.
Theorem2.12. LetGbe a cograph. LetU be the set of all vertices ofG with eccentricity one. IfG=G−Uis disconnected, thenCg(G)=U, otherwiseCg(G)=U∪MorCg(G)= V(G), depending upon whether the intersectionMof all maximum cliques ofGis nonempty or not. In particular, ifGis connected, then for each vertexuofG,w(u)=ω(G−u).
Procedure GC COGP(G) begin
Find the setU LetG=G−U
IfGis disconnected, then outputUasCg(G) else begin
for each vertexx∈V(G) do w(x)=ω(G−x) end;
output the least weighted vertices; end;
Algorithm2.1
Complexity analysis. Vertices inGwith eccentricity one are precisely those vertices with degreen−1. Hence,Ucan be found inO(n+m) time. IfUis nonempty, thenGcan be constructed inO(n+m) time. To check whetherGis connected or not takesO(n+m) time. This is done by executing a depth-first search traversal. IfGis connected, then for each vertexxofG,G− {x}is again a cograph. Note that cographs form a proper subclass of permutation graphs. AnO(n+m) time algorithm to find the maximum clique size for permutation graph is given by Kamakoti and Pandu Rangan [6]. Using this ifG is connected, then we can find the weight of all the vertices inO(nm) time. Outputting the least weighted vertices takesO(n) time. Thus our algorithm takesO(nm) time to output theg-centroid for cographs.
The proof of correctness of our algorithm follows fromTheorem 2.12.
Theorem2.13. LetGbe a cograph. Then theg-centroid can be located inO(nm)time. Remark 2.14. Note that ifGis connected, thenCg(G) is the intersection of the maximum cliques ofG. Thus if all the maximum cliques of a cograph can found inO(n+m) time, as for chordal graphs, our algorithm can be slightly modified to outputCg(G) inO(n+m) time.
Acknowledgments
The author is thankful to Professor K. R. Parthasarathy, Department of Mathematics, and Professor C. Pandu Rangan, Department of Computer Science and Engineering, Indian Institute of Technology, Madras, India, for their encouragement and helpful discussions during the preparation of this paper.
References
[1] J. A. Bondy and U. S. R. Murty,Graph Theory with Applications, American Elsevier Publishing, New York, 1976.
Mathematics, Academic Press [Harcourt Brace Jovanovich Publishers], New York, 1980. [6] V. Kamakoti and C. Pandu Rangan,Efficient transitive reduction of permutation graphs and its
applications, Journal of Computer Science and Informatics23(1993), no. 3, 52–59. [7] A. N. C. Kang and D. A. Ault,Some properties of a centroid of a free tree, Information Processing
Lett.4(1975/76), no. 1, 18–20.
[8] S. L. Mitchell,Another characterization of the centroid of a tree, Discrete Math.24(1978), no. 3, 277–280.
[9] H. M. Mulder,The Interval Function of a Graph, Mathematical Centre Tracts, vol. 132, Mathe-matisch Centrum, Amsterdam, 1980.
[10] J. Nieminen,Characterizations of graphs by convex hulls, Bull. Inst. Math. Acad. Sinica 10 (1982), no. 2, 177–184.
[11] C. Pandu Rangan, K. R. Parthasarathy, and V. Prakash,On theg-centroidal problem in special classes of perfect graphs, Ars Combin.50(1998), 267–278.
[12] K. R. Parthasarathy,Basic Graph Theory, Tata McGraw-Hill, New Delhi, 1994.
[13] V. P. Soltan and V. D. Chepo˘ı,d-convex sets in triangulated graphs, Mat. Issled. (1984), no. 78, 105–124 (Russian).
[14] D. B. West,Introduction to Graph Theory, Prentice Hall, New Jersey, 1996.
V. Prakash: Department of Computer Science and Computer Engineering, La Trobe University, Bundoora, Melbourne, VIC 3086, Australia