University of Alberta



Similar documents
Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Tetris is Hard: An Introduction to P vs NP

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

CoNP and Function Problems

Lecture 2: Complexity Theory Review and Interactive Proofs

Computational complexity theory

Introduction to Logic in Computer Science: Autumn 2006

Tutorial 8. NP-Complete Problems

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

Reductions & NP-completeness as part of Foundations of Computer Science undergraduate course

Subgraph Patterns: Network Motifs and Graphlets. Pedro Ribeiro

Welcome to... Problem Analysis and Complexity Theory , 3 VU

P versus NP, and More

Overview: Section A: Business Environment Employment and Unemployment Numbers and Rates. 2. Industry s Growth. 3. Facts, Trends and Outlook

Guessing Game: NP-Complete?

Open Problems in Quantum Information Processing. John Watrous Department of Computer Science University of Calgary

Network Algorithms for Homeland Security

! X is a set of strings. ! Instance: string s. ! Algorithm A solves problem X: A(s) = yes iff s! X.

Performance Analysis of a Telephone System with both Patient and Impatient Customers

CAD Algorithms. P and NP

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

Motion. Complete Table 1. Record all data to three decimal places (e.g., or or 0.000). Do not include units in your answer.

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

Page 1/.. USA / Canada - South Africa Schedule No. 4 / 2011-Jan-24

A Performance Comparison of Five Algorithms for Graph Isomorphism

The Binary Blocking Flow Algorithm. Andrew V. Goldberg Microsoft Research Silicon Valley goldberg/

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

Introduced by Stuart Kauffman (ca. 1986) as a tunable family of fitness landscapes.

On Network Tools for Network Motif Finding: A Survey Study

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Quantum Monte Carlo and the negative sign problem

Data Integration. Lectures 16 & 17. ECS289A, WQ03, Filkov

Complexity Classes P and NP

On Matroid Representability and Minor Problems

Statistical Databases and Registers with some datamining

Model Selection. Introduction. Model Selection

A Brief Survey on Anonymization Techniques for Privacy Preserving Publishing of Social Network Data

Community Detection Proseminar - Elementary Data Mining Techniques by Simon Grätzer

Calculator Notes for the TI-Nspire and TI-Nspire CAS

Form B Confirmation of Registration-Reinstatement of Interest Free Status for Alberta Student Loans

The Health Information Act. Use and Disclosure of Health Information for Research

Cryptography and Network Security Number Theory

timeout StoR!msg0 RtoS?ack0

Complex Networks Analysis: Clustering Methods

CHANCES AND RISKS FOR SECURITY IN MULTICORE PROCESSORS

Overview: Section A: Business Environment Employment and Unemployment Numbers and Rates. 2. Industry s Growth. 3. Facts, Trends and Outlook

Random Testing: The Best Coverage Technique - An Empirical Proof

How To Get A Computer Science Degree At Appalachian State

Data Mining Cluster Analysis: Basic Concepts and Algorithms. Lecture Notes for Chapter 8. Introduction to Data Mining

Chapter 8: Installing Linux The Complete Guide To Linux System Administration Modified by M. L. Malone, 11/05

Consistent Query Answering in Databases Under Cardinality-Based Repair Semantics

Algorithm Design and Analysis

Graph Theory Lecture 3: Sum of Degrees Formulas, Planar Graphs, and Euler s Theorem Spring 2014 Morgan Schreffler Office: POT 902

Updating Action Domain Descriptions

Atlantic Provinces 71 COMMUNITIES

Mining Social-Network Graphs

Going Big in Data Dimensionality:

Social Network Mining

Data Integration: A Theoretical Perspective

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

The Binary Blocking Flow Algorithm. Andrew V. Goldberg Microsoft Research Silicon Valley goldberg/

Cloud Computing is NP-Complete

Private Approximation of Clustering and Vertex Cover

Sandy Campbell, Diane Clark, and Allison Sivak University of Alberta Libraries Edmonton, Alberta, Canada

A Partition-Based Efficient Algorithm for Large Scale. Multiple-Strings Matching

Sample Questions for Mastery #5

Destination Marketing Program Overview

Proofs that Yield Nothing But Their Validity All Languages in NP Have Zero-Knowledge Proof Systems

Outline. Introduction Linear Search. Transpose sequential search Interpolation search Binary search Fibonacci search Other search techniques

Sample Questions Csci 1112 A. Bellaachia

The Assignment Problem and the Hungarian Method

Pennies and Blood. Mike Bomar

DESIGN AND ANALYSIS OF ALGORITHMS

Peter Godor MN, NP ICU NP Royal Alexandra Hospital, Edmonton, AB. DYNAMICS 2010: Edmonton, AB September, 2010

SOLUTIONS: 4.1 Probability Distributions and 4.2 Binomial Distributions

VIC Delegate Registration. An Invitation to Alberta Visitor Information Providers (AVIPs)

THE P VERSUS NP PROBLEM

OHJ-2306 Introduction to Theoretical Computer Science, Fall

A Working Knowledge of Computational Complexity for an Optimizer

Now we begin our discussion of exploratory data analysis.

Peer-to-Peer Networks 02: Napster & Gnutella. Christian Schindelhauer Technical Faculty Computer-Networks and Telematics University of Freiburg

Characteristics of Binomial Distributions

Using Data Mining for Mobile Communication Clustering and Characterization

2015 Budget Engagement. Building Awareness. Overview

Cycles and clique-minors in expanders

A Survey of Zero-Knowledge Proofs with Applications to Cryptography

4 Role Classification

Identifying Audience Preferences in Legal and Social Domains

Out-of-Scope Health Care Spending Account (HCSA)

Reducing Natural Hazard Risks in New Residential Developments

Transcription:

TheGraphIsomorphismProblem University of Alberta ScottFortin by TechnicalReportTR96{20 July1996 DEPARTMENT OF COMPUTING SCIENCE The University of Alberta Edmonton, Alberta, Canada

theory,canbebroughttobearontheproblem,andyetonlyforspecial piesararepositionintheworldofcomplexitytheory,itisclearlyinnp butisnotknowntobeinpanditisnotknowntobenp-complete. Manysub-disciplinesofmathematics,suchastopologytheoryandgroup graphsthatlookdierentlyareactuallythesame.theproblemoccu- classesofgraphshavepolynomial-timealgorithmsbeendiscovered.incongruently,thisproblemseemsveryeasyinpractice.itisalmostalways Abstract Thegraphisomorphismproblemcanbeeasilystated:checktoseeiftwo Thispaperismostlyasurveyofrelatedworkinthegraphisomorphism implementationsexistsforapplicationdomainssuchasimageprocessing. trivialtochecktworandomgraphsforisomorphism,andfasthardware eld.weexaminetheproblemfrommanyangles,mirroringthemultifacetednatureoftheliterature.wesurveycomplexityresultsforthe haveconstantsthataresolargeastonegatetheirusefulnessinactual whichhaveknownpolynomial-timealgorithms.manyofthesealgorithms graphisomorphismproblem,anddiscusssomeoftheclassesofgraphs 1Introduction somegraphswhichare\hard"forpracticalalgorithms,andpresentexperimentalresultswhichdemonstrateaclassofgraphsonwhichpractical applications.thusanumberofpracticaltechniques,whichdonothavea algorithmsrunintodiculty. polynomialworstcase,arealsoexamined.weendthepaperbydiscussing doesthereexista1-to-1mappingoftheverticesinonegraphtotheverticesof theothersuchthatadjacencyispreserved?insymbols,giveng1andg2,does GraphIsomorphismDisease"[29].Workhascontinuedunabatedonthegraph isomorphismproblemhowever,duetothemanypracticalapplicationsofthe subject,somuchinfactthatin1977readandcorneilchristenedit\the problem,anditsuniquecomplexityproperties. Thegraphisomorphismproblemhasalonghistoryintheeldsofmathematics, thereexistanfsuchthat8a;b2v1;(a;b)2e1()(f(a);f(b))2e2.the chemistry,andcomputingscience.muchresearchhasbeendevotedtothis graphsinfigure1areexamplesofisomorphicgraphs. Thegraphisomorphismproblemcanbesimplystated:giventwographs, withintheconventionalcomplexityclasses,hasledtomanyresearchpapers;in FactoringisanotherproblemwhichisnotthoughttobeinPorNP-complete, isomorphism.thisambiguity,abouttheexactlocationofgraphisomorphism Section2wesurveysomeoftheseresults. howeverfactoringisknowntobeinco-np,whichisnotthecasewithgraph problemisknowntobeinnp,butisnotknowntobeinpornp-complete. knowinwhichcomplexityclasstheproblemlies.somewhatsurprisingly,the Asarstattemptatunderstandinggraphisomorphism,wemaywishto 1

isomorphismdiscusshowtobuildfast,practical,isomorphismcheckers.some systemtoquicklygiveeachgraphauniquename.thusmanypapersongraph routinelydealwithgraphswhichrepresentmolecularlinks,andwouldlikesome tionswhichdesireafastisomorphismalgorithm.forexample,organicchemists enoughtojustifyitsstudy,itturnsoutthattherearemanypracticalapplica- Whilethepositionofgraphisomorphismincomplexityanalysisismorethan Figure1:Isomorphicgraphs ofverticesanedgewithxedprobabilityp,arealmostalwayseasytosolveby Findinggraphswhichare\hard"forthestrongestpracticalalgorithmsisa non-trivialtask.graphswhicharerandomlygenerated,bymakingeachpair provablypolynomialworstcase,thesignicanceofthisfactisnotentirelyclear. asimplebacktrackroutinewithaverynaiveheuristic[16].insection4we worstcase.insection3weexamineindetailsomeofthepracticalresults. classofgraphs,butmostpracticalalgorithmsdonothaveapolynomialtime oftheseroutinescomefromspecialpolynomial-timealgorithmsforarestricted discusstheproblemofndinghardgraphsfortheisomorphismproblem,and giveexperimentalresultswhichdemonstrateaclassofdicultgraphs. Althoughnopracticalalgorithmwhichcanbeappliedtoallgraphshasa f(a)=aforalla2v.anautomorphismpartitionofagraphgisasequence theoreticconceptscannotbeavoided,andwegiveabriefsummaryhere.an ofdisjointsubsetsv1;:::;vk,suchthatforallpairsofverticesa;b2vithere copiesofg;i.e.itisamappingfbetweenpairsofverticessuchthat(a;b)2 existsanautomorphismwheref(a)=b1.thustheautomorphismpartition E()(f(a);f(b))2E.Atrivialautomorphismisanautomorphismwhere automorphismofagraphgcanbedenedasanisomorphismbetweentwo theorythatunderliesmanygraphisomorphismresults.however,somegroup Forthemostpart,wetrytohidethereaderfromthecomplicatedgroup dividesvintosetsconsistingofalltheverticesthatcanbemappedontoone another. 1Alternatively,wecouldsaythatViistheorbitofaintheautomorphismgroupofG. 2

notknowntobeineitherpornp-complete;further,giisnotknowntobein 2ComplexityResults worldofcomplexityanalysis.itisoneofthefewproblemswhichisinnpbutis atelyexponentialalgorithmforsolvingtheproblem[3].moderatelyexponen- tialmeansthatonaproblemofsizen,therunningtimetobeystherelation: problems. co-np.itiswellknownthatifp6=npthenthereexistsproblemswhichareof Thegraphisomorphismproblem(GI)occupiesanimportantpositioninthe nk<t<an,wherek;a>1arearbitraryrealnumbers.typicallythismeansthe intermediatestatus,andithasbeenhypothesizedthatgimaybeoneofthese exponentintherunningtimeisafunctionofnwhichgrowsslowerthann.for example,theoneupperboundforgeneralgraphisomorphismisexp(n1=2+o(1)) [24]Ḃabia,Erdos,andSelkowsshowedthatforalmostallgraphsX,isomorphism toanyothergraphycouldbecomputedinquadratictime[5].aswell,ithas OneearlyresultonthecomplexityofGIshowedthatthereisamoder- theoryproblems,namelyrandomgraphs,theisomorphismproblemisnotvery dicult. isomorphism[6].theseresultsshowthatunderametricappliedtoothergraph beenshownthatthereisalinearexpectedtimealgorithmforsolvinggraph determineclassesofgraphssuchthattheisomorphismproblemisinpwhen locationofgiinthesenewcomplexityclasses.athirdapproachistotryto eralizethenotionofnpintomoreesotericnotionsofcomplexity,andstudythe restrictedtographsofthattype. proachistodeneitasbeingitsowncomplexityclass,isomorphism-complete, andseewhichotherproblemsfallwithinitsclass.anotherapproachistogensearchershavetakenotherapproachestodeterminingitscomplexity.oneap- SinceGIhasresistedeortstoclassifyitineitherPorNP-complete,re- ofisomorphismsbetweentwographsisisomorphism-complete.thisresultis togi.mostsignicantly,heshowedthattheproblemofcountingthenumber 2.1IsomorphismComplete Mathon[25]showedthatanumberofproblemsarepolynomiallyequivalent problems.indeedevenforsomeproblemsinp,thecountingversionis(conjecturedtobe)muchharderthanthedecisionproblem. theproblemofdeterminingtheautomorphismpartitionofagraph.thegraph automorphismdecisionproblem(ga),whichasksifthereexistsanon-trivial numberofnon-trivialautomorphismsofagraph,whichisinturnequivalentto problems.heshowedthatgiisequivalenttotheproblemofcountingthe MathonalsodemonstratedtheclosetiesbetweenGIandautomorphism versionsofnp-completeproblemsaremuchharderthantheirrelateddecision furtherevidencethatgiisnotnp-complete,sinceitseemsthatthecounting 3

graphs,transitivelyorientablegraphs[10],andregulargraphs[9].theseresultsarenotterriblysurprisingsincemanyofthesegraphclassesexhibitalarge reductionintheotherdirectionisknowntoexist. phismproblemconnedtoanyofthefollowingtypesofgraphsisisomorphism- allyequivalenttogi.wesimplylist,withoutproof,thatthegraphisomor- Thetermequalityproblemwasalsoshowntobeisomorphism-completeby Manyrestrictedisomorphismproblemsarealsoknowntobepolynomicomplete:bipartitegraphs,linegraphs,rootedacyclicdigraphs[2],chordal automorphism,isaninterestingexception;whilegaisreducibletogi,nosuch dicult(seesection4). amountofregularity,whichisoneofthefactorsthatmakesgraphisomorphism Basin[7].Inthisproblem,wearegiventwotermswhichcanhavefunctions whichareassociative,commutative,orboth,andcanhavecommutativevariable itdoesnotoccurnaturallyasagraphtheoreticproblem.itlendscredenceto thenotionofisomorphism-completeasaseparateandusefulcomplexityclass. 2.2GeneralizationsofNP NPistypicallycharacterizedasthoseproblemswherethereisapolynomially problemisdierentfromthepreviousisomorphism-completeproblems,inthat bindingoperators.wethenmustdecideifthetwotermsareequal;aspecial checkableproofcerticate.itcanalsobethoughtofasaninteractionbetween caseofthisproblemisdecidingiftwopredicatecalculustermsareequal.this twoparticipants,anall-powerfulproverandaverier.theproverlooksatthe putstheverieracceptspositiveinstanceswithprobability3/4,andaccepts input,andcomputesaproofcerticatewhichhesendstotheverier;theverier thenchecksthecerticateinpolynomialtimeandeitheracceptsorrejectsthe input.pcanbethoughtofasthoseproblemswherethereisnocommunication accesstoastreamofprivaterandomnumbersandonlyrequirethatoverallin- betweentheproverandtheverier.aswell,welettheproverandverierhave negativeinstanceswithprobability1/4.ipisknowntobeequaltopspace, andisthusnotveryinteresting.howeverifwerestrictthenumberofmessages sages(forp)or1message(fornp),weallowapolynomialnumberofmessages toaconstantk,wegettheclassip(k),whichisknowntobeequaltoip(2)for allk>1andisnotknown(andbelievednot)tobeequaltopspace.inthis TheclassIPisageneralizationoftheabovescenario.Insteadofnomes- Goldwasser,Micali,andRacko[19]thatthegraphnon-isomorphismproblem isinip(1)andhencegiisinip(2).muchmoresurprisingistheresultof acceptingnegativeinstances0. wheretheprobabilityofacceptingpostiveinstancesis1andtheprobabilityof IP(2).NotethatPandNParespecialcasesofIP(0)andIP(1)respectively, notationwethushavethreeclasseswhichmaynotbeequal,ip(0),ip(1),and Comingbacktographisomorphism,wehavethatsinceGIisinNP,GI 4

proofthatgi2ip(2) anddemonstratesthebasicideaofaninteractiveproof: (whichisnotknowntobeinnp)isinip(2).thealgorithmisquitesimple, 3.I 6.ifa=iandb=jtheverieraccepts,otherwiseitrejects 5.theproverreturns2numbersi;jsuchthatGiisisomorphictoI, 4.theveriersendsI;Jtotheproverinparallel 2.theverierpicks(atrandom)a;b2f1;2g 1.lettheinputgraphsbeG1andG2 alwaysaccept.iftheyareisomorphic,theproverhasnowayto knowwhichgraphiwasderivedfrom,andsowithprobability1/2 IfG1andG2arenotisomorphic,thenclearlytheverierwill andgjisisomorphictoj someisomorphismofga,j someisomorphismofgb complete,givesacomplexitydiagramlikethatoffigure2.thissignicance ofthisclassicationisnotsolelytheincreasedperspectiveitgivesonthegi problem,butithasalsobeenusedtogivestrongevidencethatgiisnotnpcomplete. Thisresult,combinedwiththelackofresultsplacingGIinPorNP- probability1/2thatj6=b.thusifg1andg2areisomorphic,the itwillreturnisuchthati6=a.similarlyforgraphj,thereis verieracceptswithprobability1=4.2 IP[2] PSPACE PH1PH2:::,basedonexistentialquantiers,universalquantiers,and Thepolynomialhierarchy(PH)isahierarchyofcomplexityclassesPH0 Figure2:ComplexityofGIandGI 5 NP-complete co-np co-np-complete NP P

andzachos[11]andschoning[31]prove(indierentways)thismainresultof graphisomorphismstructuralcomplexity: andph1=np.wewillnotdiscussthedetailsofph,excepttosaythatitis generallybelievedtobeaproperhierarchy[23].thatistosay,itisbelieved theredoesnotexistanisuchthatforji,phi=phj.boppana,hastad polynomialtimealgorithms.ittooisageneralizationofnp,i.e.ph0=p IfthegraphisomorphismproblemisNP-complete,thepolynomial inagraphwithaspeciallabelededge.ahighleveldescriptionofthealgorithm thepaper,giisreducedtotheproblemofndingthenumberofautomorphisms 2.3GraphswhereGIisinP TherstmajorresultinthiseldwasapaperbyLuksin1978[24].Heshowed thatforgraphswhichhaveboundeddegree(i.e.themaximumdegreesome constantk),thereexistsapolynomialtimealgorithmtocheckisomorphism.in hierarchycollapsestoph2=ip(2) intox1;:::;xn?1wherexiistheinducedsubgraphonthoseverticeswhich proceedsinthreesteps.firstanedgeeischosen,andthegraphispartitioned andluksclaimsthatusingmoresophisticatedtechniquestherunningtimeis stepisalwayspossibleandrunsinpolynomialtime.thealgorithmpresented inthepaperwasnotmeanttogiveatightupperboundontherunningtime, ino(ncklogk),wherec>1isaconstantandkisthemaximumdegree.itis forallgroups.usingpowerfulideasfromgrouptheory,luksprovedthateach itssetofneighboursinxi+1,andverticeswiththesamemappingaregrouped together.finallyeachofthesegroupsisdecomposedintoprimitivegroups wherethenumberofautomorphismsisknown,andthesenumbersaresummed areistepsorfewerawayfrome.next,ineveryxi,eachvertexismappedto clearthatevenifthemaximumdegreeisonly10,thistechniquedoesnotyield apracticalalgorithm. inpolynomialtime.thisalgorithmisnotverypractical,asitsrunningtimeis phism,onesuchpropertyisthegenusofagraph.ifwewishtodraw(more isdenedasasequenceofnumbersg1;g2;:::suchthatgiisthenumberofways wexk,thenthosegraphswhichhavegk>0canbecheckedforisomorphism commonlyembed)agraphonsomesurfacesuchthatnotwolinescross,wemay todrawagraphonasurfaceofgenusi.filottiandmayer[18]showthatif needasurfacewithafairlycomplicatedstructure.thegenusisameasureof howcomplicatedsuchasurfacemustbe;andthegenusdistributionofagraph Othergraphpropertieshavebeenstudiedwithrespecttographisomor- constantinthisalgorithmis(512k3)!whichisverylargenomatterwhatthe O(nck)wherec>300isaconstant.Chenobtainsabetterresult[13],showing thatifyoutaketheaverageofthegi's,andrequirethattobeboundedbya valueofk.planargraphsareinsomesenseaspecialcaseofthisresult,asthey constantk,thenthereisalineartimeisomorphismtest.however,thehidden 6

isomorphisminlineartime,althoughtheiralgorithmalsohasalargeconstant whichmakesitunsuitableinpractice. rstshownbyhopcroftandwong[20]thatplanargraphscouldbecheckedfor canbedrawnonaplane(orasphere)andhencehavegk>0forallk1.itwas thesegraphs,wheremisthenumberofedges,andnisthenumberofvertices. Thisresultisinterestinginthatitdoesnotrequiresomeexplicitparameterto beconstant,andseemstoapplytoalargeandpracticalgroupofgraphs. Hsu[21]hasshownthatthereisaO(mn)algorithmfortestingisomorphismof andjoiningtwoverticesiftheirarcsoverlap;asubclassofcirculararcgraphs createdbydrawinganumberofarcsonacircle,creatingavertexforeacharc, istheintervalgraphs,whereour\arcs"areconnedtotherealnumberline. circular-arcgraphs[21].circulararcgraphsarethosegraphswhichcanbe AnotherlargeclassofgraphsoverwhichGIcanbesolvedecientlyisthe phismcanbesolvedinpolynomialtime.forexample,cogisandguinaldo isomorphismproblemswhichareinp. permutationgraphs[15],chordal(6,3)graphs[4]andpartialk-trees[8]allhave techniqueforknowledgerepresentation.othergraphclassessuchastrees[2], [14]showthatisomorphismforconceptualgraphswhichhavealinearorderingfunctioncanbesolvedinpolynomialtime.Thisisparticularlyofinterest tothearticialintelligencecommunity,whereconceptualgraphsareusedasa Theseresultstakentogetherprovideaninterestingcounterpointtothediscussionofrandomgraphs.Itseemsthattheisomorphismproblemiseasyfor graphswhicharenotrelatedinanyway(randomgraphs)andforgraphswhich exploredmorefullyinsection4. 3PracticalIsomorphismAlgorithms Oneofthefactorscontributingtothelargeamountofworkonthegraphisomor- approachistotakethetwographswhicharetobecompared,andtrytodi- considered. rectlyndanisomorphismbetweenthem.thishastheadvantagethatifthere phismproblemisundoubtablythemanypracticalapplicationsofthetechnique. Therearetwobroadapproachestosolvingtheisomorphismproblem.Therst tionc(g)whichreturnsacanonicallabel;whereacanonicallabelmeansthat aremanyisomorphismsbetweentwographs,thenonlytherstoneneedbe theisomorphismproblem,butispossiblyofindependentinterest.forexample, C(G)=C(H)iGandHareisomorphic.Suchalabelingnotonlysolves organicchemiststypicallydealwith\graphs"suchastheoneiffigure3.itisa fundamentalproblemintheworldofchemicaldocumentationtogiveeachsuch structureauniquename. ThesecondapproachistotakeasinglegraphGandcomputesomefunc- Thereareseveralotherrestrictedclassesofgraphsforwhichgraphisomor- arestructurallyrelated(circulararcgraphsforexample).thisnotionwillbe 7

H H O werepresentgraphsbyanadjacencymatrixm,wheremij=1if(i;j)isan Figure3:Atypicalorganicchemistrygraph C C H C C C C C C H inpractice. edge,and0otherwise.wecanconstructalabelforgbyconcatenatingthe isisomorphism-complete,sothismethodhastobeslightlymodiedtobeused labelforgbylookingatthelabel(asdenedabove)ofeveryautomorphismof G,andreturningthesmallestone.OfcoursendingeveryautomorphismofG rowsofmtoformannbinarynumber.wecanthencomputeacanonical Itisnothardtodescribeanaivecanonicallabelingsystem.Supposethat C C O vertexinvariantswhichareanimportantpracticaltoolinsolvingisomorphism traditionalandspecialcaseapproachestographisomorphism.wethenlookat Therestofthissectionisorganizedasfollows.Werstbrieylookatnon- H H 3.1Non-traditionalApproachestoGI Therehasbeensomeworkonnon-traditionalapproachestothegraphisomorphism.McGregor[26]discussesusingarcandpathconsistencyalgorithmson problems,andnallywelookatalgorithmsforsolvingthegraphisomorphism problemusingeachofthetwoapproachesoutlinedabove. isomorphismproblemcouldverypossiblybeinp.theresultsofthepaper previous(relativelysimple)backtrackingalgorithms. seemtottheintuitivenotions,whereonlyaslightincreasewasobservedover astheconstraintsatisfactionproblemisknowntobenp-hard,andthegraph tunedconstraintalgorithms.thisapproachdoesnotseemintuitivelyinviting, phismproblemintoaconstraintsatisfactionproblem,andthenusesspecially theisomorphismproblem.thealgorithminthepaperconvertsagraphisomor- Agusa,Fujita,Yamashita,andAe[1]presentaHopeldnetworkforsolving 8

ting.thereasonforthisisthefactthatthemodelrestrictsthemaximum numberofverticesallowedinagraphto12.clearlythispaperprovesthat howeverthisapproachcertainlycannotbeusedunmodiedinapracticalset- neuralnetworksolutionstotheisomorphismproblems(forsmallgraphs)do exist,althoughitseemstodolittletoadvancethetheoryorpracticeofgraph result.inpractice,wemaybewillingtolivewithasmalldegreeofuncertainty, isomorphismproblems.itisuncleartowhatproblemdomainthistypeofsolutionissuited.theoretically,thisapproachcannotproveapolynomialworst case,sinceitisnotpossibletoguaranteethatitwillalwaysreturnthecorrect isomorphism. bydemarchi,masera,andpiccinin[17],whoimplementedplanarisomorphism bygivingafast,parallelplanarisomorphismalgorithm[22].giventhereal timeconstraintsofimageprocessing,thisalgorithmwastakenonestepfurther AswediscussedinSection2,HopcroftandWongshowedplanarisomorphism checkingcanbesolvedinlineartime[20].jajaandkosarajuextendthisresult planargraphswhichrepresenttheinterrelationshipsbetweenobjectsinascene. checkinginavlsiprocessorarray.whiletheseresultshavelittlebearing isomorphismchecking.thegraphswhichariseinthisapplicationdomainare Imageprocessingrankswithchemistryasalargeapplicationdomainfor ontheisomorphismproblemasawhole,theydoshowthatsomepractical implementationshavebecomeveryecient. 3.2VertexInvariants someisomorphism,thencertainlytheymusthavethesamedegree.notethat Oneverypracticaltechnique,whichisindependentofthealgorithmusedto notnecessarilyanisomorphismwhichmapsthetwoverticesontooneanother. avertexinvariantisthedegreeofavertex:ifvandv0maptoeachotherunder theconversedoesnothold,iftwoverticeshavethesamedegree,thenthereis Infact,ifthereisapolynomiallycomputablevertexinvariantforwhichthe someisomorphismthatmapsvontov0theni(v)=i(v0).thetypicalexampleof actuallysolvetheisomorphismproblem,istheuseofvertexinvariants.a problem. vertexinvariantissomenumberi(v)assignedtoavertexsuchthatifthereis conversedoeshold,thenthereisapolynomialtimesolutiontotheisomorphism adjacencytriangles Belowwelistsomeinvariantswhicharepresentinanisomorphismprogram twopaths callednauty[27]. Therearemanyvertexinvariantswhichhavebeenproposedintheliterature. 2assignanumbertovbasedonthesizeofthecommonneighbourhoodof assignanumbertovbasedontheverticesreachablealongapathoflength 9

k-cliques independentk-sets thoseneighboursofvwhoareadjacent distances assignanumbertovbasedonthenumberofdierentcliquesofsizek ofsizekthatcontainv assignanumbertovbasedonthenumberofdierentindependentssets space.morepractically,vertexinvariantsaretypicallyusedbycombiningthe showthatusingvertexinvariantsmaynotresultinanydecreaseofthesearch resultsofmanyinvariants.forexample,ifavertexhasdegree3,isin2cliquesof size4,andcanreach9verticesonpathsoflength2,thenacompositeinvariant mightbe329.infact,thisabilitytocomposeinvariantshasledtothecase Theuseofinvariantsissomethingofablackart.CorneilandKirkpatrick[16] assignanumbertovbasedonthenumberofverticesateachdistance wherepracticalalgorithmsalwaysusedegreeasthe\base"invariant,andother 1;:::;nfromv thebestforaparticulargraph.instead,whatistypicallydoneistoleavethe decisionofifandwhentouseavertexinvariantuptotheuser(exceptfordegree variantsgetappendedtothebase.theseotherinvariants,whiletheycanbe invariants[27],anditisverydiculttodeterminewhich(ifany)invariantis whichisalwaysused).thisassumesthatiftheuserhappenstocomeacross computedinpolynomialtime2,canbequiteexpensivetocalculate,compared degreeinvariantissucientformostgraphsencounteredinpractice,andthe anumberofveryhardgraphs,hewouldthentakethetimetoexperimentally determinewhatinvarianttouse.anotherwayofjustifyingthis,isthatthe canbedirectlysolvedinlesstimethanittakestocalculatethemorepowerful tothetotalexecutiontime.itturnsoutthatmanyisomorphismproblems Perhapsthemostnaturalwaytotryandsolvethegraphisomorphismproblem istotryanddirectlydiscoveramappingbetweentheverticesoftwographsg1 3.3SolvingtheIsomorphismProblemDirectly useronlyhastointerveneifthegraphhasaveryregularstructure. areclearlynotofpracticaluse [30].WestartbydeningG1(k)asthesubgraphofG1inducedonthevertices andg2.thealgorithmpresentedinthissectionisanadaptationoftheonein 1;:::;k.ThebasicideaistobuildanisomorphismfromG1(k)toasubgraph anunusedvertexofg2. ofg2,andattempttoextendthistoanisomorphismong1(k+1)byadding 2Actuallyinvariantshavebeenproposedwhichdonotruninpolynomiallytime,butthey 10

Themainroutineofthealgorithmlookssomethinglike: ProcedureMain: Output:arrayfsuchthati!fiisanisomorphismbetweenG1andG2, Input:graphsG1andG2 fori ornoneifnosuchfexists inv1i 1;:::;ndo elsereturnnone ifisomorph(emptyset,1,f)then reordertheverticesofg1(andreorderinv1aswell) endfor ifinv1sortedinascendingorder6=inv2sortedinascendingorder returnf inv2i somevertexinvariantonthei-thvertexofg1 somevertexinvariantonthei-thvertexofg2 optimizationistoreordertheverticesofg1,withthehopethattherewillnotbe methodsmaybeused,forexampletheverticesing1maybesimplysorted used.thecalculationofinv1andinv2allowsustorejectmanynon-isomorphic manyverticesing2thatcanmaptotherstfewverticesg1.severalordering graphs,providingourchosenvertexinvariantispowerfulenough.thesecond basedonthenumberofverticeswhichshareacommoninvariantvalue(the ischosenandadepth-rstsearchrootedatthatvertexisusedtore-orderthe invariantmultiplicity),orperhapsavertexwithminimuminvariantmultiplicity Wecanseethatthisisoneoftheplacesinthealgorithmwhereheuristicsare vertices.thesimplesortensuresusthatasweenlargetheisomorphismthere ofg2inducedbyscanbeextendedtoacompleteisomorphismong1andg2. depthrstsearchapproachisattractiveinthatadjacentverticesareplacednear input.itreturnstrueiftheisomorphismbetweeng1(k?1)andthesubgraph isaminimumnumberofcandidatestoextendthesolutionateachstep.the oneanother,andthuswewouldhopethatifwemakinganincorrectmapping decision,wewouldquicklygetacontradiction. TheISOMORPHproceduretakesasetS,andnumberk,andanarrayfas ProcedureISOMORPH: Input:setS,integerk,andanarrayf Output:TRUEiffcanbeextendedtotheentireinputgraphs ifk=n+1thenreturntrue foreachj2(v2=s) ifisomorph(k+1;s[fjg)then if(inv1k6=inv2j)_:canmatch(k;j;f) gotonextloopiteration j 11

therealreadyexistsanisomorphismbetweentherstkverticesofg1and theunmappedverticesing2andtriestomapthemtothenextvertexing1.it theverticesins.ifithasalreadymappedallpossibleverticesitimmediately returnstrue,andanisomorphismfhasbeenfound.otherwise,itlooksatall Itisnottoohardtoseewhatthisroutineisdoing.Whenitiscalled, endfor returnfalse returntrue usesthevertexinvariantheuristicsothatitwillnevertryamappingwherethe invariants,inwhichcasewecouldusethepartialmappingftohelpuscreate shownasacachedvalueonthisexample,itispossibletodynamicallycalculate invariantisdierent.thisisthemeansbywhichmuchofthesearchtreecanbe amorediscriminatinginvariant. pruned,providedwehaveagoodinvariant.notethatalthoughthisinvariantis Inthissectionwepresentacanonicallabelingalgorithm,whichisactuallyahigh secondone. 3.4DeterminingaCanonicalLabeling andcheckingthe(i;k)isanedgeoftherstgraphi(fi;j)isanedgeinthe simplyscanningtheisomorphismalreadydiscovered(whichiscontainedinf) thegivenmappingwouldnotconictwithpreviousmappings.thisworksby TheonlyfunctionlefttodescribeisCANMATCH,whichreturnstrueif leveldescriptionofthealgorithmpresentedbymckaycallednauty[28,27]. Thisisaverypowerfulalgorithm,andiscurrentlythepreferredmethodfor solvingthegraphisomorphismproblem.thereasonthismethodoutperforms (ingeneral)thealgorithmintheprevioussection,isthatbyconcentratingon broughttobearontheproblem,signicantlydecreasingtherunningtime.as onegraphatatime,powerfulideasfromtherealmofgrouptheorycanbe well,thisalgorithmprovidesmoreinformationthanthepreviousalgorithm, Centraltotheoperationofnautyistheideaofanorderedpartition.Apartition listing(forexample)alloftheautomorphismsofagraph. dividestheverticesofagraphintonon-empty,disjointsubsetsofv(called readerto[28]formoredetails. Partitions reader.insteadwewillconcentrateonthemainideas,andrefertheinterested itwouldrequirealargeamountofgrouptheorybackgroundonthepartofthe Wewillnotgiveasdetailedanalgorithmasthatintheprevioussection,as theirroleasleavesofthesearchtree cells):v1;v2;:::;vm.apartitionwithonlysingletonsets,willbecalleda leafpartition3.akeypointisthatwhenwendaleafpartition,itdenesa 3Innautythesearereferredtoasdiscretepartitions,howeverthetermleafpartitionhilights 12

relabelingofthegraphwherethevertexincellvigetsrelabeledtoi. b a c a b c c a b 0 0 1 a c a c b c a 0 1 0 b aregivenfortheverticesinthegraph,andassociatedwitheachpartitionis b 1 0 1 a 0 0 1 theadjacentmatrixwheretheorderoftheverticesintherowsandcolumns c b 1 1 0 correspondstotheorderoftheverticesinthepartitions.automorphismsare 0 1 0 recognizedbyndingtwodistinctleafpartitionswhich(afterrelabeling)give andthusdeneanautomorphism. risetothesamegraph.intheexamplejcjajbjandjajcjbjgivethesamematrices Forexample,considerthegraphinFigure4.Threedierentleafpartitions Figure4:Discoveringanautomorphismbycomparingleafpartitions a c b discovered automorphism c -> a, a -> c, b -> b a 0 0 1 a c b invariantscanbeused.theinvariantiscomputedforeachvertexovertheentire partitionandgeneratingthechildrenofapartition.renementiswherevertex c 0 0 1 graphtocreateaninitialpartition,andthentheinvariantrestrictedtothecells Therearetwomajoroperationsthatnautyperformsonpartitions,reninga b 1 1 0 returnsthenumberofneighboursofvthatareinthesets.wecouldthen ofthepartitiontotrytofurtherdistinguishthem.forexampleassumed(v;s) denearenementoperationas: 1) 2)selectaVi2suchthatVihasmorethanoneelement 3)foreachv2Vi,computeasequenceav=(d(v;V1);:::;d(v;Vm)) theinitialpartitionv1;:::;vmwhereforallverticesx;y2vi wehaved(x;v)=d(y;v) 13

Inactuality,wedonotjustselectasingleVibutstartingatV1weloopthrough allthevi(includingonescreatedafterasplit)untilwecannotsplitanymore partitionwhichisv1;:::;vi?1;fvg;vi=fvg;vi+1;:::;vm.thatistosay,we hasmorethanonemember,andthenforeachvertexv2viwecreateachild cellsẇegeneratethechildrenofapartitionbychoosingtherstcellviwhich 4)splitViintoanumberofsubsets,sotheverticesineachsubsethave createanewchildforvertexvbysplittingthecellviintotwocells,onewhich thesamevalueforav eachpartitionbeforeexpandingitschildren. rstsearchofthespaceofpartitions,withtheaddedoptimizationthatwerene operations,whichwewilltalkaboutinthenextsection.itisbasicallyadepth BasicAlgorithm Hereisthebasicalgorithmusedbynauty.Wehaveomittedsomeofthepruning containsonlyvandonewhichisviwithoutv. Output:acanonicalgraphC Input:agraphG while(sisnotempty) S thepartitioncontainingasinglecellv stackcontaining endwhile returnc if(xisaleafpartition) elserene(x) endifappendthechildrenofxtos x popthetopofthestacks update(c;x) CanonicalLabeling Conceptually,nautyexamineseveryautomorphismofagraphandcomputes willhashtodierentvalues. acanonicallabel.thislabelissimplytheadjacencymatrixofthe\smallest" automorphism.theschemeusedtodenethesmallestautomorphismanextensionoftheschemewediscussedpreviously,wheregraphsareorderedbasedon thebinarynumberthatiscreatingbyconcatenatingtherowsoftheadjacency input,andcomputesahashfunctioninthehopethatdierentautomorphism matrix.themainadditionisanindicatorfunction,whichtakesapartitionas 14

xbystartingattherootofthesearchtreeandtransversingdowntox,at eachpointtheresultoftheindicatorfunctionisusedtodeneamemberof thesequence.thusaleafpartitionisdenedassmallerthanif<4, andtheequivalentbinarynumberofeachautomorphismisusedtobreakties. McKayprovesthatacanonicallabelingdenedinthisfashionisthesamefor anytwoisomorphicgraphs[28]. posewehavesomepartitionxwhichisthesmallestpartitiondiscoveredsofar. Thusifwereachaleafpartitionxinoursearchtree,wedeneasequence Thenwecancomparesomenodevtox,andifvisbiggerwecanprunev. Bydeningtheindicatorfunctionoverallancestorsofx,wemaybeableto prunenodeswhicharenotleafnodes,sincetheymaybebiggerthantheancestorsofx.notethatifwesimplyorderautomorphismsbasedontheirbinary representation,thenwecanonlyprunenodeswhichareleafpartitions. Itiseasytoseehowthisinformationcouldbeusedtoprunethetree.Sup- iftwodierentleafpartitionresultinthesameadjacencymatrixafterrelabeling thevertices.nautystorestwographs,whichitusestocheckforautomorphisms. Thereisonlyonelastmaintechniqueemployedbynauty,therecognitionand UsingAutomorphisms Onegraphcorrespondstothe\smallest"graphfoundsofar,asdenedabove, useofautomorphisms.asmentionedearlier,nautyrecognizesanautomorphism graphiscomparedtothestoredcopies,andiftheyhaveexactlythesame andwilleventuallybecomethecanonicallabel;theothergraphcorrespondsto therstleafnodediscovered.whenanewleafnodeisreached,itsrelabeled adjacencymatrix,thenanautomorphismhasbeenfound.atthesametime, ifnautydiscoversthenewgraphissmallerthansmallestsofar,thenthenew graphbecomesthenewcanonicalgraph.notethatthiswillnotdiscoverall isatradeo morestoredgraphsmeansmorematches,butitalsomeansthe timetocheckeachgraphisincreased.inadditiontotheseautomorphisms,an automorphismcansometimebeinferredbythestructureofapartition;however automorphisms,sinceweareonlystoringtwographstocompareagainst.there thistechniqueislessimportantandwedonotdiscussitfurther. searchspace.oneusefulresultisthatifthereisanautomorphismbetweenaleaf partitionandsomestoredpartition,thennautycanjumpallthewayback another.thusisanapproximationoftheautomorphismpartition,andgets updatedwheneveranewautomorphismisfound.thesignicanceofcomes inifnautyhasdiscoveredsomeautomorphismwhichmapsthetwoontoone totherstcommonancestorofandandcontinuefromthere.additionally, nautymaintainsaspecialpartition,wheretwoverticesareinthesamecell intoplaywhenwegeneratethechildrenofsomepartition.recallthatthis Oncenautyhasfoundanautomorphism,itputsittoworktotrytoprunethe wordsareordered 4Thetwosequencesarecomparedinlexographicorder,i.e.inthesamemannerasEnglish 15

isdonebychoosingacellw2,andgeneratinganewchildforeveryelement ofw.given,wenowonlycreateachildforeachelementofwwhichisina uniquecellof.thusaswendmoreandmoreautomorphisms,lessandless childrengetexpandedfromeachnode.theproofthatthesepruningsarevalid dependsonsomefurtherideasaboutpartitionsandgrouptheory,whichwewill morphism.afundamentalweaknessoftheseapproachesisthefactthatonce grouptheoryideastohelpprunethesearchspace.insomesense,thesemantics theproblemistransformedintothatparadigm,itisnolongerpossibletouse 3.5Discussion Practicalexperienceseemstoindicatethatothergeneralparadigms,suchas constraintsatisfactionandneuralnetworks,arenotveryusefulforgraphiso- notdevelophere.theinterestedreadercansee[28]. ofthedataisbeinglostinthetranslation. itisnotdiculttospeculatewhynautydoesbetter.bothprogramsmakeuse directapproachtoisomorphism.thedierencesherearenotasconclusive,but ofvertexinvariants,nautyusestheminitsrenementprocess,andthedirectalgorithmusesthemwhendecidingwhethertoextendanisomorphism.themain dierencebetweenthetwotechniquesseemstobetheiruseofpartialresults. towork,pruningawaysectionsofthesearchtree.thuswhennautyexplores Whenevernautyndsanautomorphism,itimmediatelyputstheautomorphism aportionofthesearchtree,italwaysattemptstousetheseresults.contrast Anotherinterestingnoteisthesuccessofaprogramlikenauty,overamore thiswiththedirectscheme.supposewehaveextendedtheisomorphismtoall inthe\almostisomorphism"toprunesubsequentattempts,andthusweare isanumberoflevelsback.thereisnoattempttousetheinformationgained essentiallydiscardingtheknowledgewelearnedinthatportionofthesearch. butonevertex,andthenrealizethatwehavetobacktracktoapointwhich 4HardGraphs inrealtime.thelistofpropertiesthatour\hard"graphscannothavegoeson wonderifthishasanypracticalsignicance.putanotherway,wemaywishto knowifthereareanyreally\hard"graphs,andifthereare,getsomehandleon whatmakesthemdicult. WhilethegraphisomorphismproblemisnotknowntobeinP,onemight andon,andevenifourgraphdoesnothaveoneofthoseproperties,practical weconneourselvestorandomgraphs,thentheisomorphismproblemisalmost alwaysveryeasy.ifweinsteadfocusonplanargraphs,thereexistsaparallel hardwareimplementationthatwillndtheisomorphismsofverylargegraphs Thesearchforhardgraphsisnotatrivialone.Aswehavealreadyseen,if 16

rithmforaspecialsubclassofgraphs,itisoftennon-trivialtodetermineifan inputgraphbelongstosuchasubclass.finally,thearrayofheuristicsavailable forthealgorithmtodecideifandwhentoapplyeachone. topracticalalgorithmsisindeedlarge,butthatalsoservestomakeitnon-trivial thatmakethemprohibitiveforactualuse.further,evenifthereisafastalgo- theisomorphismproblem. rithmsthatsolveacertainclassofgraphsinpolynomialtimehaveconstants algorithmshaveadazzlingarrayofheuristicsthatcanbeusedtoquicklysolve section,andattempttondgraphswhicharediculttoprocess.ourapproach Inthissectionwelookatthenautyprogramintroducedintheprevious Practicalalgorithmsdonotgetothateasilyhowever.Manyofthealgo- asameanstopruneoutobviousnon-isomorphisms(ornon-automorphismsin isnottodirectlyconstructthesehardgraphs,butinsteadtotransformtypes nauty'scase).thustherstdecisionwecanmakeistorestrictourselvesto wheretolookforhardgraphs.aswenoted,allpracticalalgorithmsusedegree Ourpreviousdiscussionoftheisomorphismalgorithmsgivesussomehintsasto thepowerandlimitationsofpracticalgraphisomorphism. 4.1FindingHardGraphs of\easy"graphsintohardones.indoingsowegainabetterunderstandingof wishtoincreasethisnotionofregularity,byrequiringthatrangeinsizesofthe commonneighbourhoodofanytwoverticesbeverysmall. regulargraphs.agraphisregularifeveryvertexhasthesamedegree.wemay thereisnoknownalgorithmtouniformlygeneraterandomgraphswiththe withourdesiredregularityproperties. aboveproperties.instead,wehavetotrytond\naturallyoccurring"graphs lentgraphs.thesegraphsaregeneratedbycreatingmany(conceptually,in- nitelymany)ringsofregularp-gons,anddeningafunctionwhichmapsthese polygonsontooneanother{forexample,startatanyvertexandmapthethree polygonswhichshareittothethreepolygonsthatsharethevertexthatis14 Onesuchsourceofregulargraphsisthep-regularmapembeddingsoftriva- Unfortunately,oncewemakethesedecisionswereachapracticaldiculty; verticestotheright.afterperformingthismapping,eithertheringsofpolygonsremaininnite(oratleastbeyondthesizethatcanbehandledbythe computer'smemory),orallpolygonsaremappedtothesinglepolygonatthe center,orthereissomenitemapofpolygonswhichisproduced.theinterested nautycanassignthemacanonicallabel.itturnsoutthesegraphsareinsome sensetooregular,thenumberofautomorphismsisverylarge,whichcanbe readerisreferredto[12]formoredetailsonthisclassofgraphs.thelatercase exploitedtoprunethesearchspace.thekeyideainmakingthesegraphshard Oncewehavethesegraphsinhand,wecantesthoweasilyprogramslike isofparticularinteresttous,sinceitgeneratesahighlysymmetricp-regular graph. 17

theirendpoints.theedgesarechosenatrandom,butareconstrainedsothat istodecreasetheamountofself-similaritybychoosingtwoedgesandswapping whentheyareswapped,thedegreeofeachvertexdoesnotchange.asthe experimentalresultsinthenextsectionshow,doingonlyoneoftheseswapscan 4.2ExperimentalResults Fourgraphswerechosentoexaminetheeectofrandomswapsonthediculty maketheproblemseveralhundredtimesharderfornauty. ofthegraphthatresults.thegraphsareentitledv190,v348,v486,and v864,wherethenumberineachcaserepresentsthenumberofvertices.all programwrittenbyjoeculberson[12]basedontheconstructionmentionedin graphswereregulargraphswithdegree8,andwerecreatedusingagenerator theprevioussection. time vs number of swaps 3 v190 2.5 2 1.5 measurement,excepttomentionthattheywereverylowinallbutonecase, 1 whichwewilldiscussshortly. timeofnautyoverthosegraphs.wedonotexplicitlylistthevariancesforeach 10graphswiththerequirednumberofswaps,andthenaveragingtherunning 12,16,and32randomswaps.Eachmeasurementwasobtainedbycreating Figures5through8showauniformpictureoftheeectofrandomswaps. Foreachgraphwemademeasurementsfor0,1,2,3,4,5,6,7,8,10, Figure5:Resultsforv190 0.5 0 18 0 5 15 20 25 30 35 time in seconds

time vs number of swaps 30 v348 25 20 Ineachcasenautywasveryfastiftherewasnorandomswaps,andthenmuch slowerwhenrandomswapswereintroduced.further,asmoreswapswereintroduced,nautybegantodecreaseitsrunningtime. 15 10 mayexplainthelargeincreaseintimebetween0and1swaps,isthenumberof automorphismsintheresultinggraph.whentherewerenoswaps,thenumbers Figure6:Resultsforv348 ofautomorphismsofv190,v348,v486,andv864were3420,6144,7776,and 5 6912respectively.Basedonourpreviousanalysisofthenautyalgorithm,it isnothardtoimaginethattheselargegroupsizeshelpnautytoaggressively 0 prunethesearchspace.afterdoing1ormorerandomswaps,thenumberof Thereareafewplausibleexplanationsforthisbehaviour.Onefactorwhich 0 5 10 15 25 30 35 automorphismswasalmostalways1;outof520graphsthatcontainedrandom number random swaps automorphismgroupofsize2,andthesewereabletocompleteinapproximate oftheonemeasurementwithlargevariance:itcontainedtwographswithan swaps,only5hadanautomorphismgroupofsize2.infactthisisthecause 2/3theamountoftimeastheotherruns.Clearlyinthegraphswithrandom swaps,nautycannotuseautomorphismstohelpprunethesearchtree. increased,asallofthesegraphshadtheapproximatelythesamenumberof eectively.witheachrandomswapweessentially\break"thestructureofthe thegraphswithmanyswapsbecauseitisusingitsrenementproceduremore automorphisms(1or2).intuitivelywecanarguethatnautyisspeedingupon Thisdoesnotexplainthefactthetimedecreasedasthenumberofswaps 19 time in seconds

time in seconds time vs number of swaps 80 70 v486 Figure7:Resultsforv486 60 50 40 30 20 10 0 0 5 10 15 20 25 30 35 number of random swaps time in seconds time vs number of swaps 600 v864 500 Figure8:Resultsforv864 400 20 300 200 100 0 0 5 10 15 20 25 30 35 number of random swaps

manyconclusionscanbemadeabouttheseresults,excepttosaythatmore graph,andthuswithmanyswapsthenumberofbreaksincrease,andhence asitrelatedtographsize.foreachgraphweplottheblowupratior=(time withoneswap)/(timewithnoswaps).forthistestweincludedanumberof byinterlockinglatinsquaresofsize10.theresultsareshownintable1.not workisnecessarytodiscoverhowtopredicttheseratios. test.aswellweincludeagraphv900whichisa900vertexgraphgenerated graphsofvarioussize,generatedinasimilarfashionasthoseintheprevious nautyismorelikelytondandexploitoneofthose\breaks". Onenaltestweperformedwastotryandmeasuretheamountofincrease, 1908 2168 3488 4868 8648 8707 ndegreenoswaps(sec)oneswap(sec)blowupratio 0.12 0.05 0.75 1.44 1.85 7.69 549.4 595.8 29.7 78.8 2.7 3.9 297 22 40 55 Table1:Theeectofgraphparametersettingsontheblowupratio 15367 19668 11409 900683 34.60 16.50 37.46 74.72 12091 963.5 429.8 5683 152 162 78 58 12 5Conclusion ThetheoryofNP-completenesshasallowedresearcherstoconcludethatmany timesolution,ortobecontentwithalgorithmsthatmayhaveverybadworstcasebehaviour.asthelargeamountofresearchonthecomplexityofgraph seemtoguidetheresearcher.oneisunsureofwhethertosearchforapolynomial problemsareeitherpolynomiallysolvable,orareprobablyintractable.graph isomorphismshows,researchersaretryingtoremedythatproblem,believing isomorphismisoneofthefewproblemsforwhichnp-completenessdoesnot tobecompletelydetermined.insteadalargebodyofworkhasconcentrated generalproblemveryfastonaverage.whenthegraphsbeingaveragedover tionsthatthecomputingcommunityisnotcontenttowaitforitscomplexity onsolvingrestrictedversionsofgraphisomorphismveryquickly,orsolvingthe largerrealmofcomplexityanalysis. thatadeeperunderstandingofgraphisomorphismwillyieldinsightsintothe However,thegraphisomorphismproblemhassomanyinterestingapplica- 21

Howeverpracticalalgorithmsareveryfastwhenaveragedoverthenebulous aregeneratedinacompletelyrandomfashion,itistrivialtobefastonaverage. plausiblethattheymightariseinanapplicationwhereveryregulargraphsare generated,whichmighthaveasmallamountofnoise.onepointtonoteisthat rithmsndhard.grantedthatthesegraphswererathercontrived,butitseems thesearchspace. notionofrealworldgraphs,byusingpowerfulgrouptheorytoolstohelpprune evenfor\hard"instances,1000vertexgraphsweresolvedinlessthan10minutes.thisisquiteacontrastwithproblemslikegraphcoloring,were10minutes ona1000nodeproblemwouldnotbeconsideredalongtime,andmaybea furtherindicationofthe\almostpolynomial"natureofthegraphisomorphism problem. Asweshowed,itisnottoodiculttocreategraphswhichcurrentalgo- References [1]K.Agusa,S.Fujita,M.Yamashita,andT.AE.Onneuralnetworksfor graphisomorphismproblem.inthernns/ieeeconferenceonneuroinformaticsandneurocomputers,pages1142{1148,rostov-on-don,russia, [4]L.Babel.Isomorphismofchordal(6,3)graphs.Computing,54:303{306, [3]L.Babai.Moderatelyexponentialboundforgraphisomorphism.Proceed- [2]A.Aho,J.Hopcroft,andJ.Ullman.TheDesignandAnalysisofComputer ingscience117,pages34{50,1981. ingsofthefundamentalsofcomputingscience,lecturenotesincomput- Algorithms.Addison-Wesley,Reading,1974. October1992. [6]L.BabiaandL.Kucera.Canonicallabelingofgraphsinlinearaveragetime. [7]D.Basin.Atermequalityproblemequivalenttographisomorphism.InformationProcessingLetters,51:61{66,1994. [5]L.Babia,P.Erdos,andS.Selkows.Randomgraphisomorphism.SIAM InProceedingsofthe20thIEEESymposiumonFoundationsofComputing Science,pages39{46,1979. JournalofComputing,9(3):628{635,August1980. 1995. [9]K.Booth.Problemspolynomiallyequivbalenttographisomorphism.TechnicalReportCS-77-04,UniverisityofWaterloo,1979maticindexonpartialk-trees.JournalofAlgorithms,11:631{643,1990. [8]H.Bodlaender.Polynomialalgorithmsforgraphisomorphismandchro- 22

[11]R.Boppana,J.Hastad,andS.Zachos.Doesco-nphaveshortinteractive [10]K.BoothandG.Lueker.Linearalgorithmstorecognizeintervalgraphs andtestforconsectuativeonesproperty.inproceedingsofthe7thannual ACMSymposiumontheTheoryofComputing,pages255{265,May1975. [14]O.CogisandO.Guinaldo.Alineardescriptorforconceptualgraphsand [12]I.Bouwer.TheFosterCensus:R.M.Foster'sCensusofTrivalentGraphs. [13]J.Chen.Alineartimealgorithmforisomorphismofgraphswithbounded proofs?informationprocessingletters,25:27{32,1987. nationalconferenceonconceptualstructures,pages263{277,santacruz, aclassforpolynomialisomorphismtest.inproceedingsofthe3rdinter- TheoreticConceptsinComputerScience,pages103{113,1992. averagegenus.proceedingsofthe18thinternationworkshopongraph- BabbageReaserchCompany,Winnipeg,1988. [16]D.CorneilandD.Kirkpatrick.Atheoreticalanalysisofvariousheuristics [15]G.Colbourn.Ontestingisomorphismofpermutationgraphs.Networks, 11:13{21,1981. USA,August1995. [18]I.FillottiandJ.Mayer.Apolynomial-timealgorithmfordeterminingthe [17]D.Damarchi,G.Masera,andG.Piccinini.AVLSIprocessorarrayfor isomorphismofgraphsofxedgenus.inproceddingsofthe12thacm 1994. 297,May1980. graphisomorphism.internationaljournalofelectronics,76(4):655{679, forthegraphisomorphismproblem.siamjournalofcomputing,9(2):281{ [21]W.Hsu.O(MN)algorithmsfortherecognitionandisomorphismprobelm [20]J.HopcroftandJ.Wonk.Alineartimealgorithmforisomorphismofplanar [19]S.Goldwasser,S.micali,andC.Racko.Theknowledgecomplexityof Computing,pages172{184,1974. graphs.proceeedingsofthe6thannualacmsymposiumonthetheoryof interactiveproofsystems.siamjournaloncomputing,18:186{208,1989. SymposiumonTheoryofComputing,pages235{243,1980. [22]J.JaJaandS.Kosaraju.Parallelalgorithmsforplanargraphisomorphism oncircular-arcgraphs.siamjournalofcomputing,24(3):411{439,june 1995. andrealtedproblems.ieeetransactionsoncircuitsandsystems,35:304{ 311,1988. 23

[26]J.McGregor.Relationalconsistencyalgorithmsandtheirapplicationin [25]R.Mathon.Anoteonthegraphisomorphismcountingproblem.InformationProcessingLetters,8:131{132,1979. ndingsubgraphandgraphisomorphism.informationsciences,19:229{ ItsStructuralComplexity.Birkhauser,Boston,1993. [24]E.Luks.Isomorphismofgraphsofboundedvalencecanbetestesinpolynomialtime.JournalofComputerandSystemSciences,25:42{65,1982. [23]J.Kobler,U.Schoning,andJ.Toran.TheGraphIsomorphismProblem: [28]B.McKay.Practicalgraphisomorphism.CongressusNumerantium,30:45{ [27]B.McKay.NautyUser'sGuide(version1.5).ComputerScienceDepartment,AustrialianNationalUniversity. 250,1979. [31]U.Schoning.Graphisomorphismisinthelowhierarchy.JournalofComputerandSystemSciences,37:312{323,1988. andpractice.prentice-hall,newjersey,1977. 87,1981. Theory,1:339{363,1977. [29]R.ReadandD.Corneil.Thegraphisomorphismdisease.JournalofGraph [30]E.Reingold,J.Nievergelt,andN.Deo.CombinatorialAlgorithms:Theory 24