Algorithms and discrete applied mathematics second international conference caldam 2016 thiruvananth

Page 1


Algorithms and Discrete Applied Mathematics

Second International Conference CALDAM 2016

Thiruvananthapuram India February 18 20 2016 Proceedings 1st Edition Sathish Govindarajan

Visit to download the full and correct content document: https://textbookfull.com/product/algorithms-and-discrete-applied-mathematics-second -international-conference-caldam-2016-thiruvananthapuram-india-february-18-20-201 6-proceedings-1st-edition-sathish-govindarajan/

More products digital (pdf, epub, mobi) instant download maybe you interests ...

Algorithms and Discrete Applied Mathematics First International Conference CALDAM 2015 Kanpur India February 8 10 2015 Proceedings 1st Edition Sumit Ganguly

https://textbookfull.com/product/algorithms-and-discrete-appliedmathematics-first-international-conference-caldam-2015-kanpurindia-february-8-10-2015-proceedings-1st-edition-sumit-ganguly/

Security Privacy and Applied Cryptography Engineering 6th International Conference SPACE 2016 Hyderabad India December 14 18 2016 Proceedings 1st Edition Claude Carlet

https://textbookfull.com/product/security-privacy-and-appliedcryptography-engineering-6th-international-conferencespace-2016-hyderabad-india-december-14-18-2016-proceedings-1stedition-claude-carlet/

Information Systems Security 12th International Conference ICISS 2016 Jaipur India December 16 20 2016 Proceedings 1st Edition Indrajit Ray

https://textbookfull.com/product/information-systemssecurity-12th-international-conference-iciss-2016-jaipur-indiadecember-16-20-2016-proceedings-1st-edition-indrajit-ray/

String Processing and Information Retrieval 23rd International Symposium SPIRE 2016 Beppu Japan October 18 20 2016 Proceedings 1st Edition Shunsuke Inenaga

https://textbookfull.com/product/string-processing-andinformation-retrieval-23rd-international-symposiumspire-2016-beppu-japan-october-18-20-2016-proceedings-1stedition-shunsuke-inenaga/

Wireless Internet 9th International Conference WICON

2016 Haikou China December 19 20 2016 Proceedings 1st Edition Mengxing Huang

https://textbookfull.com/product/wireless-internet-9thinternational-conference-wicon-2016-haikou-chinadecember-19-20-2016-proceedings-1st-edition-mengxing-huang/

Artificial Life and Computational Intelligence Second

Australasian Conference ACALCI 2016 Canberra ACT

Australia February 2 5 2016 Proceedings 1st Edition Tapabrata Ray

https://textbookfull.com/product/artificial-life-andcomputational-intelligence-second-australasian-conferenceacalci-2016-canberra-act-australiafebruary-2-5-2016-proceedings-1st-edition-tapabrata-ray/

Information Security Practice and Experience 12th International Conference ISPEC 2016 Zhangjiajie China

November 16 18 2016 Proceedings 1st Edition Feng Bao

https://textbookfull.com/product/information-security-practiceand-experience-12th-international-conferenceispec-2016-zhangjiajie-china-november-16-18-2016-proceedings-1stedition-feng-bao/

Social Computing Second International Conference of Young Computer Scientists Engineers and Educators

ICYCSEE 2016 Harbin China August 20 22 2016 Proceedings

Part I 1st Edition Wanxiang Che

https://textbookfull.com/product/social-computing-secondinternational-conference-of-young-computer-scientists-engineersand-educators-icycsee-2016-harbin-chinaaugust-20-22-2016-proceedings-part-i-1st-edition-wanxiang-che/

Social Computing Second International Conference of Young Computer Scientists Engineers and Educators

ICYCSEE 2016 Harbin China August 20 22 2016 Proceedings

Part II 1st Edition Wanxiang Che

https://textbookfull.com/product/social-computing-secondinternational-conference-of-young-computer-scientists-engineersand-educators-icycsee-2016-harbin-chinaaugust-20-22-2016-proceedings-part-ii-1st-edition-wanxiang-che/

Sathish Govindarajan

Algorithms and Discrete Applied Mathematics

Second International Conference, CALDAM 2016 Thiruvananthapuram, India, February 18–20, 2016

Proceedings

LectureNotesinComputerScience9602

CommencedPublicationin1973

FoundingandFormerSeriesEditors: GerhardGoos,JurisHartmanis,andJanvanLeeuwen

EditorialBoard

DavidHutchison

LancasterUniversity,Lancaster,UK

TakeoKanade

CarnegieMellonUniversity,Pittsburgh,PA,USA

JosefKittler UniversityofSurrey,Guildford,UK

JonM.Kleinberg

CornellUniversity,Ithaca,NY,USA

FriedemannMattern

ETHZurich,Zürich,Switzerland

JohnC.Mitchell

StanfordUniversity,Stanford,CA,USA

MoniNaor

WeizmannInstituteofScience,Rehovot,Israel

C.PanduRangan

IndianInstituteofTechnology,Madras,India

BernhardSteffen TUDortmundUniversity,Dortmund,Germany

DemetriTerzopoulos UniversityofCalifornia,LosAngeles,CA,USA

DougTygar UniversityofCalifornia,Berkeley,CA,USA

GerhardWeikum

MaxPlanckInstituteforInformatics,Saarbrücken,Germany

Moreinformationaboutthisseriesathttp://www.springer.com/series/7407

SathishGovindarajan • AnilMaheshwari(Eds.)

Algorithms andDiscreteApplied Mathematics

SecondInternational Conference,CALDAM2016

Thiruvananthapuram,India,February18–20,2016

Proceedings

Editors SathishGovindarajan IndianInstituteofScience

Bangalore India

AnilMaheshwari

Ottawa,ON Canada

ISSN0302-9743ISSN1611-3349(electronic) LectureNotesinComputerScience

ISBN978-3-319-29220-5ISBN978-3-319-29221-2(eBook) DOI10.1007/978-3-319-29221-2

LibraryofCongressControlNumber:2015960217

LNCSSublibrary:SL1 – TheoreticalComputerScienceandGeneralIssues

© SpringerInternationalPublishingSwitzerland2016

Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpartofthe materialisconcerned,specificallytherightsoftranslation,reprinting,reuseofillustrations,recitation, broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,andtransmissionorinformation storageandretrieval,electronicadaptation,computersoftware,orbysimilarordissimilarmethodologynow knownorhereafterdeveloped.

Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant protectivelawsandregulationsandthereforefreeforgeneraluse.

Thepublisher,theauthorsandtheeditorsaresafetoassumethattheadviceandinformationinthisbookare believedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsortheeditors giveawarranty,expressorimplied,withrespecttothematerialcontainedhereinorforanyerrorsor omissionsthatmayhavebeenmade.

Printedonacid-freepaper

ThisSpringerimprintispublishedbySpringerNature TheregisteredcompanyisSpringerInternationalPublishingAGSwitzerland

Preface

ThisvolumecontainsthepaperspresentedatCALDAM2016:theSecondConference onAlgorithmsandDiscreteAppliedMathematics,heldduringFebruary18–20,2016, inThiruvanthapuram(Trivandrum),India.Thisconferencewasorganizedbythe DepartmentofFutureStudies,UniversityofKerala,Thiruvananthapuram.Theconferencecoveredadiverserangeoftopicsonalgorithmsanddiscreteappliedmathematics.Therewere91submissionsfrom13countries.Eachsubmissionwascarefully reviewedbyatleastone,andonaveragethree,ProgramCommitteemembers.In addition,commentsofseveralexternalreviewerswerealsosought.Thecommittee decidedtoaccept30papers.Theconferenceprogramalsoincludedinvitedtalksby VictorChepoiandSurenderBaswana.

The firstConferenceonAlgorithmsandDiscreteAppliedMathematicswasheldat theIndianInstituteofTechnology,Kanpur,duringFebruary8–10,2015,andthe proceedingswerepublishedinthe LectureNotesinComputerScience (volume8959). The firstconferenceaccepted26papersoutof58submissionsfrom10countries.

Wewouldliketothankalltheauthorsforcontributinghigh-qualityresearchpapers totheconference.WeexpressoursincerethankstotheProgramCommitteemembers andtheexternalreviewersforreviewingthepaperswithinaveryshortperiodoftime. WethankSpringerforpublishingtheproceedingsinthe LectureNotesinComputer Science series.WethanktheinvitedspeakersVictorChepoiandSurenderBaswanafor acceptingourinvitation.WethanktheOrganizingCommitteechairedbyManoj ChangatfromtheUniversityofKeralaforthesmoothfunctioningoftheconference. WethankthechairoftheSteeringCommittee,SubirGhosh,forhisactivehelp, support,andguidancethroughout.WethankoursponsorsGoogleInc.,Universityof Kerala,KSCSTE(KeralaStateCouncilforScience,TechnologyandEnvironment, GovernmentofKerala),andCDC-IMU(CommissionforDevelopingCountriesof InternationalMathematicalUnion)fortheir fi nancialsupport.Finally,wethankthe EasyChairconferencemanagementsystem,whichwasveryeffectiveinhandlingthe entirereviewingprocess.

December2015SathishGovindarajan

AnilMaheshwari

Organization

ProgramCommittee

V.AravindInstituteofMathematicalSciences,India

JohnAugustineIndianInstituteofTechnologyMadras,India

AmitabhaBagchiIndianInstituteofTechnologyDelhi,India

AmitavaBhattacharyaTataInstituteofFundamentalResearch,India

BoštjanBrešarUniversityofMaribor,Slovenia

SunilChandranIndianInstituteofScience,India ManojChangatUniversityofKerala,India

SandipDasIndianStatisticalInstitute,India VidaDujmovicUniversityofOttawa,Canada FabrizioFratiRomaTreUniversity,Italy

SumitGangulyIndianInstituteofTechnologyKanpur,India

DayaGaurUniversityofLethbridge,Canada ParthaGoswamiUniversityofCalcutta,India

SathishGovindarajan (Co-chair) IndianInstituteofScience,India

R.InkuluIndianInstituteofTechnologyGuwahati,India GwenaëlJoretUniversité LibredeBruxelles,Belgium ShujiKijimaKyushuUniversity,Japan SandiKlavzarUniversityofLjubljana,Slovenia RameshKrishnamurtiSimonFraserUniversity,Canada AndrzejLingasLundUniversity,Sweden

MeenaMahajanInstituteofMathematicalSciences,India AnilMaheshwari (Co-chair) CarletonUniversity,Canada

BojanMoharSimonFraserUniversity,Canada

N.S.NarayanaswamyIndianInstituteofTechnologyMadras,India SudebkumarPalIndianInstituteofTechnologyKharagpur,India

B.S.PandaIndianInstituteofTechnologyDelhi,India AbhiramRanadeIndianInstituteofTechnologyBombay,India MichielSmidCarletonUniversity,Canada ShakharSmorodinskyBenGurionUniversity,Israel

C.R.SubramanianInstituteofMathematicalSciences,India DorotheaWagnerKarlsruheInstituteofTechnology,Germany

DavidWoodMonashUniversity,Australia

SteeringandOrganizingCommittee

SteeringCommittee

SubirKumarGhosh(Chair)RamakrishnaMissionVivekanandaUniversity,India JánosPach ÉcolePolytechniqueFédéraleDeLausanne(EPFL), Switzerland

NicolaSantoroCarletonUniversity,Canada SwamiSarvattomanandaRamakrishnaMissionVivekanandaUniversity,India PeterWidmayerETHZürich,Switzerland CheeYapNewYorkUniversity,USA

OrganizingCommittee

P.K.Radhakrishnan(Patron, Hon.ViceChancellor) UniversityofKerala,India

ManojChangat(Conference Chair) UniversityofKerala,India M.WilcsyUniversityofKerala,India AchuthsankarS.NairUniversityofKerala,India V.P.MahadevanPillaiUniversityofKerala,India K.S.ChandrasekharUniversityofKerala,India AmbatVijayakumarCochinUniversityofScienceandTechnology,India R.BalakrishnanBharathidasanUniversity,India B.KannanCochinUniversityofScienceandTechnology,India G.SanthoshKumarCochinUniversityofScienceandTechnology,India N.NarayananIndianInstituteofTechnologyMadras,India S.P.SanalKumarUniversityofKerala,India ChristabellP.J.UniversityofKerala,India TharaPrabhakaranUniversityofKerala,India K.SatheeshKumarUniversityofKerala,India

AdditionalReviewers

Acharya,Mukti Angelini,Patrizio Baixeries,Jaume Banik,Aritra Basavaraju,Manu Baswana,Surender Baum,Moritz Bergamini,Elisabetta Bhattacharya,Pritam Biniaz,Ahmad Boucher,Delphine

Broersma,Hajo Cabello,Sergio Chakraborty,Dibyayan Choudhary,Aruni DaLozzo,Giordano Datta,Samir Diwan,Ajit Dorbec,Paul Duong,DungHoang Erlebach,Thomas Floderus,Peter

Francis,Mathew Gaertner,Bernd Garg,Ankit Gologranc,Tanja Hamann,Michael Hegde,SureshManjanath Hinz,Andreas Iranmanesh,Ehsan Issac,Davis

Jansson,Jesper Kalyanasundaram,Subrahmanyam Khodamoradi,Kamyar Kizhakkepallathu,AshikMathew Kowaluk,Miroslaw Krithika,R. Kuziak,Dorota Levcopoulos,Christos Limaye,Nutan LinharesSales,Claudia Liu,Daphne Lugosi,Gabor M.S.,Ramanujan Mathew,Rogers Mehta,Shashank Menezes,Bernard Milanic,Martin Mishra,TapasKumar Miyano,Eiji MosesJr.,WilliamK. Mukherjee,Joydeep Mukhopadhyay,Sagnik Mulder,HenryMartyn Muthu,Rahul Nandakumar,Satyadev Nandi,Soumen

Narasimhan,Sadagopan Nasre,Meghana Natarajan,Aravind Niedermann,Benjamin O.,Suil Pal,Arindam Pandey,Arti Panigrahi,Pratima Paul,Subhabrata Peterin,Iztok Philip,Geevarghese Pinlou,Alexandre Powers,Robert Pradhan,D. Prutkin,Roman Radermacher,Marcel RaoB.V.,Raghavendra Rebeiro,Chester Rok,Alexandre Rollova,Edita Roselli,Vincenzo Roy,Bodhayan Sahoo,UmaKant Sarma,Jayalal Sen,Sagnik Shah,Chintan Singh,Tarkeshwar Sivadasan,Naveen Sivasubramaniam,Sumathi Sledneu,Dzmitry Strasser,Ben Sundararajan,R. Sury,B. Tewari,Raghunath

Contents

RandomizationforEfficientDynamicGraphAlgorithms(InvitedTalk).....1 SurenderBaswana

AlgorithmsforProblemsonMaximumDensitySegment...............14 Md.ShafiulAlamandAsishMukhopadhyay

DistanceSpectralRadiusofSome k-partitionedTransmissionRegular Graphs..................................................26 FouzulAtikandPratimaPanigrahi

ColorSpanningObjects:AlgorithmsandHardnessResults..............37 SandipBanerjee,NeeldharaMisra,andSubhasC.Nandy

OnHamiltonianColoringsofTrees..............................49 DevsiBantva

OntheComplexityLandscapeoftheDominationChain...............61 CristinaBazgan,LjiljanaBrankovic,KatrinCasel,andHenningFernau

OntheProbabilityofBeingSynchronizable........................73 MikhailV.Berlinkov

Linear-TimeFittingofa k-StepFunction..........................85 BinayBhattacharya,SandipDas,andTsunehikoKameda

Random-BitOptimalUniformSamplingforRootedPlanarTreeswith GivenSequenceofDegreesandApplications.......................97 OlivierBodini,JulienDavid,andPhilippeMarchal

AxiomaticCharacterizationofClawandPaw-FreeGraphsUsingGraph TransitFunctions..........................................115 ManojChangat,FerdoosHosseinNezhad,andNarayananNarayanan

LinearTimeAlgorithmsforEuclidean1-Centerin Rd withNon-linear ConvexConstraints.........................................126 SandipDas,AyanNandy,andSwamiSarvottamananda

LowerBoundsontheDilationofPlaneSpanners....................139 AdrianDumitrescuandAnirbanGhosh

LatticeSpannersofLowDegree................................152 AdrianDumitrescuandAnirbanGhosh

AND–DecompositionofBooleanPolynomialswithPrescribedShared Variables................................................164

PavelEmelyanov

ApproximationAlgorithmsforCumulativeVRPwithStochasticDemands...176 DayaRamGaur,ApurvaMudgal,andRishiRanjanSingh

SomeDistanceAntimagicLabeledGraphs.........................190 AdarshK.Handa,AloysiusGodinho,andTarkeshwarSingh

ANewConstructionofBroadcastGraphs.........................201 HovhannesA.HarutyunyanandZhiyuanLi

ImprovedAlgorithmforMaximumIndependentSetonUnitDiskGraph....212 RameshK.JalluandGuatamK.Das

IndependentSetsinClassesRelatedtoChair-FreeGraphs..............224 T.Karthick

CyclicCodesoverGaloisRings................................233

JasbirKaur,SuchetaDutt,andRanjeetSehmi

OntheCenterSetsofSomeGraphClasses........................240 ManojChangat,KannanBalakrishnan,RamKumar,G.N.Prasanth, andA.Sreekumar

OnIrreducibleNo-hole L(2,1)-labelingsofHypercubesandTriangular Lattices.................................................254 NibeditaMandalandPratimaPanigrahi

MediansofPermutations:BuildingConstraints......................264 RobinMiloszandSylvieHamel

b-DisjunctiveTotalDominationinGraphs:AlgorithmandHardness Results.................................................277 ArtiPandeyandB.S.Panda

m-GracefulnessofGraphs....................................289 JessicaPereira,T.Singh,andS.Arumugam

DominationParametersinHypertrees............................299 R.Jayagopal,IndraRajasingh,andR.SundaraRajan

ComplexityofSteinerTreeinSplitGraphs-DichotomyResults.........308 MadhuIlluri,P.Renjith,andN.Sadagopan

RelativeCliqueNumberofPlanarSignedGraphs....................326 SandipDas,PrantarGhosh,SwathyprabhuMj,andSagnikSen

Thecd-ColoringofGraphs....................................337 M.A.ShaluandT.P.Sandhya

Characterizationsof

H.P.PatilandV.Raja

OnthePowerDominationNumberofGraphProducts.................357 SeethuVargheseandA.Vijayakumar AuthorIndex

RandomizationforEfficientDynamicGraph Algorithms (InvitedTalk)

DepartmentofCSE,IITKanpur,Kanpur,India

sbaswana@cse.iitk.ac.in

Abstract. Inthelasttwodecades,randomizationhasplayedacrucial roleinthedesignofefficientalgorithmsforvariousproblemsondynamic graphs.Theaimofthisarticleistoillustratesomeoftheserandomization techniquesinthecontextofthesedynamicgraphalgorithms.

1Introduction

Graphsareusedtomodelvariouscomputationalproblemsandstructuresinreal life.Forexample,anetworkofrouters,networkofroads,networkofuserson Facebook/Twittercanallbemodelledasagraphsothatsolvinganyproblemon thesenetworksamountstosolvingsomeproblemonthecorrespondinggraph.A fewwellknownproblemsongraphsareconnectivity,shortestpaths,andmatching.Thereexistclassicalalgorithmswhichsolvetheseproblemsquiteefficiently foranygivenstaticgraph.However,itisalsoknownthatmostofthegraphsin reallifearepronetochanges.Thesechangesmaybeinsertionofnewlinksor deletionofexistinglinks.Thesechangesmaycauseachangeinthesolutionof thecorrespondingproblemaswell.

Analgorithmicgraphprobleminadynamicenvironmentismodelledasfollows.Thereisanonlinesequenceofinsertionanddeletionofedgesinthegraph, andtheobjectiveistomaintainthesolutionoftheproblemefficientlyaftereach oftheseupdates.Inparticular,thetimetakentoupdatethesolutionhastobe muchsmallerthanthatofthebeststaticalgorithmfortheproblem.Adynamic graphalgorithmissaidtobefullydynamicifithandlesbothinsertionaswell asdeletionofedges.Apartiallydynamicalgorithmissaidtobeincrementalor decrementalifithandlesonlyinsertionoronlydeletionofedgesrespectively. Inthelasttwodecades,manyelegantdynamicalgorithmshavebeendesigned forvariousgraphproblemssuchasconnectivity[6, 12, 13, 15],reachability[3, 17], shortestpath[5, 18],spanners[4, 9],matching[2],min-cut[21].Randomization hasplayedaverycrucialroleinthedesignofmanyofthesedynamicalgorithms. Forsomeproblemslikeconnectivity,matching,andspannersindynamicenvironment,randomizationachievedamajorbreakthroughinimprovingtheupdate

SurenderBaswana—ThisresearchwaspartiallysupportedbyUniversityGrants CommissionofIndiaandtheIsraelScienceFoundation.

c SpringerInternationalPublishingSwitzerland2016

S.GovindarajanandA.Maheshwari(Eds.):CALDAM2016,LNCS9602,pp.1–13,2016. DOI:10.1007/978-3-319-29221-2 1

timefrompolynomialtopolylogarithmic(ininputsize).Forsomeproblemslike singlesourcereachabilityandshortestpathsunderdeletionofedges,randomizationhasrecentlyplayedakeyroleinbreakingthelong-standingbarriersin theirtimecomplexity[10, 11].Moreover,therandomizedalgorithmsfordynamic graphproblemsareusuallysimplercomparedtothedeterministicones,making themidealforpracticalapplications.

Theobjectiveofthisarticleistohighlightsomeoftherandomizationtechniquesthatplayedaveryimportantroleindesigningefficientdynamicalgorithms.Eachofthesetechniquesisdemonstratedthroughadynamicgraph problemfollowedbyitsrandomizedalgorithmexploitingthetechnique.While choosingtheseproblemsandalgorithms,theonlycriteriafollowedistheease withwhichthecorrespondingtechniquecanbeexplainedandemphasized.We havetriedtoensurethatthisarticleisselfcontained,andnoprerequisitefrom theareaofrandomizedalgorithmsordynamicalgorithmsisexpected.

Wenowstateafewstandardterminologiesaboutrandomizedalgorithms. Therearetwotypesofrandomizedalgorithms:LasVegasandMonteCarlo.A randomizedalgorithmiscalledaLasVegasalgorithmifitsoutputisalways correctbutitsrunningtimeisarandomvariable.Arandomizedalgorithmis calledaMonteCarloalgorithmifitsrunningtimeisfixedbutitsoutputmaybe incorrectwithsomeprobability.Whiledesigningoranalysingagraphalgorithm, n and m willdenoterespectivelythenumberofverticesandedgesofagraph.In thecontextofarandomizedalgorithm,weusuallysaythataneventwillhappen with highprobability iftheprobabilityofitshappeningismorethan1 n c foranyconstant c> 0.Formostofthepracticalapplications,aMonteCarlo algorithmthatsucceedswithhighprobabilityisconsideredalmostasgoodas anydeterministicalgorithm.

2Fingerprinting

Weillustratethistechniquethroughitsapplicationinsolvingtheproblemof fullydynamictransitiveclosureofadirectedgraph G.Theaimistomaintain aBooleanmatrix M suchthat M [u,v ]=1ifandonlyifthereisatleastone pathfrom u to v .KingandSagert[16]designedaMonteCarloalgorithmfor thisproblemthattakes O (n2.26 )updatetime.Theyfirstdesignedan O (n2 ) updatetimealgorithmforadirectedacyclicgraph(DAG)andthenextended ittogeneralgraphsusingfastalgorithmsformatrixmultiplication.Forthe sakeofclearexpositionofthefingerprintingtechniqueinthisarticle,werestrict ourselvestoDAGonly.

Asimpleandobviousapproachtomaintainthetransitiveclosureistokeepa matrix P-count thatstoresthecountofalldistinctpathsfrom u to v foreach u,v ∈ V .Twopathsaresaidtobedistinctifthesetsoftheedgesdefiningthem arenotthesame.So M [u,v ]=1ifandonlyif P-count[u,v ] > 0.Inorderto maintain P-count underinsertionanddeletionofedges,thefollowinglemma, thatholdsforaDAG,turnsouttobeverycrucial.Asimpleproofofthislemma isbasedontheexistenceofatopologicalorderingforaDAG.

Lemma1. Let (i,j ) beanyedge,andlet Pu,i and Pj,v beanytwopathsina DAG.Thenconcatenationof Pu,i ,edge (i,j ),and Pj,v isapathfrom u to v .

Considerinsertion(ordeletion)ofanedge(i,j ).ItfollowsfromLemma 1 that foranytwovertices u,v ∈ V ,theincrease(ordecrease)inthenumberofpaths fromanyvertex u toanyvertex v isexactly(P-count[u,i] × P-count[j,v ]). Thissuggeststhefollowingalgorithmforupdating P-count uponinsertionof anedge(deletionofanedgeissimilar).

Algorithm1. Updating P-count uponinsertionofanedge(i,j )

1 foreach (u,v ∈ V ) do

2 P-count[u,v ] ← P-count[u,v ]+(P-count[u,i] × P-count[j,v ]);

3 end

Algorithm 1 thusperforms O (n2 )arithmeticoperationstoupdate P-count foranyedgeinsertionordeletion.However,thisisstillnotan O (n2 )timealgorithm.Thisisbecausetherecanbe Θ (2n )pathsbetweentwoverticesinaDAG, andsoanentryin P-count canbea n-bitnumber.ButthewordRAMmodel facilitatesexecutionofanarithmeticoperationin O (1)timeprovidedthenumberofbitsis O (log n)only.So,atfirstsight,Algorithm 1 seemstohavehita hurdletoohardtoovercome.However,observethatwehavetojustdetermine whether P-count[u,v ] =0,andsowedon’thavetomaintain exact valueof P-count[u,v ].Thisobservationcanbeexploitedwiththehelpofrandomizationtosolveourproblem.Insteadofworkingwiththe n-bitnumbers,basically weworkwiththeirshort fingerprints asfollows:

–Pickaprimenumber p randomlyuniformlyfrom[2,nc log n]forany c> 0. –PerformallarithmeticoperationsinAlgorithm 1 modulo p

Thoughthealgorithmwilltake O (n2 )timenow,whatistheguaranteeabout itscorrectness?If P-count[u,v ]mod p =0,surely P-count[u,v ] =0and hence M [u,v ]=1.However,if P-count[u,v ]mod p =0,itisnotnecessary that P-count[u,v ]=0(andhence M [u,v ]=0).Butthismayhappenonlyif P-count[u,v ]isdivisibleby p.Weshallnowshowthattheprobabilityofthis happeningisextremelysmall.

Thewell-knownPrimeNumberTheoremstatesthatthenumberofprime numberslessthan k isasymptotically k/ ln k .Therefore,thereare Θ (nc )prime numbersintheinterval[2,nc log n].Considerany u,v ∈ V .Sinceeachprime numberis ≥ 2,and P-count[u,v ]atanystageisatmost2n ,sothenumber ofitsprimefactorsistriviallyboundedby n.Therefore,theprobabilitythata randomlyselectedprimenumberfrom[2,nc log n]divides P-count[u,v ]isat most1/nc 1 .Probabilityofunionofasetofeventsisupperboundedbythe sumoftheprobabilityofindividualevents.Therefore,theprobabilitythatany ofthe n2 entriesinthematrixiswrongisatmost1/nc 3 whichis n 3 for c =6. ThuswegetaMonteCarloalgorithmforfullydynamictransitiveclosureofa DAG.Thetransitiveclosurematrixmaintainedbythealgorithmiscorrectwith probabilityatleast1 n 3 atanystage.

3RandomSampling

Thetechniqueofrandomsamplingisoneofthemostpowerfulrandomization techniquestodesignefficientalgorithms.Itspowercanberealizedthroughthe followingsimpleexample.Supposethereisalargeset S consistingof good elementsand bad elements.Moreover, α fractionof S consistsofgoodelementsand itcanbedeterminedefficientlywhetheranygivenelementisgood.Theaimis toselecta good elementfrom S .Thereisnoefficientwaytoaccomplishthisaim deterministicallysinceintheworstcasewemightneedtoscanthroughlarge numberofelements.However,thereisasimplerandomizedwaytoachieveit: Pickanelementrandomlyuniformlyfrom S .Thiselementisgoingtobeagood elementwithprobability α.Thisprobabilitycanbeboostedarbitrarilycloseto 1byrepeatedsampling.Weillustratethepowerofrandomsamplingtechnique indynamicalgorithmsthroughtheproblemoffullydynamicconnectivity.

Thefullydynamicconnectivityproblemcanbedescribedasfollows.There isanundirectedgraphundergoinginsertionanddeletionofedges.Theaimis tomaintainadatastructuresothatthefollowingquerycanbeansweredefficientlyforany u,v ∈ V : Is u connectedto v byapathin G ?Thisproblem isarguablythemostextensivelyresearchedproblemintheareaofdynamic graphalgorithms.ThefirstalgorithmforthisproblemwasdesignedbyFrederickson[8]thattakes O (√m)updatetimeand O (1)querytime.Theupdate timewasimprovedto O (√n)usingasparsificationtechnique[6].Thereafter,a majorbreakthroughforthisproblemwasachievedthroughrandomizationonly: HenzingerandKing[12]designedaLasVegasalgorithmthatachievesexpected amortized O (log 3 n)updatetimeand O (log n)querytime.Theiralgorithmmaintainsapartitionofedgesamong O (log n)levels:higherthelevel,sparserthe edgesets.ForabetterexpositionoftherandomizationtechniqueusedbyHenzingerandKing[12],wepresentanalgorithmwith2-levelpartitionoftheedges, andfirstconsiderdeletionofedgesonly.

Wefirstpresentanoverviewandintuitionunderlyingthealgorithm.The algorithmmaintainsaspanningforest F ofthegraphsuchthateachtree T ∈F spansaconnectedcomponentofthegraph.Soinordertodetermineiftwo verticesareconnected,wejustneedtodetermineiftheybelongtothesametree in F .Foranysubtree T ofatree T ∈F ,let E (T )denotethesubsetofedges withatleastoneendpointin T .Anedgein E (T )issaidtobeacutedgeifits exactlyoneendpointispresentin T .

Deletionofanynon-treeedgedoesnotchange F andsocanbehandled trivially.Letusconsiderdeletionofanedge e presentinsometree T ∈F that splitsitintotwotrees T1 and T2 .Weneedtodeterminewhetherthereisany edgein E thatconnects T1 and T2 ,andifso,findonesuchedgetojoin T1 and T2 Withoutlossofgenerality,let T1 besmallerinsizethan T2 .Soweneedtosearch foracutedgefrom E (T1 ).Maintainingthecutedgesdefinedbyvariousedges intheforest F explicitlyisachallengingtaskduetotheunderlyingdynamic environment.However,asimplerandomizationideashowsanefficientwayto findacutedgefrom E (T1 ).Observethatif α fractionof E (T1 )consistsofcut edges,thenarandomlypickededgefrom E (T1 )isgoingtobeacutedgewith

probability α.Soif α isagoodfraction,wecanfindacutedgebyrepeatedly samplinganedgeandcheckingifitisacutedge.Butwhatif α istoosmall? Thishappenswhenthecutdefinedby T1 and T2 isverysparse.Wecollectedges ofeachsuchsparsecutinaseparatepoolatlevel2duringthealgorithm.Itis ensuredthatthenumberofedgesinthispoolremainverysmallalways,therefore, searchingforacutedgeinthispoolcanbedoneinabruteforcemanner.With thisoverview,weshallnowdescribethealgorithminmoredetails.

Inordertocarryoutvarioustasksefficiently,weshallneedadatastructure thatcanperformthefollowingoperationsefficientlyforanysubtree T ofatree T ∈F

–Determiningiftwoverticesbelongtothesametreein F in O (log n)time. –Pickinganedgerandomlyuniformlyfrom E (T )in O (log n)time.

–Computingalledgesfrom E (T )in O (|E (T )| log n)time.

HenzingerandKingusedaneleganttreedatastructure,calledEuler-Tourtree, tocarryouttheaboveoperationsefficiently.However,forourcurrentdiscussion, wemaytreatitasablackbox.

Thealgorithmmaintainsa2-levelpartition- E1 and E2 oftheedges E .In thebeginning E1 = E and E2 = ∅.Asthealgorithmproceeds,someedgesmay getmigratedtolevel2.Inaddition,weshallmaintaintwo(insteadofjustone) spanningforests: F1 foredges E1 ,and F2 foredges E1 ∪ E2 suchthat F1 ⊆F2 . Thus F2 ateachstageisthespanningforestofthegraph.Deletionofatreeedge e ishandledasfollows.If e ∈F2 \F1 ,wehandleittriviallybyscanning E2 to findacutedge.If e ∈F1 ,let T1 and T2 bethetwotreesformedbydeleting e, andlet T1 besmallerthan T2 insize.Algorithm 2 (onthefollowingpage)isused tosearchforacutedgefrom E (T1 )asfollows.Let t beaparametertobefixed lateron.Wesampleanedgerandomlyuniformlyfrom E (T1 )andcheckwhether itisacutedge.Werepeatthisstep2t log n times.Ifwesucceed,wejoin T1 and T2 bythecutedge,andadditto F1 and F2 .Ifwedon’tsucceed,wescanthe entireset E (T1 )tocollectallcutedges.Ifnumberofcutedgesisatleast |E (T1 )| t , wejoin T1 and T2 byacutedge,andadditto F1 and F2 .Otherwise,wemove allcutedgestolevel2.Wethensearch E2 foracutedge.Ifacutedgeisfound, wejoin T1 and T2 byit,andadditto F2 . Letusanalysethetimecomplexityofdeletingatreeedge.Supposeedge deletedbelongsto F1 .Therearetwopossiblecases.

1.Thefirstcaseisthatthesamplingissuccessfuloratleast |E (T1 )|/t edgesare cutedges.Ifsamplingissuccessful,thetimecomplexityis O (t log 2 n)time. Letusanalysethesituationwhenatleast |E (T1 )|/t edgesarecutedges.Inthis caseanedgeselectedrandomlyfrom E (T1 )willbeacutedgewithprobability atleast1/t.Therefore,theprobabilitythattheloopdoesnotterminatewith success isatmost(1 1 t )2t log n ≤ n 2 .Inthissituation,Algorithm 2 computes alledgesofset E (T1 ).Sotheexpectedtimecomplexityofthefirstcaseis boundedby O (t log 2 n + n 2 |E (T1 )| log n)= O (t log 2 n)only.

2.Thesecondcaseiswhensamplingisunsuccessfulandlessthan |E (T1 )|/t edgesarecutedges.Inthiscase,wemoveallthecutedgesfromset E (T1 )

Algorithm2. Efficientsearchingforacutedgefrom E (T1 ).

1 count ← 0;success ← false; 2 repeat 3 count++;

4 Pickanedge e ∈ E (T1 )randomlyuniformly;

5 if e isacutedge then success ← true;

6 until (count=2t log n or success);

7 if success then Add e to F1 and F2 ;// Join T1 and T2 by e

8 else

9 X ← allcutedgesfrom E (T1 );

10 if |X |≥ |E (T1 )| t then

11 Addanyedgefrom X to F1 and F2 ;// Join T1 and T2 by e

12 else

13 Move X to E2 ;

14 Search E2 foracutedgetojoin T1 and T2 ,andadditto F2 ;

15 end 16 end

tolevel2.Apartfromsearchinglevel2foracutedgetojoin T1 and T2 ,the additionalcomputationcostinthiscaseis O (|E (T1 )| log n).Moreover,the numberofedgespassedtolevel2isatmost |E (T1 )|/t.Wecandistributeboth thesequantitiesamongtheverticesof T1 proportionaltotheirdegrees:For each v ∈ T1 ,weassign O (deg (v )log n)computationcostandassign deg (v )/t edgesthataremovedtolevel2.Theseareindeedhugequantities.However, noticethefollowingeventthathappensinthiscase:Atlevel1, v nowbelongs totree T1 whosesizeisatmosthalfoftheprevioustree T .Thiseventcan happenfor v atmost O (log n)timesoveranysequenceofedgedeletions. Sotheadditionalcomputationcostis O (m log n)andthenumberofedges passedtolevel2willbe O ( m t log n)overanysequenceofedgedeletions.This establishesthat E2 willhaveatmost O ( m t log n)edgesonly.

Ifthedeletededgebelongsto F2 \F1 ,wefindacutedgebyscanning E2 . Since |E2 | = O ( m t log n)asshownabove,thetimecomplexityforhandlingedge deletioninthiscasewillbe O ( m t log 2 n)(usingEuler-Tourtreedatastructure). Inordertominimizethetimeperupdate,webalancethetimecomplexitiesfor handlingedgedeletionatlevel1andlevel2.Sowechoose t = √m toobtain expectedamortized O (√m log 2 n)updatetimeperedgedeletion.Thiscompletes thedescriptionandanalysisofthedecrementalalgorithmforconnectivity.This algorithmcanbeextendedtohandleinsertionofedgesbyinsertingeverynew edgetolevel2andrebuildingtheentirestructure(F1 andEuler-Tourtree datastructure)afterevery √m edgeinsertionsin O (m log n)time.Thuswecan maintainfullydynamicconnectivityinexpectedamortized O (√m log 2 n)time using2-levelpartitionofedges.Withamorerefinedpartitioningofedgesamong O (log n)levels,HenzingerandKing[12]achieve O (log 3 n)expectedamortized updatetime.

Itwasalong-standingopenproblemtoachieveworstcase O (polylog n) updatetime.RecentlyKapron,King,andMountjoy[15]designedaMonteCarlo algorithmforfullydynamicconnectivitythattakes O (polylog n)timeperupdate andanswersanyconnectivityquerycorrectlywithhighprobability.Interestingly, thisalgorithmalsoemploysrandomsamplingbutinadifferentway.

4MaintainingWitnesses

Whenmaintainingapropertyexplicitlyappearsdifficult,itissometimeeasierto maintainitimplicitlybykeepingoneofits witnesss fortheproperty.Inorderto illustratetheeffectivenessofthistechnique,weconsidertheproblemofall-pairs decrementalreachability.Givenadirectedgraph G underdeletionofedges,this problemaimsatmaintainingadatastructurethatcananswerthefollowing queryefficientlyforany u,v ∈ V : Isthereapathfrom u to v ? Weshallusethe followingwell-knownresultthatfollowsfrom[7].

Lemma2. Foranyvertex v andapositiveinteger d,ittakes O (md) totaltime tomaintainabreadthfirstsearch(BFS)treerootedat v in G andtruncatedupto depth d foranyarbitrarysequenceofedgedeletions.

WeshallnowdescribeaMonteCarloalgorithm[3]formaintainingreachability underdeletionofedges.Let d beaparametertobefixedlater.Apathissaidtobe short ifitslengthisatmost d,andissaidtobe long otherwise.Thedecremental algorithm[3]maintainsreachabilityassociatedwithshortpathsexplicitlyand maintainsreachabilityassociatedwithlongpath implicitly asfollows.

ReachabilityAssociatedwithShortPaths: MaintainBFStreeuptodepth d fromeachvertex.ItfollowsfromLemma 2 thatthetotalupdatetimefor maintainingthesetreeswillbe O (mnd)whichisquitesmallif d issmall.

ReachabilityAssociatedwithLongPaths: Let Gr denotethegraph obtainedbyreversingalledgesin G.Let Tout (w )and Tin (w )respectivelybe theBFStreesrootedat w ingraphs G and Gr .Consideranypairofvertices u,v ∈ V suchthat u ∈ Tin (w )and v ∈ Tout (w ).Observethatvertex w alongwith thepair(Tin (w ),Tout (w ))actsasawitnessofreachabilityfrom u to v .Thusan alternateschemeforcomputing(ormaintaining)all-pairsreachabilityisbycomputing(ormaintaining)thesewitnesses.However,tomaterializethisscheme,we needtohaveasmallsetofverticesthatcontainsawitnessforreachabilityfor all-pairs.Interestingly,forall-pairsofverticesseparatedbylongdistance,randomizationhelpsinconstructingasmallsetofwitnesseswithhighprobability. Indeed,Algorithm 3 computessuchasetandalsocomputesawitnessmatrix thatwillstore,withhighprobability,awitnessofreachabilityforallsuchpairs.

Lemma3. Supposedistancefromavertex u toavertex v is t>d.Withhigh probability, W [u,v ] storesawitnessofreachabilityfrom u to v .

Proof. Let i besuchthat2i d ≤ t< 2i+1 d.Let Puv betheshortestpathfrom u to v ,andlet w beanyvertexonthispath.If w isselectedin Si ,itfollows

Algorithm3. Computingwitness-matrixforreachability

1 foreach i from0to log 2 n d do

2 Si ← asetformedbyselectingeachvertexindependentlywithprob. c log n 2i d ;

3 foreach w ∈ Si do

4 Tout (w ) ←

5 Tin (w ) ←

BFStreeofdepth2i d rootedat w in G;

BFStreeofdepth2i d rootedat w in Gr ;

6 foreach u ∈ Tin (w ) and v ∈ Tout (w ) do

7 if W [u,v ]= null then W [u,v ] ← w

8 end

9 end 10 end

fromAlgorithm 3 thattheentirepath Puv iscontainedin Tin (w )and Tout (w ). Sinceeachvertexofthegraphisselectedrandomlyindependentlyin Si ,the probabilitythatnovertexon Puv isselectedin Si is

Soatleastonevertexof Puv willappearin Si withprobability ≥ 1 1/nc ;and so W [u,v ]willstoreawitnessofreachabilityfrom u to v

Let L bethelistformedbyconcatenating Si ’sintheincreasingorderof i Noticethattheremaybemultiplewitnessesofreachabilityfrom u to v inthe list L.ButAlgorithm 3 ensuresthat W [u,v ]pointstothefirstwitnessinthe list L

Therandomsamplingtoconstruct Si ’siscarriedoutindependentoftheedges ingraph G,soLemma 3 mustholdtruefor G evenafteranynumberofedges aredeletedfromit.Therefore,inordertomaintainreachabilityastheedgesare beingdeleted,allweneedistomaintainthecollectionoftheBFStreesbuilt duringAlgorithm 3 andmaintainwitnessmatrix W accordingly.Thistaskturns outtobesimpleandefficientasfollows.

Consideranyvertex w ∈ Si forany i.Let Tin (w )and Tout (w )betheBFS treesassociatedwith w .Weprocess w upondeletionofanedge e asfollows. Wefirstupdate Tin (w )(and Tout (w )),andwegetthoseverticesthatceaseto belongto Tin (w )(and Tout (w )).Thisallowsustocomputeallthosepairsof verticesforwhich w hasceasedtobeawitnessofreachability-foreachsuch pair(u,v ),either u hasceasedtobelongto Tin (w )or v hasceasedtobelong to Tout (w ).Foreachsuchpair,if W [u,v ]= w ,wesearchforanotherwitness, ifany,in L startingfromcurrentlocation(w );westopuponfindingthenext witnessandupdate W [u,v ]accordingly.Aslongasthereisapathfrom u to v of length ≥ d,Lemma 3 impliesthat,withhighprobability, W willstoreawitness ofreachabilityfrom u to v

Inordertoansweraqueryofreachabilityfrom u to v ,wemayfirstquery theBFStreeofdepth d associatedwith u foranyshortpathfrom u to v .Ifit

fails,welookinto W [u,v ]forwitnessofreachabilityforanylongpathfrom u to v .ItfollowsfromLemma 3 thatthequerywillbeansweredcorrectlywithhigh probability.

Letusanalysethetotalupdatetimeformaintainingthewitnessmatrix. Expectedsizeof Si is O ( n log n 2i d ).SoItfollowsfromLemma 2 thatthetime complexityofmaintainingthe in and out BFStreesforverticesofset Si isof theorderof m n log n 2i d 2i d = mn log n.SotheupdatetimeformaintainingtheBFS treesforall Si ’sis O (mn log 2 n).Notethatonceavertexceasestobeawitness ofreachabilityforapair,itwillneverbecomeawitnessforthepairagain.Sothe extracomputationaltimespentinoutputtingallsuchpairsoveranysequenceof edgedeletionsis O (n2 )foreachvertex w ∈ L.Further,eachpairmakesasingle scanoverthelist L insearchofwitnessduringthealgorithm.Ittakes O (1)time tocheckifavertex w ∈ L isawitnessofreachabilityforapair u,v :wejust querythecorrespondingBFStreesassociatedwith w .Expectedsizeof L is O ( n log n d ).Sothetotaltimespentinsearchingforawitnessin L is O (n2 n log n d ) timeforallpairs.Therefore,theoveralltimecomplexityofmaintainingall-pairs reachabilityassociatedwithlongpathsis O ( n 3 d log n + mn log 2 n).

Combiningtogetherthetasksofmaintainingreachabilityforshortandlong paths,thetotaltimecomplexityoveranysequenceofedgedeletionsis n3 d log n + mn log 2 n + mnd

Theaboveexpressionattainsitssmallestvalue O (n2 √m log n)ifwechoose d = n√log n/√m.Thuswecanconcludethatall-pairsreachabilitycanbemaintainedinexpectedamortized O (n2 √log n/√m)timeperedgedeletion.This algorithmwasthefirsttoachievesubquadraticupdatetimefordecremental reachability.However,thealgorithmisMonteCarloandanswersanyreachabilityquerycorrectlywithprobabilityatleast1 n c forany c> 0.

Anotherinterestingapplicationofmaintainingwitnesseshasbeeninmaintainingapproximateshortestpathsunderdeletionofedges.RodittyandZwick [18]presentedanefficientalgorithmforthisproblemwhenthegraphisundirectedandunweighted.

5FoilingtheAdversary

Whiledesigninganefficientdynamicalgorithmforaproblem,theupdatesmay beviewedasifgeneratedbyanadversary.Thesoleaimoftheadversaryisto causeahugechangeinthesolutionsoastoforcethemaximumpossibleupdate time.Therearegraphproblemswherethesolutionisnotunique.Instead,there maybemultiplepossiblesolutions.Forsuchproblems,manytimesitisauseful ideatobuildandmaintainarandomizedsolution.Iftheadversaryisoblivious totherandombitsusedbythealgorithm,itturnsoutthattheexpectedupdate timetomaintainsuchasolutionforanyarbitrarysequenceofupdatesisquite small.Thisobliviousadversarialmodelisnodifferentfromrandomizeddatastructureslikeuniversalhashing.

Wedemonstratethepowerofthistechniquebyatoyproblemsoastohighlightitsintricacieseffectively.Considerastargraph G =(V,E )on n = |V | verticeswithauniquesourcevertex s joinedtoeveryothervertexbyanedge. Theedgesarenowdeletedbyanadversary.Theobjectiveisthat s hastocling toexactlyoneneighbour,denotedby N (s),ateverymomentoftime.Whenever theedge(s,N (s))isdeleted, N (s)ceasestobetheneighbourof s.So s needs toswitchtoanotherneighbouramongtheexistingones.However,foreachsuch switching s needstopayacostof c units.Theaimistominimizethecost incurredoveranyarbitrarysequenceofedgedeletions.Observethatifweuse anydeterministicalgorithm,thatis,asequenceofneighboursthat s shouldtake, thentheadversarycanmake s paymaximumcost c(n 2)bydeletingedgesin thesamesequence.Weshallnowpresentanextremelysimplerandomizedalgorithmthatwillincurexpected O (c log n)cost.Theideaistofoiltheadversary byselectingarandomneighbourfor s whenever(s,N (s))getsdeleted.Notethat theneighbourmaintained(basedontherandombits)by s atanystageisnot knowntotheadversary.

Algorithm4. Handlingdeletionofanedge(s,v )

1 if N (s)=v then

2 x ← avertexpickedrandomlyamongalltheexistingneighboursof s;

3 N (s) ← x 4 end

Itiseasytoobservethatthealgorithmmaintainsthefollowinginvariant. I :If A isthesetofverticesadjacentto s atanymoment,thenforevery v ∈ A,

P[N (s)= v ]= 1 |A|

Weshallnowanalysetheexpectedcostincurredby s foranyarbitrarysequence ofedgedeletions.Let X bearandomvariableforthenumberoftimes s changes itsneighbourforthegivensequenceofedgedeletions.Let v1 ,...,vn 1 bethe sequenceofvertices V \{s} inthechronologicalorderoflosingtheiredges incidentonto s.Wedefinearandomvariable Xi , 1 ≤ i<n asfollows. Xi = 1ifdeletionofedge(s,vi )incursacost 0otherwise

Clearly X = i Xi .Hencebylinearityofexpectation E[X ]= i E[Xi ]= i P[Xi =1].Considerthemomentjustbeforethedeletionof(s,vi ).There were n i neighboursthatexistedatthatmoment.SoitfollowsfromInvariant I thatprobability N (s)is vi atthismomentis 1 n i .Hence

[X ]=

Sotheexpectedcostincurredby s is O (c log n)whichismuchsmallerthanthe worstcasecost Θ (cn)incurredbyanydeterministicalgorithm.

Thetechniqueoffoilingtheadversaryhasbeenexploitedinthefollowing algorithms.

–Fullydynamicalgorithmformaximalmatching[2].

–Fullydynamicalgorithmforgraphspanners[4].

–Decrementalalgorithmforconnectivity[19].

–Decrementalalgorithmformaintainingstronglyconnectedcomponents[17].

–DecrementalalgorithmforadepthfirstsearchtreeinaDAG[1].

Weshallnowbrieflydescribethefullydynamicalgorithmformaximalmatching inagraphthatisbasedonthetechniqueoffoilingtheadversarybyrandomization.

5.1FullyDynamicMaximalMatching

Let G =(V,E )beanundirectedgraphon n = |V | verticesand m = |E | edges.Amatchingin G isasetofedges M⊆ E suchthatnotwoedgesin M shareanyvertex.Amatchingissaidtobe maximal ifitisnotstrictly containedinanyothermatching.Itiswellknownthatamaximalmatching achievesafactor2approximationofthemaximummatching.Formaintaining maximalmatchinginfullydynamicenvironment,IvkovicandLloyd[14]designed adeterministicalgorithmthattakes O ((n + m)0 7072 )updatetime.Recently,a randomizedalgorithmhasbeendesignedforfullydynamicmaximalmatching thattakesexpectedamortized O (log n)updatetime[2].Wenowprovideasketch ofthisalgorithmnow.

Inordertomaintainamaximalmatching,itsufficestoensurethatthereis noedge(u,v )inthegraphsuchthatboth u and v arefreewithrespecttothe matching M.Therefore,anaturalapproachformaintainingamaximalmatching istomaintainwhethereachvertexismatchedorfreeateachstage.Whenanedge (u,v )isinserted,weadd(u,v )tothematchingif u and v arefree.Forthecase whenanunmatchededge(u,v )isdeleted,noactionisrequired.Otherwise,for both u and v wesearchtheirneighbourhoodsforanyfreevertexandupdatethe matchingaccordingly.Itfollowsthateachupdatetakes O (1)computationtime exceptwhenitinvolvesdeletionofamatchededge;inthiscasethecomputation timeisoftheorderofthesumofthedegreesofthetwoendpointsofthedeleted edge.Sothistrivialalgorithmisquiteefficientfor small degreevertices,butcould beexpensivefor large degreevertices.Analternateapproachcouldbetomatcha freevertex u witharandomlychosenneighbour,say v .Followingtheadversarial model,itcanbeobservedthatanexpecteddeg(u)/2edgesincidentto u willbe deletedbeforedeletingthematchededge(u,v ).Sotheexpectedamortizedcost peredgedeletionfor u isroughly O deg(u)+deg(v ) deg(u)/2 .Ifdeg(v ) < deg(u),thiscost is O (1).Butifdeg(v ) deg(u),thenitcanbeasbadasthetrivialalgorithm.To circumventthisproblemanovelconcept,called ownership ofedgesisdeveloped in[2].Intuitively,weassignanedgetothatendpointwhichhas higher degree.

Theideaofchoosingarandommateandthetrivialalgorithmdescribedabove canbecombinedtogethertodesignasimplealgorithmformaximalmatching. Thisalgorithmmaintainsapartitionoftheverticesintotwolevels.Level0 consistsofverticeswhichown fewer edgesandwehandletheupdatesthere usingthetrivialalgorithm.Level1consistsofvertices(andtheirmates)which own larger numberofedgesandweusetheideaofrandommatetohandletheir updates.This2-levelalgorithmachieves O (√n)expectedamortizedtimeper update.Acarefulanalysisofthe2-levelalgorithmsuggeststhata finer partition ofverticesamongmorenumberoflevelscanhelpinachievingafasterupdate time.Thisleadstothelog 2 n-levelalgorithmthatachievesexpectedamortized O (log n)timeperupdate.

6Conclusion

Wefirmlybelievethatrandomizationwillcontinuetobeanimportanttoolfor designingefficientalgorithmfornewproblemsondynamicgraphs.Itmightalso playacrucialroleinimprovingand/orsimplifyingtheexistingdeterministic algorithmsforsomewellstudieddynamicgraphproblems.Onesuchproblem isfullydynamicall-pairsshortestpaths[5, 20].Thisfundamentalproblemtruly deservesasimplerandmoreefficientalgorithm.

Acknowledgments. TheauthorisgratefultoKeertiChoudharyforhervaluable commentsandsuggestionsonapreliminarydraftofthisarticle.

References

1.Choudhary,K.,Baswana,S.:OndynamicDFStreeindirectedgraphs.In:Italiano, G.F.,Pighizzini,G.,Sannella,D.T.(eds.)MFCS2015.LNCS,vol.9235,pp.102–114.Springer,Heidelberg(2015)

2.Baswana,S.,Gupta,M.,Sen,S.:FullydynamicmaximalmatchinginO(log n) updatetime.SIAMJ.Comput. 44(1),88–113(2015)

3.Baswana,S.,Hariharan,R.,Sen,S.:Improveddecrementalalgorithmsformaintainingtransitiveclosureandall-pairsshortestpaths.J.Algorithms 62(2),74–92 (2007)

4.Baswana,S.,Khurana,S.,Sarkar,S.:Fullydynamicrandomizedalgorithmsfor graphspanners.ACMTrans.Algorithms 8(4),35(2012)

5.Demetrescu,C.,Italiano,G.F.:Anewapproachtodynamicallpairsshortestpaths. J.ACM 51(6),968–992(2004)

6.Eppstein,D.,Galil,Z.,Italiano,G.F.,Nissenzweig,A.:Sparsification-atechnique forspeedingupdynamicgraphalgorithms.J.ACM 44(5),669–696(1997)

7.Even,S.,Shiloach,Y.:Anon-lineedge-deletionproblem.J.ACM 28(1),1–4(1981)

8.Frederickson,G.N.:Datastructuresforon-lineupdatingofminimumspanning trees,withapplications.SIAMJ.Comput. 14(4),781–798(1985)

9.Gottlieb,L.-A.,Roditty,L.:Improvedalgorithmsforfullydynamicgeometricspannersandgeometricrouting.In:SODA,pp.591–600(2008)

10.Henzinger,M.,Krinninger,S.,Nanongkai,D.:Decrementalsingle-sourceshortest pathsonundirectedgraphsinnear-lineartotalupdatetime.In:FOCS,pp.146–155 (2014)

11.Henzinger,M.,Krinninger,S.,Nanongkai,D.:Sublinear-timedecrementalalgorithmsforsingle-sourcereachabilityandshortestpathsondirectedgraphs.In: STOC,pp.674–683(2014)

12.Henzinger,M.R.,King,V.:Randomizedfullydynamicgraphalgorithmswithpolylogarithmictimeperoperation.J.ACM 46(4),502–516(1999)

13.Holm,J.,deLichtenberg,K.,Thorup,M.:Poly-logarithmicdeterministicfullydynamicalgorithmsforconnectivity,minimumspanningtree,2-edge,andbiconnectivity.J.ACM 48(4),723–760(2001)

14.Ivkovic,Z.,Lloyd,E.L.:Fullydynamicmaintenanceofvertexcover.In:WG,pp. 99–111(1994)

15.Kapron,B.M.,King,V.,Mountjoy,B.:Dynamicgraphconnectivityinpolylogarithmicworstcasetime.In:SODA,pp.1131–1142(2013)

16.King,V.,Sagert,G.:Afullydynamicalgorithmformaintainingthetransitive closure.J.Comput.Syst.Sci. 65(1),150–167(2002)

17.Roditty,L.,Zwick,U.:Improveddynamicreachabilityalgorithmsfordirected graphs.SIAMJ.Comput. 37(5),1455–1471(2008)

18.Roditty,L.,Zwick,U.:Dynamicapproximateall-pairsshortestpathsinundirected graphs.SIAMJ.Comput. 41(3),670–683(2012)

19.Thorup,M.:Decrementaldynamicconnectivity.J.Algorithms 33(2),229–243 (1999)

20.Thorup,M.:Worst-caseupdatetimesforfully-dynamicall-pairsshortestpaths. In:STOC,pp.112–119(2005)

21.Thorup,M.:Fully-dynamicmin-cut.Combinatorica 27(1),91–127(2007)

AlgorithmsforProblemsonMaximum DensitySegment

Md.ShafiulAlamandAsishMukhopadhyay(B)

SchoolofComputerScience,UniversityofWindsor, Windsor,ONN9B3P4,Canada {alam9,asishm}@uwindsor.ca

Abstract. Let A beasequenceof n orderedpairsofrealnumbers(ai ,li ) (i =1,...,n)with li > 0,and L and U betwopositiverealnumbers with0 <L U .Asegment,denotedby A[i,j ], 1 i j n,of A isaconsecutivesubsequenceof A betweentheindices i and j (i and j included).Thelength l [i,j ],sum s[i,j ]anddensity d[i,j ]ofasegment A[i,j ]are l [i,j ]= j t=i lt , s[i,j ]= j t=i at and d[i,j ]= s[i,j ] l[i,j ] respectively.Asegment A[i,j ]isfeasibleif L l [i,j ] U .Thelengthconstrainedmaximumdensitysegmentproblemistofindafeasiblesegmentofmaximumdensity.Wepresentasimplegeometricalgorithm forthisproblemfortheuniformlengthcase(li =1forall i),with timeandspacecomplexitiesin O (n)and O (U L +1)respectively. The k length-constrainedmaximumdensitysegmentsproblemistofind the k mostdenselength-constrainedsegments.Fortheuniformlength case,weproposeanalgorithmforthisproblemwithtimecomplexityin O (min{nk,n lg(U L +1)+ k lg 2 (U L +2),n(U L +1)}).

Keywords: Biomolecularsequenceanalysis · Maximumdensitysegment · Computationalgeometry · Slopeselection · Datastructure

1Introduction

Let A beasequence(ai ,li )(i =1,...,n)of n orderedpairsofrealnumbers ai ,calledvalues,and li > 0,calledlengths,and L,U twopositiverealnumbers with0 <L U .Asegmentof A,denotedby A[i,j ], 1 i j n,isa consecutivesubsequenceof A betweentheindices i and j ,bothinclusive.The length l [i,j ],sum s[i,j ]anddensity d[i,j ]ofasegment A[i,j ]are l [i,j ]= j t=i lt , s[i,j ]= j t=i at and d[i,j ]= s[i,j ] l[i,j ] respectively.Afeasiblesegmentof A isa segment A[i,j ]suchthat L l [i,j ] U .Inthispaperwestudythefollowing problems.

Problem1. Thelength-constrainedmaximumdensitysegmentproblemisto findafeasiblesegment A[i,j ] ofmaximumdensity d[i,j ].

A.Mukhopadhyay—ResearchsupportedbyanNSERCdiscoverygrantawardedto thisauthor.

c SpringerInternationalPublishingSwitzerland2016 S.GovindarajanandA.Maheshwari(Eds.):CALDAM2016,LNCS9602,pp.14–25,2016. DOI:10.1007/978-3-319-29221-2 2

Whenthelengthsareuniform(i.e., li =1)and U and L arearbitrary, Goldwasser etal. [7]gavean O (n)timealgorithm.Forthecaseofnon-uniform lengthsandarbitrary U and L,Goldwasser etal. [8]extendedtherightskew decompositionmethodofLin etal. [11]todevelopan O (n)-timeandspacealgorithm.Anonline,combinatorialalgorithmwithtime-complexityin O (n)and spacecomplexityin O (m),where m isthemaximumofthenumberofelements inasegmentoflength U L,wasproposedin[4].Italsopointedoutaflawin thelinearityclaimofageometry-basedalgorithmbyKim[9].Lee etal. [10]fixed thisflawbyexploitingthepropertyofdecomposabilityofatangentquery,and proposedarevisedalogorithmwithtimeandspacecomplexitiesin O (n).Inthis paper,wepresentasimplemodificationofKim’salgorithm[9]thatredressesthe flawusingabatchedmodeapproach,whileretainingthesimplicity,eleganceand linearityofhisgeometricapproach.Fortheuniformlengthcaseandarbitrary L and U ,thetimeandspacecomplexitiesofouralgorithmarein O (n)and O (U L +1)respectively.

Asanaturalextension,weconsiderthe k length-constrainedmaximumdensitysegmentsproblem,definednext:

Problem2. Givenapositiveinteger k suchthat 1 k totalnumberoffeasiblesegments,the k length-constrainedmaximumdensitysegmentsproblemisto find k feasiblesegments A[i,j ] suchthattheirdensities d[i,j ] arethe k largest.

Ourproposedalgorithmsolvesthisproblemfortheuniformlengthcaseand arbitrary L and U in O (min{nk,n lg(U L +1)+ k lg 2 (U L +2),n(U L +1)}) time.Itsspacecomplexityisin O (U L + k ), O ((U L +1)lg(U L +2)+ k ) or O (k ),dependingonthevalueof k .

Theproposedalgorithmscanbeextendedtothenon-uniformcaseasalso tohigherdimensionsbyreducingthemto1-dimensionalproblemsasdescribed in[2, 16].Thesediscussionsareomittedforlackofspace.

Theratio(C + G)/(A + C + G + T )isameasureoftheGCcontentofa DNA-sequence,where A,C,G,T arethenucleotidebases.Accordingto[12, 15] thecompositionalheterogeneityofagenomicsequenceisstronglycorrelated toitsGCcontentregardlessofgenomesize.Ithasalsobeenfoundthatgene length[5],genedensity[17],patternsofcodonusage[14]andotherproperties arerelatedtoGCcontent.However,itisnotestablishedthatthesinglemost denseregionistheonlymeaningfulregion.OthersegmentswithhighGCcontentmightalsobemeaningful.Ourproposedalgorithmscanbeusedtofind lengthconstrainedCG-richregionswiththemaximumdensityand k maximum densityinaDNAsequenceefficiently.

InSect. 2 wedescribeouralgorithmforthemaximumdensitysegmentproblem.Ouralgorithmforthe k maximumdensitysegmentsproblemispresented inSect. 3.ConcludingremarksaregiveninSect. 4.

2SPLITHULLAlgorithmforMaximumDensity Segment

Theprefixsumsofthesequence A,definedby s0 =0and si = i t=1 at for 1 i n,arecomputableinlineartime.Define n +1pointsintheplanethus:

pi =(i,si ),0 ≤ i ≤ n.Thedensityofasegment A[i,j ]isthenequaltoslopeof thelinesegmentthroughthepoints pi 1 and pj .Thisreducesourproblemto findingasegment pi pj oflargestslope. Themainideaunderlyingthenewalgorithmistoconsidertherightend points pj (for U j n)ofallfeasiblesegments pi pj inbatchesofafixedsize. Foreach pj ,insteadofcomputingasinglelowerconvexhullofthefeasibleset ofleftpoints pi ,wecomputetwolowerconvexhulls-aleftoneandarightone. Thesestartat2adjacentpoints pm 1 and pm , j U +1 m j L +1,going leftandrightrespectively.Therightlowerhullsarecomputedincrementallyin aleft-to-right(LR)passforabatchedset pj ,andthelefthullsinaright-toleft(RL)passforthesamebatchedset.Thispre-emptsadynamicconvexhull updateproblemthatarisesinKim’salgorithm[9].Notethatthepoints pj with L ≤ j ≤ U 1canbehandledinasingleLRpass.Thecorrectnessofthisscheme followsfromthefollowingobservation:

Observation1. Forapoint pj ,U j n, let Gj bethesetofthecandidate leftendpoints pi ofallfeasiblesegments.If Gj 1 and Gj 2 areany2subsetsof Gj suchthat Gj = Gj 1 ∪ Gj 2 , then

Weconsidertherightendpoints pj , j U ,inbatchesofsize U L +1. Thedetailsofthe LR and RL passesforabatchofrightendpoints pj , j ∈ [k,k + U L], k U ,aredescribedbelow.

2.1LRPass

Inthispass,weprocesstherightendpoints pj , j ∈ [k,k + U L],lefttoright. Foreachnewpoint pj , j ∈ [k,k + U L],thecurrentLowerConvexHull(LCH) Hr isdynamicallyupdatedbytheinsertionofanewpointontherightof Hr FollowingKim[9],wemaintain2parameterstoaidtheincrementalcomputation: atangentline l tothecurrenthull Hr withthemaximumslopefoundsofar,and thepointofcontact α of l with Hr .Theline l isalwaysrepresentedbyapairof pointsanditsslopeisthecurrentmaximumdensityforthisbatchofpoints pj . Initially, Hr = {pk L }, l = pk L pk and α = pk L .Assumethat Hr , l and α havebeencomputedfortherightendpoint pj .Forthenextpoint pj +1 ,theseare updatedasfollows. Hr isresetto Hr = LCH (Hr ,pj +1 L ).Theupdated Hr is traversedcounterclockwisefrom α (orfromthenewlyinsertedhullpoint pj +1 L , if α hasbeendeletedfrom Hr )tofindthenewtangentline l ofmaximumslope sofar,andthenewpointofcontact α on Hr withtheupdated l .Wehaveto consider4cases:

Case1: Both pj +1 L and pj +1 areabove l Hr isfirstupdatedandthentraversedcounterclockwisefromthecurrent α tothepointofcontactofthetangentfrom pj +1 to Hr .Thistangentline anditspointofcontactaresettobethenew l and α respectively.

Case2: pj +1 L isabove,and pj +1 isonorbelow l . Hr isupdated.However, α and l remainunchanged.

Case3: pj +1 L isonorbelow l Hr isupdated.Let l bealinethrough pj +1 L andparallelto l .Let pj +1 be above l ;reset l = pj +1 L pj +1 and α = pj +1 L

Case4: pj +1 L isonorbelow l ,and pj +1 isonorbelow l . Hr isupdated.Set l to l and α = pj +1 L .

Eachpointintheleftwindow {pk L ,pk +1 L ,...,pk +U 2L } isaddedtoan Hr once,anddeletedatmostoncefromasubsequent Hr .Notingthat α never movesleft,foranewpoint pj ,if α remainsstationary(asinCase2above),the costofcomputationisconstantandischargedtothepoint pj L thatisaddedto thehull.Considerthecaseinwhich α movescounterclockwise(andthusright) alonganupdatedhull Hr .Eachpointon Hr isaccessedatmostonceduring therecomputationof α,sinceitnevermovesleft.Thecostofrecomputing α is chargedtothehullpointsthatarepassedoveraswemovecounterclockwiseon Hr fromthecurrent α,andthecostofdeletingthepointson Hr ontheleftof α arechargedtothem.Thus,eachpoint pi intheleftwindowischargedatmost3 times:2timesforinsertionintoanddeletionfrom Hr andonceforbeingpassed overby α.So,thecostforthispassislinearinthenumberof pj ’sconsidered.

2.2RLPass

Inthispass,weprocesstherightendpoints pj , j ∈ [k,k + U L 1],rightto left.Foreachnewpoint pj , j ∈ [k,k + U L 1],thecurrentLowerConvex Hull(LCH) Hl isdynamicallyupdatedbytheinsertionofanewpoint pj U on theleftof Hr

AsintheLRpass,wemaintainatangentline l andthepointofcontact α of l withthecurrenthull Hl toaidtheincrementalcomputation.

Initially, Hl = {pk L 1 }, l = pk L 1 pk +U L 1 and α = pk L 1 .Assume that Hl , l and α havebeenupdatedfortherightendpoint pj .Forthenext rightendpoint pj 1 ,theseareupdatedasfollows. Hl isupdatedbyinserting thepoint pj 1 U ontheleftsothat Hl = LCH (pj 1 U ,Hl ).Theupdated Hl is traversedcounterclockwisefrom α (orfromthenewlyinsertedhullpoint pj 1 U -if α isdeletedfrom Hl )tofindthenewtangentline l havingthemaximum slopefoundsofar,andthenewpointofcontact α on Hl withtheupdated l . Again,thereare4casestoconsider:

Case1: pj 1 U isonorabove l ,and pj 1 isabove l . Hl isupdated.Wetraverse Hl counterclockwisefrom α tofindatangentto itfrom pj 1 .Wereset l tothistangentlineand α tothepointofcontact betweenupdated l and Hl

Case2: pj 1 U isonorabove l ,and pj 1 isonorbelow l . Hl isupdated.However, α and l remainunchanged.

Case3: pj 1 U isbelow l Hl isupdated.Let l bealinethrough pj 1 U andparallelto l .Let pj 1 be above l

Another random document with no related content on Scribd:

Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.
Algorithms and discrete applied mathematics second international conference caldam 2016 thiruvananth by Ebook Home - Issuu