Page 1
DISCRETE
MATHEMATICS
ELSEVIER Discrete Mathematics 183 (1998) 116
An algorithm for coloring some perfect graphs
Hac~ne Ait Haddadrne a, Sylvain Gravier b, Frederic Maffray c,*
a Dept. de Recherche Opdrationnelle, Institut de MathEmatiques, USTHB, BP 32, El Alia 16111,
Algiers, Aloeria
b Laboratoire Leibniz, IMAG, BP 53, 38041, Grenoble Cedex 9, France
c CNRS, Laboratoire Leibniz, IMAG, BP 53, 38041, Grenoble Cedex 9, France
Received 7 March 1996; received in revised form 18 March 1997; accepted 31 March 1997
Abstract
We propose a sequential method with 3chromatic interchange for coloring perfect graphs.
O. Introduction
In a graph G=(V,E)
e(u)¢e(v) for every edge uv. Each color class is a stable set, hence a kcoloring
can be seen as a partition into stable sets $1 ..... Sk. The chromatic number z(G) is
the smallest k such that G admits a kcoloring. A graph G is then called perfect [1]
if z(H)= co(H) for every induced subgraph H of G, where co(H) is the size of a
largest clique in H. Determining the value of x(G) is an NPhard problem in general.
It becomes polynomially solvable for perfect graphs, as proved by Gr6tschel et al. [4];
their algorithm however uses the ellipsoid method and is not very efficient in practice.
Tucker [10] found a combinatorial algorithm for coloring every 3colorable perfect
graph G with x(G) colors, in time O(]VI3). Note that the 3colorable perfect graphs
are exactly the K4free perfect graphs.
The following sequential method for coloring perfect graphs was proposed in [5,6].
Let v be a vertex of G. Assume that G  v has been colored with a coloring c using
co(G)/> 3 colors $1,..., S~(G). Suppose that the following property T(v, c) happens: there
exist three distinct colors i,j,k such that the subgraph induced by Si USj USk tO {v}
contains no K4. We can then apply Tucker's algorithm to this subgraph and color it
with three colors. Hence, keeping the other co(G) 3 colors, we get an co(G)coloring
of G. So it is interesting to find such vertices v that T(v,c) holds for every co(G)
coloring of G  v. We call such vertices Tucker vertices.
a kcolor&o is a mapping c:V*{1,2 ..... k} such that
* Corresponding author. Email: frederic.maffray@imag.fr.
0012365X/98/$19.00 Copyright (~) 1998 Elsevier Science B.V. All rights reserved
PH S0012365X(97)000824
Page 2
2 H. Ai't Haddaddne et al./Discrete Mathematics 183 (1998) 116
It would be interesting to characterize the class of graphs where every induced
subgraph has a Tucker vertex, but this seems to be too hard. In this paper we investigate
the following Property (P) of a vertex v: the union of any four K4's containing v
contains a Ks. Equivalently, the neighbourhood of v has the following property (P4):
the union of any four triangles contains a K4. The main result is:
Theorem 1. If the union of any four K4's containing v contains a K5 then v is a
Tucker vertex.
The proof of this theorem is based on the description of graphs with property (P4)
given in the next section.
We can define the class ~ of graphs such that every induced subgraph H has a
vertex with Property (P). Given such a graph we can order its vertices as Vl ..... v,
so that vl has Property (P) in G, v2 has Property (P) in G vl, etc. The existence
of such an ordering is a characteristic of graphs in qq; indeed, if H is an induced
subgraph of G and i is the smallest subscript such that vi E V(H) then it is clear
that vi has Property (P) in H. Finding such an ordering is algorithmically easy since
testing Property (P) is a polynomial task, as shown in the next section. Hence (~ is a
polynomially recognizable class.
Now recall Berge's Strong Perfect Graph Conjecture: a graph is perfect if and only
if it contains no odd chordless cycle (odd hole) and no complement C2k+1 of an
odd chordless cycle (odd antihole). Tucker proved that every K4free graph satisfies
Berge's conjecture, namely that every graph containing no K4, no odd hole and no C7
is perfect.
m
Corollary 1. Let G be a graph in f# and containing no odd hole and no C7. Then G
is perfect.
Proof. We prove this corollary by induction on [V[. By Theorem 1, the graph G has
a Tucker vertex v. By the induction hypothesis, G  v admits an og(G  v)coloring. If
N(v) contains an o~(G v)clique then og(G)= co(Gv)+ 1 and we assign to v a new
color. In the opposite case, we have co(Gv)= ~o(G). Then, since v is a Tucker vertex,
there exist three colors i,j,k such that the subgraph G ~ induced by Si USjUSkU {v}
is K4free. This G t contains no odd hole and no C7 and by Tucker's theorem it is
perfect, and so we can apply Tucker's algorithm to it. This yields an ~o(G)coloring
of G. []
Recall that a graph is chordal if it does not contain as an induced subgraph any hole
of length at least four. It is well known [2] that every chordal graph either is a clique
or has two nonadjacent simplicial vertices (a vertex is simplicial if its neighbourhood
is a clique). Hence computing co(G) is easy for a chordal graph (see [3]).
Clearly every 3colorable perfect graph is in f~, and every chordal graph too. Also
every linegraph of bipartite graph is in fg; this is because in a such a linegraph,
Page 3
H. A~'t HaddadOne et al./ Discrete Mathematics 183 (1998) 116 3
the neighbourhood of every vertex is one or two disjoint and nonadjacent cliques,
and so every vertex has Property (P). Every diamondfree perfect graph is also in c~
(the diamond is the graph K4 e); this is because, as shown by Tucker [9], every
diamondfree perfect has a vertex whose neighbourhood contains at most two disjoint
cliques of size at least three, and this vertex clearly has Property (P).
1. A characterization of property (P4)
Given a graph G, let T(G) be the graph whose vertices are the triangles (cliques of
size three) of G and whose edges are the pairs of triangles of G that have a common
edge. Then G is called tconnected if T(G) is connected. For a given component T/ of
T(G) we may consider the subgraph Gi of G whose edges are those edges that appear
in a triangle that is a vertex of T/. Clearly T(Gi)= ~. The subgraphs Gt ..... Gd such
that T(G1 ), T(G2) ..... T(Ga) are the connected components of T(G) will be called the
tcomponents of G. Two Gi's may have common vertices but they have no common
edge.
An edge is called flat if it does not lie in a triangle.
We consider the property (P4) of a graph: the union of any four triangles in this
graph contains a K4. Hence a graph has a vertex v with the Property (P) mentioned
in the introduction if and only if the neighbourhood of this vertex has property (P4).
We call forbidden configuration any graph that contains four triangles but does not
contain a K4. So G has property (P4) if and only if it does not contain a forbidden
configuration. In fact it is sufficient to consider the forbidden configurations that are
minimal (with respect to vertexset inclusion). Such configurations have at most twelve
vertices since in the worst case the four triangles are vertexdisjoint, and so there
is a finite number of them. This implies that the graphs with property (P4) can be
recognized in time o(IvI12). The characterization that we give below will lead to a
much faster recognition procedure.
Clearly, the fiat edges of a graph have no influence on property (P4) and on the
definition of T(G) and of the tcomponents; hence we may assume that a graph with
property (P4) has no fiat edges. Fig. 1 shows the minimal configurations containing
no fiat edges and whose tcomponents are vertexdisjoint. The minimal configurations
in which different tcomponents intersect are not drawn.
Lemma 1. Let G be a tconnected graph with property (P4) and having no flat edges.
Then G has no induced C4.
Proof. Suppose that G contains a C4 with vertices VO, Vl,/)2,v 3 and edges VOVl,Vll)2,
v2v3, V3Vo. Write C{vl, v2, v3, vo}. The subscripts on the vi's will always be under
stood modulo 4. By the hypothesis, every edge oivi+ 1 lies in a triangle. For each i,
choose a vertex ui such that ~)iOi+lUi is a triangle and such that U= {ul,u2,u3,uo} is
as small as possible (some ui's may be equal).
Page 4
H. Ai't Haddadkne et al./Discrete Mathematics 183 (1998) 116
+ F3
] FlO
o•11
Fig. 1. The minimal forbidden configurations.
Note that no vertex u can see all of vl, v2,/)3, l)0 for otherwise these five vertices
would form a forbidden configuration (a 4wheel). Hence ui ¢ ui+2 (i = 0, 1 ) and so
lull>2.
If IUI =2, then necessarily for some i we have ui = ui+l (and ui does not see vi+2)
and ui+2 =ui+3 (and ui+2 does not see vi). Here the pair uiui+ 2 may be an edge or
not, but in either case U to C is a forbidden configuration.
If IUI =4 then each ui misses /)i+2 and vi+3. If U does not induce a K4 then it
follows that U tO C does not induce a K4, and so U U C is a forbidden configuration. If
U does induce a K4 then ul, uo, Vl, v2, u2 induce a forbidden configuration (a 4wheel).
Now we may assume that I UI = 3, hence and by symmetry we may assume ul = uz
and u3 Cuo. It must be that u3 misses vl, for otherwise {Ul,U3} would contradict the
minimality of U. Likewise, Uo misses v3. Also, v2 must miss at least one of Uo, u3 or
else {uo, u3} would contradict the minimality of U. Assume that v2 misses u3. If v2 also
misses uo then U tA C cannot contain a K4, and so U tA C is a forbidden configuration.
So we assume that v2 sees uo. It follows that uo sees Ul or else CtO{uo, ul} would
induce a forbidden configuration. Note that uou3 is not an edge or else CU {uo, u3}
would be a forbidden configuration. Likewise ul u3 is not an edge. The same arguments
show that, letting U3 be the set of all vertices that see vo and v3, every vertex in U3
misses vl,v2, ul and uo. Moreover U3 is a clique or else CU {ul,u~3,u~3t } would induce
a forbidden configuration for any two nonadjacent vertices u 3~, u 3" of U3.
By the tconnectivity of G, there must exist a shortest path in T(G) from the triangles
induced by U3 tA {Vo, v3 } to the triangles induced by C tO {ul, uo}. Considering along
this path the first triangle ~ that is not included in {vo, v3} tO U3, by symmetry we find
!
two cases: either ~ = {z, u~, Vo} for some u 3 c U3 and z ~ U3; or z = {z, u~, u~ ~} for some
Page 5
H. A?t Haddadkne et al./Discrete Mathematics 183 (1998) 1 16 5
u3,u 3t tt C U3 and z ¢~ U3. Since z ff U3 we may assume that z misses v2 (necessarily in
the first case, by symmetry in the second case). Clearly z ~ C t3 U U U3. In the first
case, ifz sees both Vl,V2 then CU {u~,z} is a forbidden configuration, while ifz misses
one of Vl,V2 then CU{Ul,U~,Z} is a forbidden configuration. In the second case, if
! /!
z sees both ul,v2 then Ul,V2,V3,u3,u3,z induce a forbidden configuration; if z misses
one of Ul,V2 then Vl,V2,v3,Ul,U3,U3,Z induce a forbidden configuration. In all cases
the contradictions complete the proof. []
I I!
Lemma 2. Let G be a tconnected graph with property (P4) and having no flat edges.
Then G has no induced Ck (>~4).
Proof. Suppose that G contains a hole, and let k be the smallest integer such that G
contains a Ck, on vertices C={vo, Vl ..... V~l} and edges ViVi+ 1 (i =0 ..... k1 mod k).
By the previous lemma k >~ 5.
For each i there exists a vertex ui such that uil)ivi+ 1 is a triangle of G. It is easy to
check that every vertex of G  C can see either just one or two or three consecutive
vertices of C, for otherwise C tO {ui} would contain a shorter hole or a forbidden
configuration (a kwheel).
First suppose that, for all i, we have N(ui)NC={vi, vi+l}. Then {Uo, U~,U2,U3}
must form a K4 for otherwise Vo, Vl,V2,v3,va, uo, ul,u2,u 3 would induce a forbidden
configuration; but then Vo, Vl, v2, v3, uo, ul, u2 induce a forbidden configuration.
Now we may assume that uo sees vo, v~ and v2. If u3 sees v2 then Vo, vl,v2,v3,v4,uo, u 3
would induce a forbidden configuration (even when uo sees u3, and even when k = 5).
Hence u3 misses v2. Likewise u2 misses V4 (or else we could take u2 = u3). If u2
misses Vl then Vo, Vl, v2, v3, v4, uo, u2, u3 form a forbidden configuration (regardless of
the adjacency between uo, u2,u3). So u2 must see vj. Then u2 must see uo or else
vo, vl,v2,v3,uo, u2 induce a forbidden configuration. Now u4 must miss v3 or else
vl, v2, v3, v4, vs, u2, u4 induce a forbidden configuration (even when k = 5). Likewise u3
misses vs. But now vl, v2, v3, v4, vs, u2, u3, u4 induce a forbidden configuration (regardless
of the adjacency between u2, u3, u4). These contradictions complete the proof. []
Under the same hypothesis it is possible to show the stronger fact that G cannot
contain a chordless path on six vertices, but we will not use this.
Lemma 3. Let G=(V,E) be a tconnected graph with property (P4) and having
no fiat edges. Then we can partition V into cliques Q, $1 ..... Sk with the following
properties, where Bi = N ( Si ) N Q:
(sl) There are no edges between two Sf s;
(s2) For all i=1 .... ,k, [Bil>~2 and QBier;
(s3) For each i= 1 ..... k, there exists bi EBi such that SitO{bi} is a clique.
Any such partition will be called an acceptable partition. Note that Q is a maximal
clique of G by (s2). A graph may have several acceptable partitions. If SiUBi is a
Page 6
H. APt Haddad~ne et al./Discrete Mathematics 183 (1998) 116
B1
SI
~~o s2
Fig. 2. An irregular graph.
clique for each i = 1 ..... k the partition is called regular, and G is also called regular.
When G admits an acceptable partition but no such partition is regular we call G
irregular. See Fig. 2 for an irregular graph.
Before proving Lemma 3 it will be convenient to establish some further properties
of irregular partitions in irregular graphs.
Lemma 4. Suppose G is irregular and consider any irregular partition. Then we may
assume that Si U Bi is a clique for each i= 2 ..... k. Moreover we can partition B1
into B + and B( and there exists a vertex f E $1 with the following properties:
(il) S1 f¢0, B+¢0, B~ ¢0;
(i2) S1UB + and {f} UB1 are cliques;
(i3) There are no edges between Sa  f and B~ ;
(i4) For i=2 ..... k, ISil= 1;
(i5) For i=2 ..... k, either Bi C_B + or Bi C B{ or Bi C_ Q B1;
(i6) k~>2 and Bj C_ Q  B1 for at least one j E {2 ..... k}.
Proof. First observe that:
for any two vertices u, vESi the sets N(u)fqQ and N(v)nQ are
comparable by inclusion.
(1)
Indeed, in the opposite case there would exist x E N(u)M Q N(v) and y E N(v)N
Q N(u). But then bi, u,v,x , y would induce a forbidden configuration (a 4wheel).
Fact (1) means that we can order totally the vertices of Si according to their neigh
bourhood in Q (i.e., their neighbourhood in Bi). Let J] be a vertex in Si with the
largest neighbourhood in Bi. By the definition of B i and by the order y] sees all of Bi.
Suppose that there exist at least two indices i,j<<.k such that Si UBi and Sj UBj are
not cliques. So there exists a pair of nonadjacent vertices vi,xi in SiUBi, say with
vi E Si and xi E Bi. Likewise there exists a pair of nonadjacent vertices vj,xj with vj E Sj
and xj E Bj. Note that f~, v~, b~,x~ induce a K4  e, and the same holds with subscript j.
Write W = {fi, vi, bi, Xi, fj, l)j, bj, x j}. The sets {bi, xi} and {bj,xj} may intersect. If they
are equal then W induces a forbidden configuration.
Page 7
H. A ~'t HaddadOne et al. / Discrete Mathematics 183 (1998) 116 7
Suppose b i =xj (and bj # xi). Then W will induce a forbidden configuration unless
fibj E E or fjxi E E. If fibj E E then vibj E E or else W xi
subgraph. Then fjxi E E or else W  fi is forbidden. Hence xi E Bj. Consider a vertex
aEQ Bj, which exists by (s2). So a sees bi,xi, bj and misses fj, vj. Then aft EE
or else W + a  xi  ui would be forbidden. Then avi E E or else W + a  xi  f i is
forbidden. There exists a vertex u E Q Bi by (s2); so u sees a, bi,xi, bj and misses
fi, vi. Then uj~ E E or else W + u  a  fi  xi is forbidden. But now vi, fi, xi, a, u, f~
form a forbidden subgraph.
If f~bj f[E then fjxi EE, and vibj f[E or else W xi is forbidden. Consider a vertex
a E Q  B j; so a sees bi, bj,xi and misses fj, vj. But now, if avi ~ E then W + a  xi
is forbidden, while if avi E E then W + a xi  fi is forbidden.
Hence we may conclude that bi # xj and by symmetry bj #xi.
Suppose bi = bj. Then one of fixj or fjxi is an edge or else W is a forbidden
subgraph. By symmetry let us assume fixj E E; then vixj E E or else Wxi is forbidden.
Then fjxi E E or else W  fi is forbidden; also vjxi E E or else W  xj is forbidden.
But now W b is a forbidden configuration. Hence bi ~ bj.
Suppose xi =xj. Then one of fibj or fjbi is an edge or else W is forbidden. By
symmetry assume fibjEE.
So bjEB i. There exists a vertex uEQ
Xi, bi, bj and misses fi, vi. Then ufj E E or else W + u  vi  bi is forbidden. Then
f jbi E E or else W + u  bj  vj is forbidden. One of bjvi or biv j is an edge or else
W  xi is forbidden; but then one of W  bi or W  bj is forbidden.
Hence xi:/:xj, and we have {bi,xi}O{bj,xj}=O.
conclude as in the case bi=xj (if bivj ~E) or as in the case bi =bj (if bivj EE). So
we may assume bifjq~E; hence bivjf~E by (1). Likewise bj misses f. and vi. By
a similar argument we may assume that xj misses fi and vi. But now W xi is a
forbidden configuration.
In conclusion, at most one of the Si U Bi's is not a clique. This proves the first
assertion of the lemma. Since the graph is irregular, we may assume that $1 U BI is
not a clique.
Let F be the subset of those vertices of Sl with the largest neighbourhood in this
order. The definition of Bl implies that every vertex of F see all of B1. Pick any
f E F. We claim that:
induces a forbidden
Bi; so u sees
If bi~ is an edge then we can
All vertices of $1 F have the same neighbourhood in B1.
(2)
Suppose on the contrary that for u, v E S1 F there exists a vertex b E B1 that is adjacent
to u and not to v. By the definition of F, there exists b ~ E B1 that is adjacent to f
and not to SI F. By (s2) there exists x E Q B1. But now x,b, b~,f,u, v induce a
forbidden configuration. Hence (2) holds.
Now we define B + = N(S1  F) fq Q = N(S1  F) M B1 and B~ = B1  B~. We have
bl CB +, so B~#0. Fact (2) and the fact that $1UBI is not a clique imply that B~ is
not empty and that there are no edges between Sl F and B~. This implies that (il),
(i2), (i3) will be true as soon as we can establish IF] = 1 (with F = {f}).
Page 8
8 H. A~t HaddadOne et al./Discrete Mathematics 183 (1998) 116
Pick any w E S1  F.
For now let s be any vertex in $2 U .. • U Sk. We claim that:
Either N(s)MB +=0
or N(s)nB 7=0.
(3)
Suppose on the contrary that there exist b + E N(s)fOB + and b~ E N(s)fOb 1. Then s
sees every vertex x E QB1, for otherwise x,s, b +, b~, f, w induce a forbidden configu
ration. By (s2) s has a nonneighbour v in Q, hence v E B1. If v E B1 + then s,x, v, b 1, f, u
induce a forbidden configuration; if v E B 1 then s,x, v, b{, f, w induce a forbidden con
figuration. So (3) holds. Next,
Either N(s)fOBI =0 or N(s)N(QB1)=O.
(4)
Suppose on the contrary that s has a neighbour b E B1 and a neighbour x E Q  B1. If
b E B + (resp. b E B~) then by (3) vertex s has a nonneighbour b'E B~ (resp. b ~ E B+).
In either case, s,x,b,b~,f,w induce a forbidden configuration. So (4) holds.
Facts (3) and (4) applied to every s ESi (i>~2) imply (i5).
Now suppose that there is no jE {2 ..... k} with BjC_Q B1. In this case write
Q'=B1UF, S~ =$1 F, and S~=Sj for j=2 ..... k, and S~+ 1 =aBl.
check that Q',S~ .... ,S~,S~+ 1 is a regular partition of G, a contradiction. Hence (i6) is
established.
Now it follows that IFI  1, for if there were two vertices f, f~ E F then w, f, f~,
b~,x, y, s2 would induce a forbidden configuration for any x, y E B2, s2 E B2, b 1 E B 1.
Finally let us prove (i4). Suppose ISil ~>2 for some i=2 ..... k, with s,s' ESi, s¢s'.
If B i C_ Q  B1, then s, s ~, y, b +, b 1, f, w induce a forbidden configuration for any y E Bi,
b + EB +, b~ EBb. IfBi C_B1 + (resp. Bi C_ B~), then s,s',b,b',f,w,x induce a forbidden
configuration for any x E Q  B1, b E Bi, and b ~ E B 1 (resp. b' E B{). Now the lemma
is proved. []
It is easy to
From this lemma it is possible to derive that if G is irregular then it admits exactly
one acceptable partition, but we will not use this fact.
Proof of Lemma 3. We prove the lemma by induction on the number of vertices
of G. When G =K3 the lemma holds trivially (with Q = V). Now assume that G has
at least four vertices. Hence G has at least two triangles. By Lemma 2 G is a chordal
graph, and G admits a vertex z whose neighbourhood N(z) is a clique. We claim that:
G z is tconnected and has no fiat edge. (5)
To prove this, first suppose that Gz has a fiat edge xy. This implies that N(z) = (x, y}
and that x, y have no other common neighbour in G. But then the vertex representing
the triangle xyz in T(G) is not adjacent to any other triangle, contradicting that T(G)
is connected.
Now let us show that G  z is tconnected. Let Tz be the set of triangles of G that
contain z; note that T(Gz) = T(G) Tz. If N(z)= {x, y} then by the preceding point
Page 9
H. Ai't Haddadkne et al. / Discrete Mathematics 183 (1998) 116 9
there exists at least one triangle containing x, y in Gz; moreover, all such triangles are
pairwise adjacent in T(G); hence T(G) Tz = T(G) {xyz} is connected. If ]N(z)l ~> 3,
since N(z) is a clique T(N(z)) is connected. Every triangle adjacent to a triangle of T~
is either in N(z) or adjacent to a triangle in N(z); hence the neighbourhood in T(G)
of (T~) is connected, and so T(G)  Tz is connected. So (5) is proved.
Fact (5) implies that we can apply the induction hypothesis to G z. So G z has
an acceptable partition Q, $1 ..... S~ with the notation of the lemma. This partition may
be regular or irregular, but in either case we may assume that Si U Bi is a clique for
each i = 2 .... , k. In case it is irregular we also assume the notation and properties of
Lemma 4. We are going to derive from this an acceptable partition for G.
Since N(z) is a clique we have N(z)C_ Si UBi for some i E {1,2 ..... k}.
If N(z) = Q then Q u {z}, Sl .....
S k is an acceptable partition for G. If N(z) C Q with
strict inclusion then Q, S1 ..... Sk, {z} is an acceptable partition. Now we may assume
that N(z) N Si¢ 13.
Case 1: N(z)nBi¢13.
Pick any b EN(z) nBi.
If Si C N(z), then since N(z) is a clique b must see all of Si. It follows that
Q, S1 ..... Si U {z} ..... Sk is an acceptable partition (where b plays the role of bi). Now
we suppose that Si q~ N(z). Pick vertices s E N(z) n Si and s' E Si  N(z). Note that
bs E E since N(z) is a clique. We claim also that bs I E E. Indeed, if this is not the
case then Si U Bi is not a clique, so the partition of G z is irregular and we may
assume i= 1, bEB~, s' ES  {f}, and s=f
N(s ~) n Q. Consider any u E Q B1. If z misses bl then z,s,s ~, b, bl, u is a forbidden
configuration. If z sees bl we can take bl instead of b as bl sees z and s'.
We claim that Si U Bi is a clique. Indeed if it was not we would be in the irregular
case, with i = 1. By (i6) there would exist j ~> 2 with Bj C_ QB1. Picking any x, y E Bj,
t E Sj, the vertices x,y,t,b,s, st,z would induce a forbidden configuration. In fact we
claim that the partition is regular. For if it was not then we could assume that SI U B1
is not a clique and that i~>2, but then (i4) would be contradicted as s,s ~ E Si. Now
we assume i = 1.
Let w be any vertex not in B1 U {z}. We claim that:
because N(s)NQ is strictly larger than
If w sees two vertices of Q Ba then w E Q B1. (6)
Suppose x, yEN(w)n(QB1).
otherwise w,x, y,b,s,s~,z is a forbidden subgraph. Then wu E E for every u E Q B1,
for otherwise w,b,x,u,s,s~,z is forbidden. Then wb ~ EE for every b ~ EB1  N(z), for
otherwise w,x,b, bt, s,z is forbidden. Hence w sees all of Q, and so wEQB1
is a maximal clique. So (6) is proved. Next,
So wf[Sl. Then wbEE for every bEN(z)NBI,
for
as Q
A vertex w of $2 U ... U Sk cannot have a neighbour in B1 and a
neighbour in Q Bi. (7)
To prove this for w E Sj (j >~ 2), consider any x E N(w) n (QB1). There exists a vertex
y E Q Bj. If w has a neighbour c EB1 AN(z) and a nonneighbour c ~ EB1 N(z),
Page 10
10
H. A~'t Haddadbne et al./ Discrete Mathematics 183 (1998) 116
or viceversa, then w, c, c ~, s,z,x form a forbidden subgraph. This implies that if both
B1 fiN(z) and BI  N(z) are nonempty then w sees all of B1. In this case however
y E Q B1, and so w,x, y, b,s~,s,z is a forbidden. Hence B1 N(z)=
for otherwise w,x,y,b,s~,s,z is forbidden. But then w,x,y,b,s~,z is forbidden.
Facts (6) and (7) imply Bj C_B1 for each j=2 ..... k.
We define Or=St UB1, Sfi=S j for j=2 ..... k, S~=Q
clear that Q~,S~ ..... S~+ 1 is an acceptable (and regular) partition for G.
Case 2: N(z) fi Q = O.
Hence N(z)C_Si, and IN(z)[ _>2. Pick two vertices s,s' E N(z). We claim that the
partition of G z is regular. Indeed, if it was not then by (i4) and ISil ~>2, we would
have i= 1 where $1UB1 is not a clique. Pick b + EB +. Consider j as given by (i6),
and pick sj E Sj, x, y E Bj; then z, s, s ~, b +, x, y, sj would be a forbidden configuration.
So the partition is regular, and we write i = 1 for simplicity. Pick any b E B1. Con
sider any vertex w in S2U ... USk, say wESj (j~>2). We claim that:
0. Hence y E B1
B1, and S~+ 1 ={z}. It is
w sees at most one vertex in Q B1.
(8)
Suppose that w sees two vertices u, v E QB1. Then w sees every b E B1, for otherwise
z, s, s ~, b, u, v, w would be a forbidden subgraph. Then w sees every vertex y E Q  BI,
for otherwise z,s,s ~, b, v, y, w would be a forbidden subgraph. But now w sees all of
Q, which contradicts Q  Bj ¢ O.
Next,
If w has a neighbour in B1 and a neighbour in Q Bi then w sees all
of Q  B1.
(9)
Suppose that w has a neighbour u E Q  B1 and a neighbour b E B1. Then w does not
have a nonneighbour y in Q B1, for otherwise w,u,y,b,s,s~,z would be forbidden.
Hence w sees all of Q B1. Next,
There is at most one j E {2 ..... k} such that some w ESj has a
neighbour in B1 and a neighbour in Q B1.
(10)
Suppose that w E Sj has a neighbour u E Q B1 and a neighbour b E B1. Facts (9) and
(8) imply [Q  BI[ = 1, so Q  B1 = {u}. Suppose moreover that some w' E Sh has a
neighbour b ~ E BI and a neighbour in QB1 (necessarily this is u), with 2 ~<h ~<k, h #j.
If we can choose b = b ~ then w, w t, u, b, s,s~,z induce a forbidden configuration. Else, b
misses w t and b t misses w, and then w, w ~, u, b, bt, s induce a forbidden configuration.
Fact (10) means that Bj C_B1 for all j except perhaps for one j. For this j, if it
exists, Fact (9) implies that Sj U Q B1 is a clique.
We define Q' = S 1 U B1, S[ = {z}, and S~ = Sj if Bj C_ BI for j ~> 2. If there exists
one j with Bj~ZB, then Sj=SjuQ B1. By (10) this j is unique and Sj is a clique.
By (8) there is a vertex in BjfiB1; this vertex sees all of Sj. Now it is clear that
Page 11
H. A?t Haddad~ne et al. / Discrete Mathematics 183 (1998) 116
11
Q', s~, s~ ..... S t is an acceptable partition for G. (It is irregular if there exists a j such
that By ~ B1). Now the proof is complete. []
The proof of this lemma contains implicitly a polynomialtime algorithm which,
given a tconnected graph with property (P4) and with no fiat edges, builds an accept
able partition.
Now it is convenient to know what happens when G has the stronger property (P3):
the union of any three triangles contains an induced K4. Clearly (P3)=~ (P4). It is easy
to see that a graph with property (P3) that is not tconnected consists in two disjoint
cliques of size at least three plus possibly some fiat edges.
Lemma 5. Let G=(V,E) be a #raph havin 9 no flat edyes. Then the follow& 9 two
assertions are equivalent:
(p3.1) G is tconnected and satisfies Property (P3);
(p3.2) G admits a regular partition (with the usual notation) and if k >~2 then
BiMBj =O for all i¢j and ISil 1 for all i= 1 ..... k.
Proof. First assume that (p3.2) holds. Then it is a routine matter to check that G is
tconnected and that the union of any three triangles in G contains an induced K4.
Conversely, assume that (p3.1) holds. By Lemma 3 the graph G has an acceptable
partition with the usual notation. If G is not regular then, with the notation of Lemma 4,
we can pick s E S1  {f}, b~ E B 1, u E Q  B1; but then {s, f, bl, b], u} induce three
triangles and no K4, contradicting (P3). Hence G is regular.
Suppose B1 f) B2 ~ ~ with b E B1 N B2. Pick Sl E $1 and s2 E $2. If B1 _C B2 then pick
b' E B1  {b} and y E Q B2; but then {b, b', y, s l,s2} contains three triangles but no
K4. If B1 ~B2 and B2~B1 then we can pick xEBI  B2 and y E B2  B1, but then
{x, y, b, sl, s2} contains three triangles and no K4.
Suppose k 1> 2 and IS1 ] >/2. There exist s, s t E Sl, b E B1, s2 E $2, u, v E B2. By the
preceding point b ~B2 and u, v ~B1. But then {s,s ~, b, s2, u, v} contains three triangles
and no K4. Now (p3.1)~(p3.2) and the whole lemma is proved. []
If G satisfies property (p3.2) with k = 1 then the vertices of B1 are universal and
G B1 consists in two vertexdisjoint cliques. The converse is also true: if U is the
set of universal vertices of G with IUI >/2, and G U consists in two vertexdisjoint
cliques then G satisfies property (p3.2) with k = 1.
A graph that satisfies (p3.2) with k~>2 will be called a mine. In this case we write
Si = {si}. See Fig. 3. Recall that a graph is called split if its vertexset can be partitioned
into a clique Q and a stable set S (and this is called a split partition). Split graphs can
be recognized in linear time [7]. Clearly every mine is a split graph. Conversely, it is
easy to see that a split graph is a mine if and only if every vertex of S has at least
two neighbours, and every vertex of Q has at most one neighbour in S. Hence mines
can be recognized in linear time.
Page 12
12
H. AEt HaddadOne et al./Discrete Mathematics 183 (1998) 1 16
Fig. 3. A mine.
Fig. 4. A special graph.
Let us call special a graph obtained from a mine by adding edges so that {S1 ..... Sh)
becomes a clique for some h with 2 ~< h ~< k and possibly adding a set R of new pairwise
adjacent vertices with edges from all of them to all of Sl ..... Sh. See Fig. 4. It is
possible to test in O(IVIIEI) if a graph G(V,E) is special, as follows. First, find
all the simplicial vertices of G; they form disjoint cliques R1 ..... Rr. Then check that
G  (R1 U ... tARr) is the complement of a bipartite graph, hence is partitioned into
two cliques Q,S. Then check that among the Ri's at most one is adjacent to S (and
sees all of S and none of Q); this set, if any, will be the set R as in the definition
of special graphs. Check that at most one of the Ri's is adjacent to all of Q (and to
none of S). Then check that each of the remaining Ri's has size 1 and sees at least
two vertices of Q, and add these remaining Ri's in S. Finally check that every vertex
of this S has at least two neighbours in Q and that every vertex of Q has at most one
neighbour in S.
Lemma 6. Let G be a graph with property (P4) and having no flat edges. Then either
G is chordal or G is special.
Page 13
H. A't't HaddadOne et aL /Discrete Mathematics 183 (1998) 116
13
Proof. If G is tconnected then it is chordal as a consequence of Lemma 2. Now as
sume that G is not tconnected. Let G1,..., Ga be the tcomponents of G. By Lemma 2
each Gi is chordal. It is easy to see that each Gi either is a clique or contains a dia
mond. If two of them contain a diamond then G violates property (P4). So we may
assume that G2 ..... Gd are cliques. If d >~ 3 then G1 too is a clique, or else G contains
a forbidden configuration formed by a diamond from G1 plus a triangle from each of
G2, G3; here G is chordal. Likewise, if d=2 then G1 must satisfy property (P3) and
hence it satisfies (p3.2), with the usual notation. By the definition of the tcomponents,
G1 N G2 induces an edgeless subgraph of Gl. If G1 n G2 contains an si then it cannot
contain any vertex q from Q, or else siq would be an edge induced by G1 n G2. If
G1 N G2 contains at least two s,s' of sl ..... sk then G is special. In the other case
I G1 fq G21~ < 1 and so G is chordal. []
Recall that it is possible to test in linear time if a given graph is chordal and, if it
is, to give a simplicial elimination ordering vl ..... v, of the vertices (vl is simplicial
in G, v2 is simplicial in G vl, etc.) See [8].
Now Lemmas 3 and 5 will help us create a fast algorithm for recognizing graphs with
property (P4). Note however that Lemma 5 gives a necessary and sufficient condition
while Lemma 3 does not. For example the graph F9 on Fig. 1 has an acceptable
partition but violates property (P4). This difficulty can be overcome as follows. Let G
be a tconnected chordal graph and z be a simplicial vertex of G. Since N(z) is a clique
any forbidden configuration F of G either does not contain z or contains exactly one
triangle zuv ofz. The latter case is equivalent to saying that G (N(z)t3 {z} {u,v})
contains a subgraph with three triangles and no K4, i.e., that it violates (P3). This
justifies the following procedures.
• PROCEDURE P3(G). Input: a graph G; Output: the answer "true" if G satisfies property (P3)
and "false" otherwise.
1. Remove all flat edges from G;
2. If G is a mine then return the answer "true";
3. Remove all universal vertices from G;
4. If G = 0 or G is the union of two cliques then return the answer "true";
5. Return the answer "false".
• PROCEDURE P4(G). Input: a graph G; Output: the answer "true" if G satisfies property (P4)
and "false" otherwise.
1. Remove all flat edges from G;
2. Test if G is chordal or special. If G is neither then answer "false";
3. If G is special then return the answer "true";
4. If G is chordal then do the following PROCEDURE U(G):
If G is empty return the answer "true". Else find a simplicial vertex z;
IfU(G  z) is false then return the answer "false";
For each triangle zuv if P3(G  (N(z) tJ {z}  {u, v})) is false then return the answer "false";
Return the answer "true".




Complexity analysis. For Procedure P3(G), Step 1 takes O([VllE[). Step 2
takes O(IEI). Step 3 takes O([VI). Step 4 takes O(]EI). Hence Procedure P3(G)
takes O(]V[IE[). For Procedure P4(G), Step 1 takes O(IVllEI). Step 2 takes
Page 14
14
H. A't't HaddadOne et al./Discrete Mathematics 183 (1998) 116
O(IEI) + O(IVIIEI). Procedure P~ takes IvI 3 times the complexity of P3. Hence the
overall complexity of P4 is O(IVI4IEt).
2. Proof of the main theorem
Lemma 7. Let H = (V,E) be a graph with property (P4). In every qcoloring of V
with q>og(H), there exist three distinct colors whose union induces a trianglefree
graph.
Proof. Consider a qcoloring c of V. For any X _C/1, let c(X) denote the set of colors
used by c on X. Write c(V){1,2 ..... q}. For h,i, jE{1,2 .... ,q} we call {h,i,j}
triangle any three pairwise adjacent vertices colored h, i,j. So our aim is to show that
no {h, i,j}triangle exists for at least one triple of different colors h, i,j, i.e., that H
does not have all possible colored triangles.
We may assume that H has no fiat edges, or else we remove them (this does not
affect the hypothesis or the desired conclusion of the lemma).
For now we assume that H is tconnected, and so we can use Lemma 3, with
the same notation. We distinguish between two cases: the partition is regular, or it is
irregular. Since IQI ~<co(H), we may assume that q f[c(Q).
Case 1: The partition of H is regular.
First assume that for each i1 .... ,k we have c(Si)nc(Q)= ~). We claim that:
There exists u, v E Q such that none of B I ..... Bk contains both u and v. (11)
Suppose on the contrary that every edge in Q is contained in some Bi, and remove the
Bi's one by one as long as this property still holds. Now remove one more, say Bi0:
there exists u, v E Q such that u, v E Bio but u, v are not both in any of the remaining B i's.
By (s2) there exists w E Q  Bio. There exists one of the remaining Bi's, say Bil, such
that u,w E Bil , and v ([Bil. Hence there exists another of the remaining Bi's, say Bi2,
with v, w E Bi2, and u ~Bi2. But now Sio,sil ,si2 , u, !.), w induce a forbidden configuration,
for s/, ES/; (j=0, 1,2). So (11) is proved. Now we claim that:
There is no {c(u), c(v), q}triangle. (12)
Indeed, since c(Si)Nc(Q)=O for all i= 1,2 .... ,k, the {c(u),c(v),p}triangles for any
p can appear only in Q. But for p =q there is no such triangle since q ([ c(Q).
Now assume without loss of generality that c( S1 ) n c( Q ) ~ O. Pick i E c( S1 ) fq c( Q ).
Let x E $1, resp. y E Q, be such that c(x)= c(y)= i. Build a new graph H I by re
moving x and adding all edges from y to S1  {x}. The graph H / has property (P4),
for otherwise if F is a forbidden configuration in H t then necessarily y E F and it is
not hard to check that F  y + x would be a forbidden configuration in H. More
over, it is easy to check that H' is tconnected, and that Q, $1  {x}, $2 ..... Sk (omit
ting Sl  {x} if it is empty) is an acceptable and regular partition for H' (except
Page 15
H. Art Haddadkne et al./Discrete Mathematics 183 (1998) 116
15
if Q B1 ={y}, in which case QuS1,S2 ..... Sk is acceptable and regular for H').
Moreover, for all triples h, i,j, if there is an {h, i,j}triangle in H there is still one
in H'. Repeating this operation as long as necessary, we obtain a graph H* which
satisfies the assumption at the beginning of this case and has all the colored trian
gles of H (plus maybe some more). Hence H does not have all possible colored
triangles.
Case 2: The partition is irregular.
We can assume that:
For each uEQB1, c(u)Ec(Sl).
(13)
Pick i E c(B~ ). Then, by the properties (i2)(i5), an {i, c(u), q}triangle can exist only
if there is a vertex colored c(u) in $1.
Since $1 UB + is a clique there exists a color p in {1,2 ..... q}c(S1 UB+). We claim
that:
For each j E c(Q  B1), there is no { p, q, j }triangle.
(14)
By (13), p ([c(QB1). The properties (i2)(i5) preclude the existence of a {p,q,j}
triangle anywhere in H. This completes the proof for this case.
Now we assume that H is not tconnected. Let H1,112 ..... Hd be the tcomponents
of H. We have d ~<3, for otherwise taking one triangle in each Hi would yield a
forbidden configuration in H.
If d = 3 then each Hi must be diamondfree, or else taking one diamond and one
triangle in the other two Hi's would yield a forbidden subgraph. Hence each Hi is a
clique, and there exists a color Pi E {1,2,...,q} c(//i) (i= 1,2,3). If Pl,P2, P3 are
different then there is obviously no {pl,P2, P3}triangle in H. If PlP2 ~ P3 then
there is no {Pl, p3,j}triangle for any j ~ Pl, P3. If Pl = P2 = P3 then there is no
{pl,h,j}triangle for any h,j ¢ Pl, h Cj.
Finally assume d = 2. Again one of//1,H2 is diamondfree, or else taking two such
diamonds yields a fobidden configuration. Assume that//2 is diamondfree, i.e., is a
clique. Here//1 satisfies Lemma 5.
We may assume that qf[c(H2). If q¢c(Q) then pick uEB i and vEQB
fact that the Bi's are disjoint implies that there is no {q, c(u), c(v)}triangle in H. Now
assume q E c(Q); let x E Q with c(x)= q. Let p be a color such that p ([ c(Q). Suppose
k ~>2. If x E B1 pick v E Q B1; then the properties of H1 given in Lemma 5 imply
that there is no { q, p, c( v ) }triangle. If x ~B1 U.. UBk pick any v E Q {x}; then
there is no {q, p, c( v ) }triangle in H. Finally suppose k1, let r be a color not in
c(S1 UB1). Then there is no { p, q, r }triangle in H. This completes the proof. []
i. The
Proof of the main theorem. Let G be a graph in f~ and c an m(G)coloring of G  v.
Let v be a vertex with property (P), i.e., N(v) has property (P4). Apply the preceding
lemma with H =N(v) and q = ~o(G). Then there exist three distinct colors h,i,j such