of the Graph Coloring Problem Valmir C.Barbosa 1 CarlosA. G.Assis 2 Josina O.do Nascimento 3 Abstract
We introduce two novel evolutionary formulations of the problem of coloring the nodes of a graph. The
rstformulationisbasedontherelationshipthatexistsbetweenagraph'schromaticnumberanditsacyclic
orientations. It views such orientations asindividuals and evolves them with the aid of evolutionary
op-erators that areveryheavily basedonthe structure ofthe graphand itsacyclicorientations. The second
formulation, unliketherst one,doesnottackleonegraphat atime, but ratheraims at evolvinga
\pro-gram"tocolorallgraphsbelongingtoaclasswhosemembersallhavethesamenumberofnodesandother
commonattributes. Theheuristicsthatresultfromtheseformulationshavebeentestedonsomeofthe
Sec-ond DIMACS Implementation Challengebenchmark graphs,andhave beenfound to becompetitivewhen
comparedtotheseveralotherheuristicsthathavealsobeentestedonthosegraphs.
Keywords: Graphcoloring,evolutionaryalgorithms,geneticalgorithms,geneticprogramming.
1. Introduction
WeconsideragraphG=(N;E),whereN isthegraph'ssetofnodesandEitssetofedges,eachedgebeing
anunorderedpairofnodes,calledneighbors ofeachother. GraphGissaidtobeanundirected graph,since
theunorderednature ofitsedgesassignsno\directionality"tothem. Weletn=jNjandm=jEj.
Acoloring ofGisanassignmentofcolors (positiveintegers)tothenodesinsuchawaythateverynode
is assigned exactly onecolor and, furthermore, no twoneighbors are assigned the samecolor. The graph
coloring problem is theproblem of providing G with acoloringthat employs theleast possible numberof
colors. Thisnumberiscalledthechromaticnumber ofG,denotedby(G).
Thereasonswhythegraphcoloringproblemisimportantaretwofold. First,thereareseveral areasof
practicalinterestinwhichtheabilitytocoloranundirectedgraphwithassmallanumberofcolorsaspossible
hasdirectin uenceonhoweÆcientlyacertaintargetproblemcanbesolved. Suchareasincludetimetabling
andscheduling[12,29],frequencyassignmentforuseoftheelectromagneticspectrum[19],registerallocation
1
UniversidadeFederaldoRiodeJaneiro,ProgramadeEngenhariadeSistemaseComputac~ao,COPPE,
CaixaPostal68511,21945-970RiodeJaneiro-RJ,Brazil. E-mail: [email protected].
2
PontifciaUniversidadeCatolicadoRiodeJaneiro,DepartamentodeInformatica,RuaMarqu^esdeS~ao
Vicente,225,22453-900Riode Janeiro- RJ,Brazil, and Universidade Estaciode Sa, AvenidaAutomovel
Clube,126,20765-000RiodeJaneiro-RJ,Brazil. E-mail: [email protected].
3
ObservatorioNacional,RuaGeneralJoseCristino,77,20921-400RiodeJaneiro-RJ,Brazil,and
nite-elementmeshes[35].
Theother reasonisthat thegraphcoloringproblem hasbeenshownto becomputationallyhard ata
varietyoflevels: notonlyisitsdecision-problemvariantNP-complete[20,27],butalsoitisNP-hardtosolve
itapproximatelywithin n 1=7
oftheoptimumfor any>0[1,2,6]. Whatthis meansis that, giventhe
currentexpectationofhowlikelyitisforanalgorithmto befoundtosolveanNP-hardproblemeÆciently,
coloring the nodes of G with at most n 1=7
(G) colors is an intractable problem for any > 0. There
isasense,then, in which graphcoloringstandsamongthe hardestof thehardcombinatorial optimization
problems.
These tworeasonsare importantenoughtojustify thequestfor heuristicstosolvethe graphcoloring
problem,andtoplaceittogetherwiththefavoriteproblemsonwhichnewmeta-heuristicsaretested. Many
such approaches have been proposed (e.g., [25] and the references therein), but we single oneout which,
althoughitmissesthegraph'schromaticnumberbyratherawidemargininseveralcases,hasanimportant
inspirationalroleinpartofthispaper. Thisheuristicisbasedonthenodes'degrees (numbersofneighbors)
and onthe knownpropertythat (G)+1, where is the maximumdegree overall nodes [7]. The
heuristic visits nodes in nonincreasing order of the so-called saturation degree (number of colors already
used to color neighbors) and assigns thecurrentnodethe smallestcolor that is not alreadytaken by one
ofitsneighbors [8]. Symmetryisbrokenbyusing anonincreasingorder ofdegreesto which onlyneighbors
that havenotyetbeencoloredcontribute,andafter thatrandomly. ThisheuristicisknownastheDSatur
heuristic.
Despitetheproblem'simportanceandthemanyapproachesthathavebeentriedtotackleit,itwasnot
untilrelativelyrecentlythataconcentratedeortwasundertakentotestseveralheuristicsonacommonset
ofgraphsofvarioussizesandcharacteristics. SuchaneortwaspartoftheSecondDIMACSImplementation
Challenge[26],whichremainsto datethemostcomprehensiveprojectthatweknowoftohaveaddresseda
systematicexperimentalevaluationofheuristicsforthegraphcoloringproblem.
Comprehensivethoughthis eortwas,onlyoneoftheapproachestomakeitto thenalmeeting was
of an evolutionary nature [16]. This approach involved the combination of evolutionary and other search
techniques, and was based on previous work by the same authors [15]. In fact, to our knowledge the
situation remains that no purely evolutionary approach seems to havehad success on the graph coloring
problem,althoughtherehavebeenevolutionaryapproachesforrestrictedversionsoftheproblem(e.g.,[14])
andalsootherhybridapproacheswithevolutionaryingredients(e.g.,[18]andthereferencestherein). Inour
view, the central diÆculty is the diÆculty of formulating the problem adequatelyso that individuals and
the appropriate evolutionary operators canbe properly identied. Suppose, for example, that we choose
to approachthe formulationin the obvious, straightforwardmanner, and say that anindividual is simply
aparticularcoloring. That is sound enough,but howdoesone goabout, say, generating anewindividual
from twoparentcolorings? Coloring somenodes accordingto one parentand theothers accordingto the
otherparentmightwork,butnotwithoutsomeadditionalruletohandle thecasesinwhichthesamecolor
ends upassignedto neighbors,orelse allowingsuch infeasible colorassignmentswhilesomehowpenalizing
themthroughappropriatelylowtnessvalues.
Asweperceiveit,theproblemwiththisnaverstapproachandotherscloselyrelatedtoitisthesame
that preventsmassiveparallelismfrom workingsatisfactorilyon thegraphcoloringproblem under certain
other meta-heuristics [5]: the problem speaks of aglobal property of graphs(how many colors overall?),
correspondingsubsetofEforedgeset). Inparticular,ifG
1 andG
2
aredistinctsubgraphsofG,thenitdoes
notfollowthat(G)=(G
1
)+(G
2 ).
Notwithstanding such diÆculties, graph coloringis a research area in which much of the underlying
structure hasalreadybeenuncoveredandconsiderable heuristicexperiencehas beenaccumulated. Inthis
paper,wetakeadvantageofsomekeyaspectsofthis structureandknowledgetointroducetwonew
evolu-tionaryformulationsofthegraphcoloringproblem. Therstformulationbelongsintheclassoftechniques
wenormally thinkof asgenetic algorithms[24, 33], whilethesecond onecanbethoughtof as aninstance
ofgeneticprogramming[3,28].
Ourrstapproach,describedinSection2,isbasedonaviewofthecoloringsofGthatrelatesthemto
theacyclicorientations ofG. An acyclicorientationofGisanyofthepossiblewaysofassigningdirections
tothe(undirected)edgesofGinsuchawaythatnodirectedcycle isformed(thatis,insuchawaythat,by
traversingedgesonlyaccordingtotheassigneddirectionsitisimpossibletoreachthesamenodemorethan
once). Ingeneral,anorientationofGcanberegardedasafunction!:E !N suchthat,fore=(i;j)2E,
!(e)=j ifandonlyifedgeeis directedfromnodei tonodej.
Let adirected path in G accordingto some acyclicorientation bea sequenceof nodes, each of which
is a neighbor of its predecessor, if it has one, such that the last node can be reached from the rst by
traversing the edges that connect consecutive nodes to each other along the directions assigned to them
by the orientation. The essence of our rst approach is that, to any coloring that uses c colors overall
there corresponds anacyclicorientationwhose longestdirected path hasno morethanc nodes; and that,
conversely,to anyacyclicorientationwhoselongest directedpath haslnodesthere corresponds acoloring
bynomorethanlcolors. Ifwelet(G) denotetheset ofallacyclicorientationsof G,thenthis givesrise
tothefollowingrelation between(G)and(G). For!2(G), weletP(!)denotetheset ofalldirected
pathsinGaccordingto !. Forp2P(!),letl(p) bethenumberofnodesinp. Then,from[13],wehave
(G)= min
!2(G) max
p2P(!)
l(p): (1)
Our rst approach regards (G) as the search space out of which populations are formed, that is, each
acyclic orientationof G is an individual. The ttest possibleindividual is the onewhose longest directed
pathisshortestamongallpossibleindividuals.
ThisrstapproachworksonxedG,thatis,everynewgraphthatcomesalongtobecoloredtriggersthe
evolutionofacyclicorientationsinordertondoneofhightness. Thesecondapproach,whichwedescribe
inSection3,isbycontrasttargetedatanentireclassGofundirectedgraphssharingcertaincharacteristics,
asfor examplethe valueof n. It is inspired bythe DSatur heuristicdiscussed above, in the sense that it
approachesthecoloringofG'snodesasthesearchforadegree-basedorderingofthosenodesthatwillyield
agoodcoloringifnodesarecoloredasdictatedbythatordering.
Morespecically,supposeforthemomentthatthenumberofnodesisthesolecharacteristicsharedby
themembersofG,andletK(n)standforthesetofalln!permutationsofthesequenceh1;:::;ni. Amember
=hk
1 ;:::;k
n
iof K(n)canbeinterpretedasthefollowingsequenceofinstructionsto assigncolorstothe
nodesofanygraphG2G: rstassigncolor1tothenodehavingthek
1
thlargestdegree,thenassigntothe
nodehavingthek
2
thlargestdegreethesmallestcolorthatdoesnotcon ictwiththecolorspossiblyalready
assignedtoitsneighbors,andsoon. Ifwefornowdisregardtheexistenceofnodeshavingthesamedegree,
thenK(n)isthesearchspacethat containsthepopulationsofoursecondevolutionaryapproach. Fitnessis
inthiscaseanaveragetakenoverapre-selectedsubclassofG. Anindividualtterthananotherwillrequire
Section 4, abrief discussionon howthe twostrategies' evolutionaryoperatorsrelate to their statespaces
is presented. Section 5 contains a description of the graphs that we use in our experiments, which are
drawnfromthesetoftestgraphsemployedintheDIMACSimplementationchallenge. Experimentalresults
are given in Section 6. They indicate that our two new evolutionary formulations yield algorithms that
are competitive when compared to several others, including those developed in response to the DIMACS
challenge. Section7containsconcludingremarks.
2. The rst formulation
Ourrstformulationis basedontheinterplaybetweenacyclicorientationsofGandcoloringsofitsnodes.
Ifacoloringexiststhat usesc colorsoverall,thenconsidertheorientationobtainedbydirectingeveryedge
fromthenodewiththehighestcolortotheonewiththelowest. Theresultingorientationisclearlyacyclic,
and furthermoreno directed path exists havingmorethan c nodes. Inthe samevein, consider anacyclic
orientationwhoselongestdirectedpathhaslnodes,andconsiderthenodesthataresinks accordingtothis
orientation (a sinkis anode whose incidentedges are alldirected inwardbythe orientation). Nowassign
colorsto nodesasfollows. Firstassign color1to allsinks. Thenremoveallsinksfrom G(togetherwithall
edgesincidenttothem) andassigncolor2to allthenewsinks thatarethusformed. Thisremovalofsinks
canbe repeated exactly l times, and each time it is repeated the resulting sinks are assigned their color,
whichconceivablycanbe someof thecolorsusedpreviously. What resultsisthenacoloringthat employs
nomorethanlcolors.
An important consequence of this interplay is (1), which relates the chromatic number of G to its
acyclicorientations. Ourrst formulationregardsacyclic orientationsasindividuals and aimsat evolving
anacyclicorientationwhose longestdirected pathisasshortas possible. Oncethisindividual isidentied,
thecorrespondingcoloringofthenodesofGcanbefoundasindicatedpreviously.
Beforewegivethedetailsofthisformulation,wepausemomentarilyto commentonthecardinalityof
(G),thesetofallacyclicorientationsofG. Whileforsomegraphssuchcardinalityisknownasafunction
ofnormthatcanbecomputedeasily(2 n 1
fortrees,n!forcompletegraphs,2 n
2forrings),thegeneral
caserequirestheevaluationoftheso-calledchromaticpolynomial ofG. Forc>0,thispolynomial,denoted
byC
G
(c),yieldsthenumberofdistinctwaysinwhichthenodesofGcanbecoloredbyatotalofatmostc
colors[7]. Clearly,thesmallestsuchcforwhichC
G
(c)>0isequalto(G).
Oncethechromaticpolynomialof Ghasbeenintroduced,thecardinalityof(G)canbeprovento be
givenby (G) =( 1) n C G ( 1);
asdemonstratedin[37]. Wethinkthisisaremarkableproperty,andfeltitshouldbepresentedeventhough
it bears no further relationship to thetopic of thepaperthan clarifyinghowto assess (G) , at least in
principle, in the generalcase, and perhapsproviding additional evidence that coloringsof G's nodes and
acyclicorientationsofGareindeed deeplyrelatedto oneanother.
Theremainderof thissectioncontainsadetailed descriptionofthekeyelementsofourrstapproach.
These are the assessment of an acyclic orientation's tness, and the functioning of the two evolutionary
operators we employ, namely crossoverand mutation. We use thefollowingadditional notation. For ! 2
(G), weletS +
(!)be thesetof sinksin Gaccordingto !. Likewise, S (!)denotestheset ofsources in
Gaccordingto! (these arenodeswhoseincident edgesarealldirected outwardby!). Fori2N, N
i (!)
1 f 1 (!)=n max p2P(!) l(p); (2)
wherewerecallthatP(!)isthesetofalldirectedpathsinGaccordingto!andl(p)isthenumberofnodes
in directed path p. It followsfrom (2) that an individual has higher tnessthan another if its lengthiest
directed pathis shorterthantheother's. Byourpreceding discussion, anindividual! yieldsacoloringof
G'snodesbynomorethann f
1
(!)colors.
Clearly,anequivalentreformulationof f
1 (!)is f 1 (!)=n max i2S (!) l i ; (3) wherel i
isthenumberofnodesonthelongestdirectedpathinGaccordingto! thatstartsatnodei. The
expressionforf
1
(!)in (3)ismoreusefulbecausethevalueofl
i
foralli2N canbecomputedeÆcientlyby
straightforwarddepth-rstsearch[10],asinproceduredfs(i;!),givennext.
For alli2N, letreached
i
beaBooleanvariable usedto indicatewhether node ihasbeenreachedby
thedepth-rstsearch(itissetto falseinitially). Wethenhave:
proceduredfs(i;!) ifreached i =false reached i :=true ifi2S + (!) l i :=1 else l i :=1+max j2N i (!) dfs(j;!) Returnl i
Thisprocedureallowsustorewritef
1 (!)yetagainas f 1 (!)=n max i2S (!) dfs(i;!); (4)
whichindicatesdirectlyhowthetnessofanindividualistobeevaluated inpractice.
Crossover. Thecrossoveroftwoparentindividuals!
1 ;!
2
2(G)toyieldthetwoospring! 0 1 ;! 0 2 2(G)
is better understood if we adopt a linearrepresentation for the acyclicorientationsof G. For! 2 (G),
saythat anodej isreachable fromnode iaccordingto ! ifadirected pathexistsfrom itoj. Nowletthe
sequenceofnodes L(!)=hi 1 ;:::;i n i
besuchthat,for1x;yn,x<y ifandonlyifeitheri
y
isreachablefrom i
x
orneithernodeisreachable
from the other but i
x <i
y
. Note that here, asin sectionsto come, we assumefor simplicity that the set
of nodesN canbe regardedastheset of naturalnumbersf1;:::;ng,sothat the comparison\i
x <i
y "is
meaningful.
Ifweregard! as apartialorderof thenodesofG,then clearlyL(!)istheuniquelinearextensionof
that partialorder withthefollowingcharacteristic. Fori
x
2N, everyothernode i
y
suchthat x<y (that
is, to the right of i
x
in L(!)) is either reachablefrom i
x
x y x y
betweenthetwonodes,butsomesymmetry-breakingruleisnecessarytoconstructthelinearrepresentation.
InSection6,wecommentbrie yonthepossibleeectsofusingrandomnesstobreaksymmetry.
Wedescribethecrossoverof!
1 and!
2
in termsoftheirlinearrepresentations,namely
L(! 1 )=hi 1 ;:::;i n i and L(! 2 )=hj 1 ;:::;j n i:
Ifz suchthat 1z<nisthecrossoverpointandwelet
L(! 0 1 )=hi 0 1 ;:::;i 0 n i and L(! 0 2 )=hj 0 1 ;:::;j 0 n i; then hi 0 1 ;:::;i 0 z i=hi 1 ;:::;i z iand hi 0 z+1 ;:::;i 0 n i isthesubsequenceof hj 1 ;:::;j n
icomprisingall thenodes
thatarenotalreadyinhi
1 ;:::;i z i. TheconstructionofL(! 0 2 )isentirelyanalogous: hj 0 1 ;:::;j 0 z i=hj 1 ;:::;j z i and hj 0 z+1 ;:::;j 0 n i is the subsequence of hi 1 ;:::;i n
i comprising all the nodes that are not already in
hj
1 ;:::;j
z i.
In orderto givean interpretation ofthis crossoveroperation that is meaningfulin thecontextof the
acyclicorientationsofG,wemustrstrecognizethat thelinearrepresentationweadoptedisunambiguous.
Infact,anysequenceLcomprisingallnodesfromN canbeseentogiverisetoauniqueacyclicorientation,
as follows. For x < y, if i
x and i
y
are neighbors in G, then direct the edge between them from i
x to
i
y
. Any directed cycle in the resultingorientationwould imply there exivity of <, which doesnot hold.
Consequently,wearejustiedinhavingwrittenL(! 0
1
)andL(! 0
2
),becausetheuniqueorientationsthatresult
fromthosesequencesareindeed acyclic.
Notonlythis,butwecannowseeclearlywhatisinheritedby! 0 1 and! 0 2 from! 1 and! 2 . Orientation! 0 1 inheritsfrom! 1
thedirectionsassignedtoalledgesjoining nodesinthesetfi 0
1 ;:::;i
0
z
gtoanyothernodes,
andfrom!
2
thoseassignedtotheedgeswhoseendnodesalllieinfi 0 z+1 ;:::;i 0 n g. Asfor! 0 2 ,itinheritsfrom ! 2
thedirectionsassignedtoalledgesjoiningnodesin thesetfj 0
1 ;:::;j
0
z
gtoanyothernodes,andfrom!
1
thoseassignedtotheedgeswhoseend nodesareallmembersoffj 0 z+1 ;:::;j 0 n g.
Mutation. ThereareseveralpossibilitiesformutationonanacyclicorientationofG,butwehavedecided
to optforwhat seemsto bethe mostelementary onewhile guaranteeingthegeneration ofanotheracyclic
orientation. Givenanacyclicorientation! andthemutationpointi2N,theoperationconsistsofturning
node iinto asourceto yieldaneworientation! 0
. That! 0
isalso acyclichasbeenargued elsewhere(e.g.,
[4]), and the argument goes asfollows. If ! 0
is not acyclic, then the directed cycle that exists in it must
involvenodei, which iswheretheonlychangewaseectedon! toyield! 0
. Butthisisclearlyimpossible,
sinceaccordingto! 0
nodeiis asource.
3. The second formulation
Our second evolutionary formulationof thegraph coloringproblem is conceptuallysimpler thanthe rst.
Theindividualsthatitevolvesarepermutationsofthesequenceh1;:::;ni,inwhicheachnumberisusedas
anindex intoa certainreference sequenceof the nodesof G. Welet D =hi
1 ;:::;i
n
numbersforthepurposeofbreakingsymmetrywhenmorethanonenodewiththesamedegreeexist. InD,
i
x
comestotheleft ofi
y
ifeither thedegreeofi
x
islargerthanthedegreeof i
y
orthetwodegreesarethe
samebut i
x <i
y .
Thus, recalling that K(n) stands for the set of all permutations of h1;:::;ni, a permutation =
hk
1 ;:::;k
n
i 2 K(n) is to be interpreted asa sequence of n steps to assign colors to the nodes of G. If
we let node(k)denote thekth node in sequence D (i.e., node(k) = i
k
), then the zth step in assigns to
node(k
z
)thesmallestcolorthathasnotbeenassignedtoanyofitsneighborsinG. Ofcourse,theoutcome
ofsuch asequenceofstepsdependsonourchoiceonhowtobreaksymmetry;inSection6,wecommenton
thepossibleeectsofrandomnessandofchoosing analtogetherdierentreferencesequence.
Each 2 K(n) can in principle be regarded as a program to provide any graph on n nodes with a
coloring. Thegoalis to evolveonesuchprogram that, on average,canuseassmall anumberof colorsas
possible. However,thenumberof nonisomorphicgraphsonn nodesgrowssofastwith n(over165billion
graphs for n as small as 12 [31]) that it is not reasonable to expect acceptable performance oversuch a
wideclass of graphsof aprogramevolvedwithin tolerabletime bounds. Onthe otherhand,it also seems
improperto proceedas with therst formulationand evolveaprogram that is specic to asinglegraph,
sincenowtheverynature ofourindividualscalls forgreatergenerality.
Ourchoicehasbeentoevolveprogramsthatarespecictographsbelongingtoacertainclassofgraphs,
allhavingincommonnotonlythenumberofnodesbutalsothedensity,whichisdenedtobetheratioof
thegraph'snumberofedgesto themaximumpossiblenumberofedgeswhentherecanonlybeatmostone
edgebetweenanytwonodes. Weletpdenotesuchdensity,whichisthensuchthat
p= 2m
n(n 1) :
The class of graphs having n nodes and density psuch that p p p + for 0 p p + 1 will be denoted byG(n;p ;p + ).
Wenowdescribehowtoassessthetnessofanindividual,andhowtoperformcrossoveranddomutation
andinversion.
Fitness evaluation. Let T, henceforth referredto as the training set, be arandomly selected subset of
G(n;p ;p +
). Thetnessofanindividual2K(n)isbasedontheaveragenumberofcolorsthatindividual
requires overall membersof T. Ifforprogram we letcolors(;G) denote thenumberofcolorsrequired
forto assigncolorsto thenodesofgraphG, thenthetnessof is thenonnegativeintegerf
2 (), given by f 2 ()=n 1 jTj X G2T colors(;G): (5)
ProgramiscapableofcoloringthenodesofallgraphsinT with,onaverage,n f
2
()colors.
Crossover. Thecrossoveroftwoparentprograms
1 ;
2
2K(n) toyield thetwoospring 0 1 ; 0 2 2K(n),
giventhecrossoverpointzsuchthat1z<n,worksasfollows. Let
1 =hk 1 ;:::;k n i; 2 =h` 1 ;:::;` n i; 0 1 =hk 0 1 ;:::;k 0 n i;
0 2 =h` 0 1 ;:::;` 0 n i: Then hk 0 1 ;:::;k 0 z i = hk 1 ;:::;k z i and hk 0 z+1 ;:::;k 0 n i is the subsequence of h` 1 ;:::;` n
i comprising all the
indices that are notalready in hk
1 ;:::;k z i. As for 0 2 , h` 0 1 ;:::;` 0 z i = h` 1 ;:::;` z i and h` 0 z+1 ;:::;` 0 n i is the subsequenceof hk 1 ;:::;k n
icomprisingalltheindicesthatarenotalreadyinh`
1 ;:::;`
z i.
Inheritance in this case is easier to identify than in the formulation of Section 2. Program 0 1 visits node(k 0 1 );:::;node(k 0 z
)forcoloringin thesamerelativeorder asprogram
1 andnode(k 0 z+1 );:::;node(k 0 n )
inthesamerelativeorderas
2 . Likewise,program 0 2 visitsnode(` 0 1 );:::;node(` 0 z
)forcoloringinthesame
relativeorderasprogram
2 andnode(` 0 z+1 );:::;node(` 0 n
)inthesamerelativeorder as
1 .
Mutation. Single-locusmutationsaremeaninglessonaprogram2K(n),so whatwecallamutation in
thissecondformulationisreallyaswapoftwooftheindicesin,whichthenacquireeachother'spositions
inthesequence. Formutationpointsz andz 0
,theeectofthisoperationon=hk
1 ;:::;k n iistoyieldthe program 0 =hk 0 1 ;:::;k 0 n iwithk 0 z =k z 0 andk 0 z 0 =k z . Inversion. For program =hk 1 ;:::;k n
i in K(n), the eect of inversion on to yield another program
0 =hk 0 1 ;:::;k 0 n iistoset k 0 z =k n z+1 forz=1;:::;n.
4. On the evolutionary operators
Theevolutionaryoperatorsdescribedin Sections2and3foruserespectivelyin ourrstandsecond
formu-lationsofthegraphcoloringproblemwereselectedwithavarietyofgoalsinmind,includingmeaningfulness
in thecontext oftheformulationat hand,parsimonyinthe nalnumberofoperators,and expected
eec-tiveness (as faras this can be inferred from afew initial experimentson reasonably-sizedinstancesof the
problem). While it is possible to see relativelyeasily, as we argued in those sections, that the crossover
operator is indeed in bothformulationsresponsiblefor thetransmission to ospring ofstructurally
mean-ingful informationfrom theparents, for theremaining operators(mutation and, in thecase ofthe second
formulation,inversionaswell)itmayseemthat theyonlyfulll theelusiveroleof occasionallyhelpingthe
search escapelocal optima[17, 32]. In thissection, wearguethat mutation, in bothformulations, canbe
ascribed the more precise role of allowing the search to lead from any one individual to any other with
nonzeroprobability(possiblywiththehelpofinversion,inthecaseofthesecondformulation).
Understand-ingthisproperty,whichholdstriviallyinthecaseofbit-stringrepresentationsundersingle-locusmutations,
forexample,requiresalittleelaborationin thecaseofourtwoformulations,especiallysofortherstone.
WerstdiscussmutationinthecontextofSection2. Inthiscase,mutationonanacyclicorientationis
theturningofanarbitrarynode(themutationpoint)intoasource,whichyieldsanotheracyclicorientation.
Forarbitrary!;! 0
2(G), thequestionthatweansweraÆrmativelyinthissectioniswhetherthere exists
anite sequenceof mutations that turns! into! 0
. Theargumentrequires alittleadditionalnotation, as
follows. LetM E betheset of edgesthat ! and! 0
direct dierently, andlet U N betheset of end
nodesoftheedgesinM. Likewise,letM +
Ebethesetofalledgeslyingondirectedpathsaccordingto!
thatleadtonodesinU,andletU +
N bethesetofendnodesoftheedgesinM + . Clearly,U U + and MM +
. Thedesiredtransformationof!into ! 0
mustreversethedirectionsassignedby! toalledgesin
M whilekeepingalltheremainingedges' directionsuntouched.
Inorder todescribeanite sequenceof mutations thatachievesthis weneed stillmorenotation. For
k2N,lett
k
sequence ofmutations that alwaysguaranteethe transformationof ! into ! 0
. In this assignment,werst
lett
k
=0foreveryksuchthatk2NnU +
(here,andhenceforth,nisusedtodenotesetdierence). Asfor
k2U +
,weletvaluesbeassignedinsuchawaythat
t i =t j ; if(i;j)2=M; t i <t j ; if(i;j)2M (6) for(i;j)2M +
directed by! from ito j. What(6)isdoingis toassign valuesthatare strictlyincreasing
asonetraversesedgesofM alongthedirectionsgivenby!,butremainconstantoverthetraversalofedges
ofM +
nM alsoalongthedirectionsgivenby!.
Notethatsuchanassignmentisalwayspossible,owingtothefactthat! isacyclic,whichimpliesthat
the strict inequalities appearing in (6) for membersof M can always be satised. In particular, because
values are nondecreasing along directed paths, it is a trivial matter to choose them in such a way that
t k <jU + jforallk2U + . If ft k ;k 2 U +
g is aset of values that obeys (6), then the corresponding sequence of mutations that
leads from ! to ! 0
is obtainedby repeating the following step until t
k =0 for all k 2 U + . If ` 2 U + is
notcurrentlyasourceandt
`
isnonzeroandgreatestoverallofU +
,then turn`intoasourceandsett
` to
t
`
1;whentwoneighborsaretied,picktheonethatispointedto bytheedgebetweenthemaccordingto
thecurrentorientation. Notethat,ifeveryt
k
isassigned thesmallestpossiblevalue,thenthis sequenceof
mutationscomprisesO jU + j 2 mutationsoverall.
Nowlet e=(i;j)beany edge,and letthedirection assigned toit by! befrom i to j. Ife isnotan
edge of M +
, then clearlythe process we just described doesnot aect it. If e2 M +
nM, then t
i and t
j
haveinitially thesamevalue,and thereforei andj getturned into sourcesthesamenumberof timesand
alternately with respect toeach other. Also,becausee is directed towardj by!, j is therst ofthe two
nodestobeturnedintoasourceandi isthelast,soattheendtheedge'sdirectionsettlesasinitially, that
is, from i to j. Fore 2 M, initially it holds that t
i <t
j
, soj is turned into asource strictly moretimes
thaniis. Twoscenarioscanbeenvisaged. Intherst,theinequalityt
i <t
j
ismaintainedthroughoutthe
process,sojisthelastofthetwonodestobeturnedintoasource. Inthesecondscenario,t
i andt
j
become
equalbeforetheendoftheprocess,whichmusthappenupononeoftheturningsofj intoasource,therefore
leavingtheedgedirectedtowardi. From thenonthetwonodesbecomesourcesthesamenumberoftimes
and alternately,i beingthe rstand j thelast. Ineither scenario,edge eends updirectedfrom j toi. It
followsfromthis that! 0
istheorientationofthegraphattheendofthesequenceofmutations.
ThecaseoftheformulationofSection3isconsiderablysimpler. Fortwoprograms=hk
1 ;:::;k n iand 0 =hk 0 1 ;:::;k 0 n
i,thefollowingisasequenceof mutationsthat leadsfrom to 0 . For z=1;:::;n, check whetherk 0 z =k z
;ifnot,thenletz 0 >zbesuchthatk 0 z =k z 0 andswapk z withk z 0
. Clearly,theresulting
isthesameas 0
. Also,fastthoughthis transformationofinto 0
is(nomorethann 1swapsareever
needed),itiseasytoconceiveofcasesin whichtheuseofinversioncanmakeitevenfasterwhenappliedas
arststep.
5. The experimental test set
This section contains a brief description of the graphs to be used in Section 6 as benchmark graphs for
implementations of our rst and second formulations. They have all been extracted from the DIMACS
unorderedpairofnodesbyanedgewithprobabilityq=10. Weusethesegraphswithn2f125;250;500gand
q=5.
Rn.q. These arerandomgraphson nnodes. Theyareconstructedbyrandomlyplacingthenodesinsidea
unit squareand thenconnectingbyanedge anytwonodesthat arenofartherapartfrom each otherthan
q=10. Weusethesegraphswithn2f125;250gandq2f1;5g.
Rn.qc. These graphsare the complements of the Rn.q graphs, that is, each one of them has exactlythe
edgesthatareabsentfrom itscounterpart. Weusethesegraphswithn2f125;250gandq=1.
DSJRn.q[25]. ThesameasRn.q. Weusen=500and q=1.
DSJRn.qc[25]. ThesameasRn.qc. Weusen=500andq=1.
flatnk f [11]. Thesearek-partite randomgraphsonnnodeswithdensityp0:5. Beingk-partitemeans
thatthenodesetcanbepartitionedintokindependentsets,thatis,setswhosemembersarenotneighbors;
consequently, (G)k. Byconstruction,all independent sets haveas closeto thesamenumberof nodes
aspossible,andfurthermoreedgesaredistributedamongpairsofindependentsetsasequitablyaspossible.
Inaddition,givenanytwooftheindependentsets,nonodein oneofthem isallowedmoreedges joiningit
to theother setthan anyothernodeinitsownset (exceptfor anumberf of edges,known asa\ atness"
parameter). Weusethesegraphswithn=300,k2f20;26;28g,andf =0.
lenkx[29]. These arerandom graphson nnodes with(G)=k. Theyhavenumbersof edgessuch that
p,thedensity, issuchthat p0:25,andare constructedbythecreationofcliquesof varyingsizes insuch
awaythatthepre-speciedvaluek of(G)isnotviolated. Weusethesegraphswith n=450andk=15;
xisoneofa,b,c,ord,and isusedtodierentiateamonginstances.
mulsol.i.1[30]. Thisgraphresultsfromaninstanceoftheproblemofregisterallocationin compilers.
school1-nsh[30]. This graphresultsfrom theproblemofconstructingclass schedulesin such awayas to
avoidcon icts. Becauseitcomesfromanactualclassschedule,itisknownthat (G)14.
WeshowinTable1allthegraphsweemployinourexperiments. ForeachgraphG,thetabledisplays
thevaluesofn,m,andp,aswellas(G)(oranupperboundonit),whenknownfromdesigncharacteristics.
Thetable alsocontainsthegraphclassof which itis amemberthat istargeted inourexperimentsbythe
implementationofoursecond formulation.
6. Experimental results
Henceforth, we let Evolve AO and Evolve P denote the algorithms resulting, respectively, from the
evolutionaryformulationsofSections2and3. Evolve AOworksonaxedgraphGandseekstheacyclic
orientationofGwhoselengthiestdirected pathisshortestover(G). Evolve P,bycontrast,searchesfor
theprogram(amemberofK(n))thatcolorseachofthegraphsinG(n;p ;p +
)withasfewcolorsaspossible.
Both Evolve AO and Evolve P iterate for g generations, each one characterized by a population
G n m p (G) Targetclass R125.1 125 209 0:027 G(125;0:02;0:09) R125.5 125 3;838 0:495 G(125;0:40;0:99) DSJC125.5 125 3;891 0:502 G(125;0:40;0:99) R125.1c 125 7;501 0:968 G(125;0:40;0:99) mulsol.i.1 197 3;925 0:203 G(197;0:10;0:39) R250.1 250 867 0:028 G(250;0:02;0:09) R250.5 250 14;849 0:477 G(250;0:40;0:99) DSJC250.5 250 15;668 0:503 G(250;0:40;0:99) R250.1c 250 30;227 0:971 G(250;0:40;0:99) flat30020 0 300 21;375 0:477 20 G(300;0:40;0:99) flat30026 0 300 21;633 0:482 26 G(300;0:40;0:99) flat30028 0 300 21;695 0:484 28 G(300;0:40;0:99) school1-nsh 352 14;612 0:237 14 G(352;0:10;0:39) le45015a 450 8;168 0:081 15 G(450;0:02;0:09) le45015b 450 8;169 0:081 15 G(450;0:02;0:09) le45015c 450 16;680 0:165 15 G(450;0:10;0:39) le45015d 450 16;750 0:166 15 G(450;0:10;0:39) DSJR500.1 500 3;555 0:028 G(500;0:02;0:09) DSJC500.5 500 62;624 0:502 G(500;0:40;0:99) DSJR500.1c 500 121;275 0:972 G(500;0:40;0:99)
during all the evolutionary search, denoted respectivelyby !
and
. For k > 1, the kth population is
generatedfrom thek 1stpopulationbyrsttransferring thefsttestindividuals tothenewpopulation
(this is an elitist rst step, with 0 f < 1), and then repeatedly selectingindividuals for application of
theevolutionaryoperators. Theresultingindividualsarethenaddedtothenewpopulationuntilitislled.
Therstpopulationisgenerated randomly,whichcanbeachievedin asimilar fashionbybothalgorithms
byrandomlycreatingssequencesofnintegers. Ineachofthesesequences,everyelementoff1;:::;ngmust
appear exactlyonce. ForEvolve AO,one such sequenceis identiedwith thelinearrepresentationL(!)
ofsomeacyclicorientation!;forEvolve P,itisidentiedwithaprogramdirectly.
As with the choice of evolutionary operators for both algorithms, choosing an appropriate selection
method has relied on the outcome of some preliminary experiments on reasonably-sized graphs. For
Evolve AO, this hasresulted in selecting individuals proportionally to its linearly normalizedtness in
thecurrentpopulation. Inotherwords,iffork2f1;:::;sgacertainindividual! hasthekthsmallestvalue
off
1
(!)overtheentirepopulationforf
1
(!)asin(4), thenitisselectedwithprobabilityproportionalto
g
1
(!)=2k: (7)
Tiesin theorderof tnesswithin thepopulationarebrokenby theorder inwhich individualswere added
tothepopulationin therstplace.
ThecaseofEvolve Pissimilar, but becausetnessesare nowaveragestakenoverthemembersofa
subclassofgraphsT ofG(n;p ;p +
proportionally to afunction that verysteeply increaseswith f
2
() for in the current population, f
2 ()
beinggivenasin(5). Specically,weletbeselectedwithprobabilityproportionalto
g
2 ()=e
f2()
: (8)
The decision as to how to manipulate the individuals selected according to either (7) or (8) before
inclusion in the new population is also reached probabilistically. The various probabilities involved are
denoted asfollows.
p
c
: theprobabilityof performingthecrossoveroftwoselectedindividuals;
p
m
: theprobabilityofperformingmutation onaselectedindividual;
p
i
: theprobabilityofperforminginversiononaselectedindividual.
Inthissection, wesummarizetheresultsofourexperimentswithEvolve AOand Evolve Ponthe
benchmarkgraphsdescribedin Section 5. Thesummarywepresentis farfrom exhaustivewithrespect to
thepossiblecombinationsoftheparametersinvolved,butrathercontainsthecombinationsthatyieldedthe
bestresultswehaveobtained.
Wepresenttwotypesofperformancegures. Figuresofthersttypere ecthowwellagraphorclass
of graphsiscolored byagiven individual. ForEvolve AO,which operates onxed G,this performance
gure is the numberof colorsneeded to provide G with a coloring. During the evolutionary search, this
number is given as n f 1 (! + ), where ! +
is the best individual of the current generation; likewise, once
!
hasbeenidentied asthebest individualfoundduring thewholesearch,then itisgivenas n f
1 (!
).
ForEvolve P,whichaimsatcoloringallthegraphsbelongingtotheclassG(n;p ;p +
)bytheprogram
thatonaverageperformsbestonthetrainingsetT G(n;p ;p +
),thisrstperformancegureispresented
undertwoguises. Duringtheevolutionarysearch,itispresentedastheaveragenumberofcolorsneededby
thegraphsinT underthebestprogram,say +
,ofthecurrentgeneration,thatis,n f
2 ( + ). After has
beenidentied, then the performance gureis presentedascolors(
;G) for eachgraph G2G(n;p ;p +
)
thatisin thebenchmarkset asintroducedinSection 5.
Oursecondperformancegureisrelatedtohowthequalityofthebestindividualoutputbythesearch
is aected by thenumber g of generations elapsedbefore completion. This gureis givendirectly by the
valueofg,whichisto bethoughtofasaplatform-independentassessmentofeach algorithm'seÆciency.
This section also contains a comparativeassessment of Evolve AO and Evolve P with respect to
seven other approachesthat havealso been tested on theDIMACS benchmark graphs. These are thesix
approaches that appeared in the challenge's proceedings volume [26] and the one in [18], which appeared
later. Becausenearlyallnineapproachesarebasedonwidelydieringstrategiesandhavebeenimplemented
onanequallydiversesetofplatforms,ourcomparisonisrestrictedtoperformanceguresthatindicatehow
wellthebenchmarkgraphsarecolored. Thefollowingisabriefdescriptionofthosesevenapproaches.
I Greedy [11]. Thisis aniteratedversionofthegreedyprocedurethat assignscolorstonodesfollowinga
certain orderand choosing,for each node, the smallestcolorthat still hasnot been assignedto anyof its
neighbors. Ateachiteration,adierentorderischosenaccordingtoacriterionthatinvolvesthelatestcolor
assignmentandalsodegree-relatedinformation, asinDSatur, amongothers.
T B&B[23]. This isabranch-and-boundalgorithm thatemployselementsinspiredin tabusearch [22]for
isgoodforeitherexactorheuristicgraphcoloring,dependingonwhetherthelargecliquethatisfoundcan
beguaranteedtobemaximum(havemaximumsize),sinceitcanbeeasilyshownthat(G)!(G), where
!(G)isthesizeofthemaximumcliqueofG[7]. Providingsuchaguaranteeisofcourseashardascoloring
thegraph[20,27], butseemsto becomeonlytolerablyburdensomeasthegraphsbecomesparser.
Dist [34]. This algorithm employs multiple sequential computers to work concurrently on several partial
coloringsof thegraph(that is, assignmentsof colorsto subsets ofN). Oneof thecomputersmaintainsa
poolofthebestpartialcoloringssofaroutputbytheothers,andcontinuallysubmitssuchcoloringstothose
computersto beextendedbyneighborhoodsearchand possiblyimproved.
Par [30]. This is a combination of Dist with exhaustive search by parallel branch-and-bound. The two
computationsarestartedconcurrentlyonaparallelmachine,eachonetakingacertainnumberofprocessors.
Theprocessorthatin Distisresponsibleformaintainingapoolofpartial coloringsis nowalsofed bythe
exhaustive-searchcomputation,andrelaysthebestpartialcoloringsfoundbyonecomputationtotheother.
E B&B[36]. Thisisanexactbranch-and-boundalgorithm. Itskeyingredientsincludendingamaximum
cliqueto work aslowerbound (cf. ourearlierdescriptionofT B&B) andanovelbranchingrule that,like
DSatur,usesthenodes'saturationdegreesinthedecision.
T Gen 1 [16]. This is a hybrid approach that employs tabu search inside a genetic algorithm. In this
approach, anindividual isapartition ofthegraph'snodesinto colorclasses,that is,subsetsofnodesallof
whicharetobeassignedthesamecolor. Thegenerationofnewindividualsbycrossoverdoesnotinprinciple
guaranteetheabsence ofedges joining nodes in thesamecolorclass, which is where tabusearch comes in
lookingforthere-arrangementinto colorclassesthatrequirestheleastnumberofclasses.
T Gen 2[18].ThisapproachisentirelyanalogoustoT Gen 1,fromwhichitdiersmainlyonhowcrossover
isperformed.
The plots in Figure 1 show the behavior of Evolve AO, each plot corresponding to a run of the
algorithmononeofthegraphsinTable1. Theyhaveallbeenobtainedwithp
c
=0:60,p
m
=0:02,f =0:70,
g=5;000,ands=100. Forclarityofexposition,thealgorithm'sbehaviorpriortothehundredthgeneration
isnotshown(attherstgeneration,andshortlyonward,thenumberofcolorsimpliedbythebestindividual
tendstobeinordinatelyhigh). Analogously,Figure2containsoneplotforeachoftheelevendistincttarget
classesappearinginTable1,eachplotcorrespondingtoarunofEvolve Ponrandomlyselectedmembers
ofitstargetclass. Theseplotshavebeenobtainedwithparametersvaluedasin Table2.
The plots in Figures 1 and 2 indicate that both Evolve AO and Evolve P exhibit the
tness-improvement behaviorone expects of well formulated evolutionary computations, often verymarkedly so
in the earliestgenerations. Whilefor Evolve AOthis happens smoothly overtime, forEvolve P some
plotsarealittlejagged,perhapsre ectingthegreaterdiÆcultyofconcomitantlyimprovingthecoloringsof
allgraphsinthetrainingsetT.
Weshowin Table3the best resultsobtainedby Evolve AOandEvolve P side bysidewith those
obtainedby thecompeting algorithms we outlinedearlier. Foreachof the graphsin Table1, what Table
3showsis the value of itschromaticnumber (or an upperbound on it), when known by design, and the
0
1
2
3
4
5
6
100 500 1000
2000
5000
Coloring
Generation
34
35
36
37
38
39
40
41
42
100 500 1000
2000
5000
Coloring
Generation
15
20
25
30
35
40
100 500 1000
2000
5000
Coloring
Generation
40
45
50
55
60
65
70
75
80
100 500 1000
2000
5000
Coloring
Generation
R125.1 R125.5 DSJC125.5 R125.1c20
25
30
35
40
45
50
55
60
100 500 1000
2000
5000
Coloring
Generation
6
8
10
12
14
16
100 500 1000
2000
5000
Coloring
Generation
60
65
70
75
80
100 500 1000
2000
5000
Coloring
Generation
28
30
32
34
36
38
100 500 1000
2000
5000
Coloring
Generation
mulsol.i.1 R250.1 R250.5 DSJC250.560
65
70
75
80
85
90
100 500 1000
2000
5000
Coloring
Generation
20
30
40
50
60
70
80
90
100 500 1000
2000
5000
Coloring
Generation
30
40
50
60
70
80
90
100
110
100 500 1000
2000
5000
Coloring
Generation
30
40
50
60
70
80
90
100
100 500 1000
2000
5000
Coloring
Generation
R250.1c flat300 200 flat300 260 flat30028 0
10
15
20
25
30
35
40
100 500 1000
2000
5000
Coloring
Generation
15
20
25
30
100 500 1000
2000
5000
Coloring
Generation
15
20
25
30
100 500 1000
2000
5000
Coloring
Generation
15
20
25
30
35
40
45
100 500 1000
2000
5000
Coloring
Generation
school1-nsh le45015a le45015b le45015c
15
20
25
30
35
40
45
100 500 1000
2000
5000
Coloring
Generation
10
12
14
16
18
20
22
24
100 500 1000
2000
5000
Coloring
Generation
50
55
60
65
100 500 1000
2000
5000
Coloring
Generation
84
86
88
90
92
94
100 500 1000
2000
5000
Coloring
Generation
le45015d DSJR500.1 DSJC500.5 DSJR500.1cFigure1. ConvergenceofEvolve AOonthegraphsofTable1
is given as an average overa certain number of runs (10 for I Greedy, 5for Par, between 3and 10 for
T gen 1, and 5 for Evolve AO), for some others as the result of a single run (T B&B, E B&B, and
Evolve P). Yet forother algorithms(Distand TGen 2), what appearsin Table3isthelowestvalueof
6.22
6.24
6.26
6.28
6.30
6.32
6.34
6.36
6.38
6.40
0
10
20
30
40
50
60
70
Coloring
Generation
34.00
34.20
34.40
34.60
34.80
35.00
35.20
35.40
35.60
0
50
100
150
200
250
300
Coloring
Generation
18.20
18.40
18.60
18.80
19.00
19.20
19.40
0
20
40
60
80 100 120 140 160 180 200
Coloring
Generation
G(125;0:02;0:09) G(125;0:40;0:99) G(197;0:10;0:39)8.75
8.80
8.85
8.90
8.95
9.00
9.05
9.10
9.15
9.20
9.25
0
50
100
150
200
250
300
350
Coloring
Generation
63.00
63.50
64.00
64.50
65.00
65.50
0
100
200
300
400
500
600
Coloring
Generation
57.80
58.00
58.20
58.40
58.60
58.80
59.00
59.20
59.40
59.60
59.80
0
100
200
300
400
500
600
700
Coloring
Generation
G(250;0:02;0:09) G(250;0:40;0:99) G(300;0:40;0:99)27.80
28.00
28.20
28.40
28.60
28.80
29.00
0
100
200
300
400
500
600
Coloring
Generation
13.20
13.30
13.40
13.50
13.60
13.70
13.80
13.90
14.00
0
100 200 300 400 500 600 700 800 900
Coloring
Generation
33.80
33.90
34.00
34.10
34.20
34.30
34.40
34.50
0
50
100
150
200
250
300
Coloring
Generation
G(352;0:10;0:39) G(450;0:02;0:09) G(450;0:10;0:39)15.70
15.75
15.80
15.85
15.90
15.95
16.00
16.05
16.10
0
50
100
150
200
250
300
350
400
Coloring
Generation
101.0
101.5
102.0
102.5
103.0
103.5
0
50
100
150
200
250
Coloring
Generation
G(500;0:02;0:09) G(500;0:40;0:99)Figure 2. ConvergenceofEvolve PonthetargetclassesofTable1
testedbysuccessivelydecreasingthevalueofkfromsomeinitialvalue. TheentriesinTable3corresponding
toallalgorithmsbutourownareeither from[26]or,inthecaseofT Gen 2, from[18].
WhilenoneoftheheuristicsappearinginTable3canbeproclaimedstrictlybestoverallgraphs,when
we examineeach graphindividually many ofthe heuristicscanbesaid to doaswellas theonethat does
Targetclass jTj p c p m p i f g s G(125;0:02;0:09) 40 0:71 0:01 0:28 0:02 70 200 G(125;0:40;0:99) 60 0:71 0:01 0:28 0:02 300 100 G(197;0:10;0:39) 60 0:71 0:01 0:28 0:01 200 100 G(250;0:02;0:09) 60 0:71 0:01 0:28 0:01 350 100 G(250;0:40;0:99) 60 0:71 0:01 0:28 0:02 600 100 G(300;0:40;0:99) 60 0:71 0:01 0:28 0:01 700 100 G(352;0:10;0:39) 60 0:71 0:01 0:28 0:01 600 100 G(450;0:02;0:09) 100 0:71 0:01 0:28 0:02 900 100 G(450;0:10;0:39) 100 0:70 0:01 0:29 0:02 300 100 G(500;0:02;0:09) 40 0:70 0:01 0:29 0:02 400 100 G(500;0:40;0:99) 40 0:71 0:01 0:28 0:02 250 200
forwhichperformanceguresaregivenin bold typeface)performedat leastas wellasthebest performers
on those samegraphs, occasionallyeven better. Forthe other graphs, oftenEvolve AO and Evolve P
missthebestperformersverynarrowly.
7. Concluding remarks
Wehavein this paperintroducedtwonovelevolutionary formulationsof thegraphcoloringproblem. The
rst formulation views the problem of nding a graph's chromatic number as the problem of nding an
acyclicorientationof thegraphaccordingto which thelongestdirected pathis shortestamong allacyclic
orientations. Viewing theproblem fromthis perspectiveimmediatelyprovidestheessentialfoundation for
the evolutionary formulation, since each acyclic orientation can be viewed as an individual whose tness
canbesaidto behigherasitslongestdirectedpathis shorter. Despitethisinitial simplicity,thedesignof
appropriateevolutionaryoperatorshasreliedonsophisticatedgraph-theoreticarguments.
Our second formulation takesan entirelydierent route, and seeks to nd a program that will color
anygraphhavingapre-speciednumberofnodesanddensitywithinapre-speciedinterval. Thisprogram
isapermutation ofindicesinto asequenceofnodesthat ispreviouslyagreedupon. Thesequencewehave
usedcontainsnodesinnonincreasingorderofdegrees,havingbeenlooselyinspiredbytheDSaturheuristic.
Butbeingonlyareference sequence,anyother sequencecouldhavebeenused aswell. A programis then
somethinglike\rst colorthe nodewhose degreeis thethird highestwith thelowest availablecolor, then
the node whose degree is the seventh highest, etc.," for example. In this formulation, each individual is
aprogram, its tnessbeinghigher as the average numberof colorsit requires to colorall thegraphsin a
randomlyselectedsubsetofgraphshavingthatnumberofnodesanddensityin thatintervalissmaller.
We have presented experimental results on some of the DIMACS benchmark graphs and compared
ouralgorithms'performanceswiththose oftheotherheuristicsthat weknowtohavebeentestedonthose
graphsaswell. Ourresultsindicate generallycompetitiveperformance,sometimesreachingthebest results
obtainedbytheotherheuristics,occasionallybetter.
Notwithstanding these positive results, there is room, at least in principle, for improvements to be
G (G) I Greedy TB&B Dist Par E B&B R125.1 5:0 5 5 5:0 5 R125.5 36:9 36 36 37:0 36 DSJC125.5 18:9 20 17 17:0 R125.1c 46:0 46 46 46:0 46 mulsol.i.1 49:0 49 49 49:0 49 R250.1 8:0 8 8 8:0 8 R250.5 68:4 66 65 66:0 65 DSJC250.5 32:8 35 28 29:2 R250.1c 64:0 65 64 64:0 64 flat300 200 20 20:2 39 20 20:0 flat300 260 26 37:1 41 26 32:4 flat300 280 28 37:0 41 31 33:0 school1-nsh 14 14:1 26 20 14:0 le45015a 15 17:9 16 15 15:0 le45015b 15 17:9 15 15 15:0 15 le45015c 15 25:6 23 15 16:6 le45015d 15 25:8 23 15 16:8 DSJR500.1 12:0 12 12 12:0 12 DSJC500.5 58:6 65 49 53:0 DSJR500.1c 85:0 87 85 85:3
symmetry, so it may be worth checking whether introducing randomness at these points can have any
noticeableeect. Also,ourtwoformulationsarebothpurely evolutionary,inthesense that atnopointdo
theyemployauxiliaryheuristics,likeforexamplesomeformoflocalsearch. Wethinkitmaybeworthwhile
toinvestigatesuchhybridalternatives.
Itis,however,inthecontextofEvolve P,thealgorithmthatimplementsoursecondformulation,that
we believe the possibilities for extension and improvement are the most challengingand interesting. For
example,ofallthegraphsthatwerepresentedtoEvolve P forcoloring,theones thatpromptedtheleast
satisfactoryresultswerethosewhosenodeshavedegreesverycloselyconcentratedneartheaverage,thatis,
graphswithverylittlevarianceofnodedegree(thiscannotbeinferredfromthedatawehavepresented,but
isclearfromacloserexaminationoftheDIMACSles). Wethinkthismaybeduetothefactthatperhaps
thisquantitywaspoorlyrepresentedbythegraphsofthetrainingset. BecauseEvolve Pisstronglybased
ondegreesandhowtheyrelatetooneanotherinsidethegraph,itispossiblethattargetingtheevolutionnot
justatacertainnumberofnodesandacertaindensityinterval,butalsoatacertainintervalofnode-degree
variance,mightyield signicantimprovementsin somecases. Thiswould, ofcourse, callforageneratorof
randomgraphscapableofcontrollingsuchvariancesinadditiontodensities,whichistoourknowledgealso
G (G) T Gen 1 TGen 2 Evolve AO Evolve P R125.1 5:0 5:0 5 R125.5 35:6 36:2 36 DSJC125.5 17:0 17:2 20 R125.1c 46:0 46:0 46 mulsol.i.1 49:0 49:0 49 R250.1 8:0 8:0 8 R250.5 69:0 65:2 65 DSJC250.5 29:0 28 29:1 29 R250.1c 64:0 64:0 64 flat300 200 20 20:0 26:0 23 flat300 260 26 26:0 31:0 28 flat300 280 28 33:0 31 33:0 29 school1-nsh 14 14:0 14:0 20 le45015a 15 15:0 15:0 17 le45015b 15 15:0 15:0 17 le45015c 15 16:0 15 16:0 25 le45015d 15 16:0 19:0 25 DSJR500.1 12:0 12:0 12 DSJC500.5 51:0 48 52:5 59 DSJR500.1c 85:3 85:0 85 Acknowledgments
The authors acknowledge partial support from CNPq, CAPES, the PRONEX initiative of Brazil's MCT
undercontract41.96.0857.00,andaFAPERJBBPgrant.
References
1. S. AroraandC.Lund, \Hardnessofapproximations,"inD. S. Hochbaum(Ed.), Approximation
Algo-rithmsfor NP-HardProblems,PWSPublishingCompany,Boston,MA,1997,399{446.
2. G.Ausiello,P.Crescenzi,G.Gambosi,V.Kann,A.Marchetti-Spaccamela,andM.Protasi,Complexity
andApproximation,Springer-Verlag,Berlin,Germany,1999.
3. W. Banzhaf, P. Nordin, R. E. Keller, and F. D. Francone, Genetic Programming: An Introduction,
MorganKaufmannPublishers,SanFrancisco,CA,1998.
4. V.C.Barbosa,AnAtlasofEdge-Reversal Dynamics, Chapman&Hall/CRC,London,UK,2000.
5. V.C.BarbosaandE.Gafni,\Adistributedimplementationofsimulatedannealing,"J.ofParalleland
DistributedComputing 6(1989),411{434.
6. M. Bellare, O. Goldreich, and M. Sudan, \Free bits, PCPs, and nonapproximability|towards tight
8. D.Brelaz,\Newmethodsto colorverticesofagraph,"Comm.of the ACM 22(1979),251{256.
9. F. C. Chow and J. L.Hennessy, \The priority-basedcoloring approach to register allocation,"ACM
Trans.onProgramming Languages andSystems 12(1990),501{536.
10. T.H.Cormen,C.E.Leiserson,andR.L.Rivest,IntroductiontoAlgorithms,TheMITPress,Cambridge,
MA,1990.
11. J.C.CulbersonandF.Luo, \Exploringthek-colorablelandscapewithIteratedGreedy,"in [26],245{
284.
12. D.deWerra,\Anintroductiontotimetabling,"EuropeanJ.ofOperationalResearch19(1985),151{162.
13. R. W. Deming, \Acyclic orientations of a graph and chromatic and independence numbers," J. of
CombinatorialTheory B 26(1979),101{110.
14. A. E. Eiben, J. K. van derHauw, and J.I. van Hemert,\Graph coloring withadaptiveevolutionary
algorithms,"J.of Heuristics 4(1998),25{46.
15. C.Fleurentand J.Ferland,\Genetic andhybridalgorithmsforgraphcoloring,"Annals of Operations
Research 63(1996),437{461.
16. C.Fleurentand J.A.Ferland,\Object-orientedimplementationofheuristicsearchmethods forgraph
coloring,maximumclique,andsatisability,"in[26],619{652.
17. D.B.Fogel,EvolutionaryComputation, IEEEPress,NewYork,NY, 1995.
18. P. Galinier and J.-K. Hao, \Hybrid evolutionaryalgorithms for graphcoloring," J. of Combinatorial
Optimization 3(1999),379{397.
19. A.Gamst,\Somelowerboundsforaclassoffrequencyassignmentproblems,"IEEETrans.onVehicular
Technology 35(1986),8{14.
20. M. R. Garey and D. S. Johnson, Computers and Intractability: A Guide to the Theory of
NP-Completeness,W. H.Freeman,NewYork,NY, 1979.
21. M.R.Garey,D.S.Johnson,andH.C.So,\Anapplicationofgraphcoloringtoprintedcircuittesting,"
IEEETrans.onCircuitsandSystems CAS-23(1976),591{599.
22. F.GloverandM.Laguna,TabuSearch,KluwerAcademicPublishers,Boston,MA,1997.
23. F.Glover,M.Parker,andJ.Ryan,\Coloringbytabubranchandbound,"in [26],285{307.
24. D. E. Goldberg, Genetic Algorithms in Search, Optimization and Machine Learning, Addison-Wesley
PublishingCompany,Reading,MA,1989.
25. D. S.Johnson,C.R.Aragon,L.A. McGeoch,andC.Schevon,\Optimizationbysimulatedannealing:
anexperimental evaluation; partii, graphcoloringand numberpartitioning," Operations Research 39
(1991),378{406.
26. D.S.JohnsonandM.A.Trick(Eds.),Cliques,Coloring, andSatisability:SecondDIMACS
Complexity ofComputer Computations, PlenumPress,NewYork,NY,1972,85{103.
28. J.R.Koza,Genetic Programming,TheMITPress,Cambridge,MA,1992.
29. F. T. Leighton, \A graph coloring algorithm for large scheduling problems," J. of Research of the
NationalBureauof Standards 84(1979),489{505.
30. G.LewandowskiandA.Condon,\Experimentswithparallelgraphcoloringheuristicsandapplications
ofgraphcoloring,"in[26],309{334.
31. B.D.McKay,\Isomorph-freeexhaustivegeneration,"J.of Algorithms 26(1998),306{324.
32. Z.MichalewiczandD.B.Fogel,HowtoSolve It:ModernHeuristics,Springer-Verlag,Berlin,Germany,
2000.
33. M.Mitchell,An IntroductiontoGenetic Algorithms,TheMITPress,Cambridge,MA,1996.
34. C.Morgenstern,\Distributedcolorationneighborhoodsearch,"in[26],335{357.
35. Y.Saad,IterativeMethodsfor Sparse LinearSystems,PWSPublishingCompany,Boston,MA,1996.
36. E.C.Sewell,\Animprovedalgorithmforexactgraphcoloring,"in[26],359{373.
37. R.P.Stanley, \Acyclicorientationsofgraphs,"Discrete Mathematics 5(1973),171{178.