B R ICS R S -02-45 J . M. B ysk o v : C h romatic Nu mb er in T ime O (2 . 4023 n )
BRICS
Basic Research in Computer Science
Chromatic Number in Time O(2.4023 n ) Using Maximal Independent Sets
Jesper Makholm Byskov
BRICS Report Series RS-02-45
ISSN 0909-0878 December 2002
Copyright c 2002, Jesper Makholm Byskov.
BRICS, Department of Computer Science University of Aarhus. All rights reserved.
Reproduction of all or part of this work is permitted for educational or research use on condition that this copyright notice is included in any copy.
See back inner page for a list of recent BRICS Report Series publications.
Copies may be obtained by contacting:
BRICS
Department of Computer Science University of Aarhus
Ny Munkegade, building 540 DK–8000 Aarhus C
Denmark
Telephone: +45 8942 3360 Telefax: +45 8942 3255 Internet: BRICS@brics.dk
BRICS publications are in general accessible through the World Wide Web and anonymous FTP through these URLs:
http://www.brics.dk ftp://ftp.brics.dk
This document in subdirectory RS/02/45/
Chromatic Number in Time
O(2.4023 n )
Using Maximal Independent Sets
Jesper Makholm Byskov
BRICS
∗
Department ofComputer Science
UniversityofAarhus, Denmark
jespermn@brics.dk
December, 2002
Abstract
Inthis paperweimprove an algorithm byEppstein (2001) for
nding the chromatic number of a graph. We modify the algo-
rithmslightly, and by using a bound on the number of maximal
independentsets of size
k
fromourrecent paper(2003), we provethattherunningtimeis
O(2.4023 n )
. Eppstein'salgorithmrunsintime
O(2.4150 n )
. Thespace usagefor bothalgorithms isO(2 n )
.1 Introduction
1.1 Lawler's algorithm
Lawler [Law76] was the rst to give a non-trivial algorithm for nding
thechromaticnumberofagraph. Henotesthatinacolouringofagraph
one of the colour classes can be assumed to be a maximal independent
set (aMIS).Sowecan nd the chromaticnumber
χ(G)
of agraphG
bythe following recursion:
χ(G[S]) =
( 1 + min{χ(G[S \ I ]) | I ∈ I (G[S])}
ifS 6= ∅
,0
ifS = ∅
,∗
BasicResearchin ComputerScience(www.brics.dk),
funded bytheDanishNationalResearchFoundation.
let
X
be an array indexed from 0to2 n − 1
for
S = 0
to2 n − 1
dofor all MISs
I
ofG[S]
doX[S] = min(X [S], X[S \ I] + 1)
return X[V]
where
G[S]
denotes the vertex-induced subgraph ofS ⊆ V
andI(G)
denotes the set of all maximal independent sets of
G
. Lawler does notexplicitly give an algorithm. He merely notes that one has to process
all subsets of
S
beforeS
is processed. If we index all subsets from 0to
2 n − 1
such that the bit-representation of each index is a bit vector denotingfor eachvertex whether it isinthe set or not, Algorithm1willndthe chromaticnumberof
G
. Usingthebound3 n/3
onthe numberofmaximalindependentsetsofagraph([MM65 ])andthefactthattheycan
be found within a polynomial factor of this bound (see e.g. [TIAS77]),
this has runningtime
O X
S⊆V
|I (G[S])|
!
= O X n
i=0
n i
3 i/3
!
= O (1 + 3 1/3 ) n ,
which is
O(2.4423 n )
. The algorithmuses spaceO(2 n )
tostoreX
.1.2 Eppstein's algorithm
Eppstein[Epp01b ]improvesLawler'salgorithm. Lawler'salgorithmcom-
putes
χ(G[S])
by looking at the values for subsets ofS
. Eppstein's al-gorithm also computes a table
X[S]
for allS ⊆ V
(indexed as above),but every time it reaches a set
S
, it updatesX
for all supersets ofS
forwhichthe value
X[S]
could potentiallygive better values. More pre- cisely,ifG[S]
isamaximalk
-colourablesubgraph ofG
,ithasamaximal(k − 1)
-colourable subgraphG[S 0 ]
of size at least|S 0 | ≥ (k − 1)/k · |S|
,and
S \ S 0
is a maximal independent set ofG[V \ S 0 ]
. Thus, when thechromaticnumber of
G[S 0 ]
is computed, onlythe values ofG[S 0 ∪ I]
forallmaximalindependent sets
I
of size atmost|S 0 |/χ(G[S 0 ])
inG[V \ S 0 ]
are updated. The algorithmis shown as Algorithm2.
Therstpartofthealgorithmchecks1-and2-colourabilityinpolyno-
mialtimeand3-colourabilityusingthe3-colouringalgorithmof[Epp01a],
with running time
O(1.3289 n )
, of all subgraphs ofG
. The second partlet
X
be an array indexed from 0to2 n − 1
for
S = 0
to2 n − 1
doif
χ(S) ≤ 3
thenX[S] = χ(S)
else
X[S] = ∞
for
S = 0
to2 n − 1
doif
3 ≤ X[S] < ∞
thenfor all MISs
I
ofG[V \ S]
of size atmost|S|/X [S]
doX[S ∪ I ] = min(X[S ∪ I], X[S] + 1)
return X[V]
runs through
X
and for each subgraphG[S]
it nds all maximal inde-pendentsets
I
ofG[V \ S]
ofsizeatmost|S|/X[S]
andupdatesthevalueof
X[S ∪ I]
.It is clear that for any set
S ⊆ V
,χ(G[S]) ≤ X[S]
during the exe-cutionof the algorithm,since
X[S]
is only updated when the algorithmactually nds a colouring with
X[S]
colours. For everyk
, all maximalk
-colourable subgraphsG[M ]
haveX[M ] = k
, since they have so fork ≤ 3
after the rst half of the algorithm has run, and thus by induc-tion also for larger
k
, by the argument above. SinceG
is a maximalχ(G)
-colourablesubgraph ofitself,the algorithmcorrectlycomputes the chromaticnumber ofG
.The runningtime of the the rst part of the algorithmis:
X
S⊆V
O(1.3289 |S| ) = O X n
i=0
n i
1.3289 i
! ,
whichis
O(2.3289 n )
. Thesecondpartmightbeexecuted foralmostallS
,butsince
X[S] ≥ 3
, onlymaximalindependentsets ofsize atmost|S|/3
in
G[V \ S]
are considered. Using a lemma, that states that a graph canhave atmost3 4k−n 4 n−3k
maximalindependentsets of size atmostk
and that they can be found within a polynomial factor of this bound,
Eppsteingets that the running time of the second part isat most
X
S⊆V
O(3 4(|S|/3)−(n−|S|) 4 (n−|S|)−3(|S|/3) ) = O 4 3
n n X
i=0
n i
3 7/3 4 2
i !
= O 4
3 + 3 4/3 4
n ! ,
which equals
O(2.4151 n )
, so this is the running time of the algorithm.The space usageis
O(2 n )
.2 Results
We show how to improve the algorithm of Eppstein to run in time
O(2.4023 n )
. Therst partofthe algorithmsare thesame, namelymark-ing all 3-colourable subgraphs of the graph in a bit vector. Then our
algorithmndsallmaximalindependent sets
I
of thegraphand foreachchecks 3-colourabilityofallsubgraphs
S
ofG[V \ I]
,bylookinginthebitvector. If they are 3-colourable,
G[S ∪ I ]
is 4-colourable. This will nd allmaximal4-colourablesubgraphs(andmaybesome thatarenot maxi-mal). Usingthebound
b n k c (bn/kc+1)k−n (b n k c + 1) n−bn/kck
onthe numberofmaximalindependent sets of size
k
fromour paper[Bys03 ], and the factthatthey can befound within apolynomial factor ofthis bound,we get
that the runningtime for ndingall maximal4-colourable subgraphs is:
X n k=1
O(|I k (G)| · 2 n−k ) = O
b n 5 c
X
k=1
5 6k−n 6 n−5k 2 n−k + X n k=b n 5 c+1
4 5k−n 5 n−4k 2 n−k
!
= O(80 n/5 ),
which is
O(2.4023 n )
,and whereI k (G)
denotes the set of allmaximal in-dependent sets of
G
of sizek
. Then our algorithmperforms the secondstep of Eppstein's algorithm, but it only needs to consider maximal in-
dependent sets of size at most
|S|/4
and using our improved bound onthe number of these, weget that the runningtime is:
X
S⊆V
O(4 5(|S|/4)−(n−|S|) 5 (n−|S|)−4(|S|/4) ) = O 5 4
n n X
i=0
n i
4 9/4 5 2
i !
= O 5
4 + 4 5/4 5
n !
,
let
X
be an array indexed from 0to2 n − 1
for
S = 0
to2 n − 1
doif
χ(S) ≤ 3
thenX[S] = χ(S)
else
X[S] = ∞
for all MISs
I
inG
dofor all subsets
S
ofV \ I
doif
X[S] = 3
thenX[S ∪ I ] = min(X[S ∪ I], 4)
for
S = 0
to2 n − 1
doif
4 ≤ X[S] < ∞
thenfor all MISs of
G[V \ S]
of size atmost|S|/X [S]
doX[S ∪ I ] = min(X[S ∪ I], X[S] + 1)
return X[V]
whichis
O(2.3814 n )
. ThealgorithmisshownasAlgorithm3. Itstillusesspace
O(2 n )
.Remark. In[Bys03]wealsoshowhowtomarkall3-colourablesubgraphs
of a graph in a bit vector in time
O(2.2680 n )
, by nding all maximalindependentsetsandforeachndallmaximalbipartitesubgraphsofthe
remaininggraph(whichcanbedonebyndingmaximalindependentsets
twice). Thisimprovestherunningtimeoftherststepandalsosimplies
the algorithmas it does not use the 3-colouring algorithm of Eppstein,
but insteaduses maximalindependent sets.
References
[Bys03] J.M.Byskov. Algorithmsfor
k
-colouringandndingmaximalindependent sets. In Proc. 14th Symp. Discrete Algorithms.
ACM and SIAM, Jan. 2003. To appear.
[Epp01a] D. Eppstein. Improved algorithms for 3-coloring, 3-edge-
coloring,and constraintsatisfaction. InProc. 12thSymp. Dis-
crete Algorithms, pages 329337.ACM and SIAM, Jan. 2001.
URLhttp://arXiv.org/abs/cs. DS/0 0090 06.
graph coloring. In F. Dehne, J.-R. Sack and R. Tamassia,
editors, Proc. 7th Worksh. Algorithms and Data Structures,
volume2125ofLectureNotesin ComputerScience,pages462
470. Springer-Verlag, Aug. 2001. URL http://arXiv.org/
abs/cs.DS/0011009.
[Law76] E.L.Lawler. Anote onthecomplexityofthe chromaticnum-
berproblem. Inf. Process. Lett., 5(3):6667,Aug. 1976.
[MM65] J.W.MoonandL.Moser. Oncliquesingraphs.IsraelJournal
of Mathematics, 3:2328,1965.
[TIAS77] S.Tsukiyama,M.Ide,H.Ariyoshi andI.Shirakawa. Anewal-
gorithmforgeneratingallthemaximalindependentsets.SIAM
J.Comput., 6(3):505517,Sept. 1977.