I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86 Publhe Ole Augut 203 MECS (http://www.mec-pe.og/) DOI: 0.585/jtc.203.09.08 A Appoach Degee Cotat MST Algothm Sajay Kuma Pal Depatmet Compute Sc. a Applcato, NSHM College Maagemet a Techology, Kolkata, Ia E-mal: abojay@gmal.com Sama Se Sama Depatmet Compute Scece a Egeeg, Uvety Calcutta, Kolkata, Ia E-mal: ama200@gmal.com Abtact Th pape appoachg a ew techque ceatg Mmal Spag Tee bae o egee cotat a mple ymmetc a coecte gaph G. Hee we ecomme a ew algothm bae o the aveage egee equece facto the oe the gaph. The tme complexty the poblem le tha O( N log E ) compae to the othe extg tme complexty algothm OE E C log Kukal, whch optmum. The goal to eg a algothm that mple, gaceful, eouceful, eay to ueta, a applcable vaou fel tatg fom cotat bae etwok eg, moble computg to othe fel cece a egeeg. Iex Tem Gaph, Tee, Mmal Spag Tee, Algothm, Aveage Degee Sequece I. Itoucto Combatoal algothm coce the poblem pefomg computato o cete, fte mathematcal tuctue. The ubject combatoal algothm te efee a combatoal computg, eal wth the poblem computg cete mathematcal tuctue. It a ew fel eve fom ytematc boy kowlege about the eg, mplemetato, a aaly algothm appeae fom a collecto tck tct algothm. Combatoal computg ha a mpotat ole fo epeetato a olvg the gaph theoy poblem lke geeato all tee a clque etc. Gaph theoy algothm ca be tace back ove oe hue yea to whe Fleuy gave a ymmetc metho fo tacg a Eulea gaph a G. Tay howe how to ecape fom a maze. Dug the 20 th cetuy uch algothm ceagly came to the ow, wth the oluto uch poblem a the hotet a loget path poblem, the mmum coecto poblem, a the Chee potma poblem. I each thee poblem we ae gve a etwok, o weghte gaph, to each ege whch ha bee age a umbe, uch a t legth o the tme take to tavee t. Gaph theoy, a mpotat bach egeeg ha we applcato the fel chemty, compute cece, moble computg, etwokg, ocal cece, cyptogaphy a may moe. Geeato all tee a gaph eve fabulou a t a k NP-complete poblem. Solvg th type poblem we geeally ue ome heutc appoach a t ha applcato topology eg a etwokg. Lt ome NPcomplete poblem ae gve the ecto 4 th pape. Thee ae eveal algothm to geeate mmal pag tee a weghte gaph lke Kukal, Pm algothm a ome ew algothm alo covee whch optmal epect executo tme compag to the extg oe. Gaph theoy f we fluece compute cece a mathematc. Gaph, epecally tee a bay tee ae wely ue the epeetato ata tuctue [, 2, 3, 4]. A Tee a coecte lea gaph wthout ay ccut. The cocept a tee the mot mpotat the gaph theoy, epecally fo thoe teete applcato gaph. A lea gaph G=(V, E) cot a et object V={v, v 2, v 3,..} calle vetce, a aothe et E={e, e 2, e 3, } calle ege, uch that each ege e k etfe wth a uoee pa (v, v j ) vetce. A tee othg but a mple gaph that, havg ethe a elf-loop o paallel ege. Tee appea umeou tace. The geealogy a famly te epeete by mea a tee. I fact the tem tee come fom famly tee. I may otg poblem we have oly two alteatve at each temeate vetex, epeetg a chotomy, uch a lage o mall, goo o ba, 0 o. Such a eco tee wth two choce at each vetex occu fequetly compute pogammg a wtchg theoy. The cocept tee appeae mplctly the wok Gutav Kchhf (824-887), who employe gaph theoetcal ea the calculato cuet the electcal etwok o ccut. The eumeato Copyght 203 MECS I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86
A Appoach Degee Cotat MST Algothm 8 techque volvg tee ft aoe coecto wth a poblem the ffeetal calculu, but they oo came to the fuametal tool the coutg chemcal molecule, a well a povg a facatg topc teet the ow ght. Cayley wa le by the tuy the patcula aalytcal fom ag fom ffeetal calculu to tuy a patcula type gaph, the tee. Th tuy ha may mplcato theoetcal chemty. Th volve techque maly cocee the eumeato gaph havg patcula popete. Athu Cayley (82-895), Jame J. Sylvete (806-897), Geoge Polya (887-995), a othe ue tee to eumeate chemcal molecule. Recetly, a we vaety ew eult combatoal eumeato have bee obtae. May thee eult wee pomte by ew poblem compute cece, whle othe awee ol queto combatoc a othe fel. The am to uvey o htoy tee a a ubet the ew eult, amely thoe ealg wth tee eumeato. A Spag Tee a tee a coecte gaph G, whch coect all vetce the gaph. If G a coecte gaph vetce, the pag tee ae the ubet - ege that cota o cycle; equvaletly they ae ubet ege that fom a fee tee coectg all the vetce. Spag tee ae mpotat may applcato, epecally the tuy etwok, o the poblem geeatg all pag tee ha bee teate by may autho. I fact, ytematc way to lt them all wee evelope ealy the 20 th cetuy by Wlhelm Feue (Aale e Phyk, 902, 304-329), log befoe ayboy thought about geeatg othe k tee. Geeato a gle pag tee fo a mple, ymmetc a coecte gaph G, a clacal, a oe polyomal tme olvable poblem [5, 6]. The goal optmzato mmal pag tee to f a appopate oluto [, 7]. Whe tuyg vee poblem, oe te make a aumpto geeal poto: fo mmal pag tee, oe ca ftemally petub the tct ege weght th way to chooe out a uque oluto. Seveal algothm ext fo geeato Mmal Spag Tee [8]. I Otaka Bouvka algothm fg a Mmal Spag Tee a gaph, all the ege weght ae tct. I 957, Compute Scett C. Pm covee aothe algothm that f a mmal pag tee fo a coecte weghte gaph [8]. Th algothm cotuouly ceae the ze a tee tatg wth a gle vetex utl t pa ove all the vetce. Th algothm wa actually covee 930 by mathematca Vojtech Jak. Smlaly Joeph Kukal a Ege Djkta 959 have gve ffeet algothm about fg mmal pag tee. I 98 coautho Sama Se Sama touce a algothm h pape fo geeato all pag tee a mple coecte gaph. Thee o poblty uplcty f the pag tee geeate by th algothm, a alo pohbt geeato all the o-tee ub-gaph. Aga 2007, autho have cue a algothm e whee tee ae geeate by pobg C et ege whee e the umbe ege a the umbe vetce a mple coecte gaph elmatg ome et ege whch fom ccut [9]. Th pape eveal a ew algothm fo ceatg mmal weght pag tee a gaph whch eque le executo tme a memoy pace compae to the extg algothm. The algothm bae o the egee facto the egee equece a the weght ege the gaph G. A equece, 2, 3,..., oegatve tege calle a egee equece gve gaph G, f the vetce G ca be labele v, v2, v3, v, v o that egee v, 2, 3, 4 ; fo all,...,. The um the tege equal to 2e, whee e the umbe ege a gaph G [0]. Fo a gve gaph G, a egee equece G ca be ealy calculate. Now the poblem ae that, gve a equece,,,...,, 2 3 4 oegatve tege, ue what coto oe thee ext a gaph G? A eetal a aequate coto fo a equece to be gaphcal wa fou by Havel a late ecovee by Hakm. Bae o the above vew we commece a ew metho to f out a mmal pag tee a gaph G coeg egee equece facto the oe a cotat. The tme complexty a pace complexty the ew algothm ae optmal compao to the algothm Kukal a Pm. I ecto 2, the pape cove ome bac temology ue the pape. The bac techque ue to geeate the MST algothm ha bee ecbe ecto 3. It ha bee followe by ome theoem a fouato the logc evelopmet a uetag the pape. Secto ecbe the algothm egee cotat MST (ma theme th pape) a ecto 5, ecbe ccut tetg algothm whch ue to mplemet the ma algothm. The complexty the ew algothm ha bee ecbe ecto 6. I ecto 7, we have peete executo tme Kukal, Pm, a ew algothm a pat the compaatve tuy a aaly executo tme betwee algothm. Fally, efeece have bee gve at the e the pape whch ha helpe u to get a ecto. II. Temology I th ecto bac temology ha bee gve whch ue the ext pat th pape. 2. Gaph A uecte, mple, coecte gaph G a oee tple (V(G), E(G ), f) cot Copyght 203 MECS I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86
82 A Appoach Degee Cotat MST Algothm a o empty et vetce a et ege e E gaph G a V the gaph G a mappg f fom the et ege E to a et uoee pa elemet V. 2.2 Tee: A tee T a gaph G a mple, coecte a acyclc gaph havg exactly oe path betwee the vetce o that we ca tavee ay vetex to ay othe vetce alog the ege. I othe wo, a tee a mple coecte gaph wthout ay elf-loop o paallel ege. 2.3 Spag Tee A Spag Tee S a tee a coecte gaph G, whch touche all vetce the gaph. A pag tee ha vetce a exactly (-) ege a gaph G. 2.4 Mmal Spag Tee Let G be a coecte, ege-weghte gaph. A mmal pag tee a ubgaph G that atfe the followg popete: It a tee, that, t coecte a ha o cycle. It pag, that, t cota all vetce G. It ha mmal total ege-weght amog all poble tee. Noe Degee Facto Sum Degee all oe eg ee a oe ( ) 2.8 Aveage Degee It the ato betwee ummato egee all oe the gaph G to umbe oe.e. Ava age Degee v a Summeto Degee oe gaph Total umbe oe 2.9 Realzato A equece, 2, 3,..., oegatve tege a to be gaphc equece f thee ext a gaph G whoe vetce have egee a G calle ealzato ξ. 2.5 Ajacecy Matx Fo a gaph G vetce a e ege, f, et vetce, V(G) = {v, v 2, v 3,, v } a et ege E(G) = {e, e 2, e 3,, e }. The ajacecy matx A, weghte gaph G, matx a t ca be epeet by A = [a j ], whee wj f thee a ege betwee v, v j E( G) aj 0 f thee o ege 2.6 Degee a Vetex The egee a vetex v a gaph G the umbe ege coecte wth v. I othe wo, egee the umbe vetce ajacet to the vetex v. 2.7 Noe Degee Facto It the ato betwee ummato egee oe gaph G to egee a oe / vetex.e. III. Mmal Spag Tee Geeato A tee havg oe a - ege pag tee a gaph. A pefeable a effcet algothm oe that geeate tee by electg oly the mmal cot ege the gaph a alo by ot poucg cycle. The peet algothm tll eque to tet ccut fo ome cae. Th ew algothm moe effcet tem the eque executo tme. I th algothm, ft we calculate aveage egee each oe a the etfy a oe v k havg egee equal to aveage egee v a o moe the gaph. Th wll etfy a oe the gaph G a a ege havg mmum weght ege cet o t. Th mmum weght ege cet to vetex v k, to be clue the lt cotuctg mmal pag tee (S), f the ege oe ot fom ccut S a ot electe pevouly. Theoem : A pag tee S a weghte coecte gaph G the mmal weght pag tee f a oly f thee ext o othe pag tee G at a tace oe fom S whoe weght malle tha that S. Po: Let S be a pag tee gaph G atfyg the hypothe the theoem thee o Copyght 203 MECS I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86
A Appoach Degee Cotat MST Algothm 83 pag tee at a tace oe ( G) fom S whch malle tha S. If S2 a mallet pag tee G, the weght S wll alo be equal to that S2. The pag tee S2 mallet f a oly f, t atfe the hypothe the theoem. Suppoe, a ege e S2 electe bae o the leat weght the vetex the gaph G but t ot S. Ag e to S fom a fuametal ccut wth bache S. Some the bache S that fom fuametal ccut wth e S2; each the bache S ha weght ethe malle tha o equal to e becaue S mmal weght. Amogt all thee ege ccut but ot S2, at leat oe, ay b, mut fom fuametal ccut S2 cotag e. So, b mut have ame weght a e. Theefoe, pag tee S ( S ( e b)), obtae fom S, though oe cycle exchage, ha ae weght a S. S ha oe moe ege commo wth S2 a t atfe the coto theoem. Theoem 2: A ege e coepog to the vetex mmal weght the gaph G fom a pag tee, f t ha mmal weght. Po: A pag tee S a gaph G cota all the vetce (exactly oce) a - ege, whee the umbe vetce. A ege e to be electe bae o the weght the vetex. The weght a oe how the aveage weght the ege cet to t. The mmal weght the vetex cate that thee mut have at leat oe ege whoe weght mmal a t coul clue the pag tee S, f a oly f, at leat oe e vetex ot yet coloe (clue S). To avo the geeato fuametal ccut the mmal pag tee S, we elect oly thoe ege whoe, at leat oe vetex ot yet coloe. If ege e fom fuametal ccut mmal pag tee S the we wll elect aothe ege coepog to the ame vetex whoe weght ethe equal to o jut hghe tha ege e. Theoem 3: The combato - tct ege fome pag tee accog to theoem, f t ccut le. Po: The - ege combato a gaph mut cota all the vetce the gaph. Th combato ethe cota a ccut o a pag tee the gaph. Thu to aceta t calm a pag tee ccut tetg eceay. Theoem 4: A ege e coepog to the oe hghet egee facto the gaph G fom a pag tee, f t ha mmal weght. Po: A pag tee S a gaph G cota all the vetce (exactly oce) a - ege, whee the umbe vetce. A ege e to be electe bae o the egee facto the oe. The egee facto the oe how how may ege ae cet to a patcula oe. The hghet egee facto a oe, the umbe ege cet to whch mmum wth at leat oe ege whoe weght mmal, to be clue the mmum pag tee S. Theoem 5: A Sequece,, oegatve tege D,..., wth, 2 3 4 2 3 4..., 2, gaphcal f a oly f the equece,,,...,,,..., D 2 3 4 2 gaphcal []. Po: Let D a gaphcal equece. Thee ext a gaph G oe, uch that D the egee equece G. Theefoe, the vetce G ca be labele a V,V,., ; uch that 2 3 V ; 2 eg( V ) ; 2 A ew gaph G ca be cotucte by ag a ew vetex V a the ege VV ; 2. eg(v ) fo D, 2, 3,, gaphcal. The G, a o Coveely, let D be a gaphcal equece. Hece thee ext gaph oe wth egee equece D. Amog all uch gaph let G be oe, uch V(G) V, V, V, V,, ; that 2 3 4 V eg(v ) fo,2,3,., a the eve umbe, the um egee the vetce ajacet wth V maxmum. We how ft that V ajacet to vetce havg egee, 3,,. 2 Suppoe, to the cotay, that V ot ajacet to vetce havg egee 2, 3,,. The thee ext vetce V a V wth uch that V ajacet tov, but ot tov. Sce, the egee V excee that V, thee ext a vetex V t, uch that V ajacet to V but ot to V. Removg the t egee a V V a V Vt a ag the ege V V V Vt eult a gaph G havg the ame egee equece a G. Howeve, G the um the egee the vetce ajacet to V lage tha that G, cotactg the choce G. Thu, V ajacet Copyght 203 MECS I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86
84 A Appoach Degee Cotat MST Algothm wth vetce havg egee 2, 3,,, a the gaph (G - V ) ha egee equece D, o D gaphcal. Theoem 6: If a ubgaph - ege cota moe tha thee oe egee moe tha oe a f thee o peet ege the gaph, the ubgaph cota a ccut. Po: Fo mplcty a to expla the theoem ealy, we take to coeato a mple coecte gaph a how the fgue gve below. I the above combato, thee ae two vetce egee oe a thee vetce egee moe tha oe, hece th combato may gve the ccut. Deletg peet ege cece o vetex a a b, the me egee all the vetce ae, Sce, the egee all the thee vetce ae moe tha oe, th cme that the ege combato wll pouce a ccut. The pctoal fom th combato how fgue 3. Fg. : A Smple Coecte uecte Gaph Fg 3: A Illutatve Ccut Gaph how Fg. Fom the gve gaph fgue, f we coe the ege combato, 4 5 6 2, the egee each vetce coepog to the gve ege combato ae, Sce thee ae thee vetce egee oe a oly two vetce egee moe tha oe, hece th - ege combato wll ot pouce a tee the gaph G. The pctoal fom th tee how the fgue gve below. Fg 2: A Illutatve Tee Gaph how fg. Coeg aothe example, f ege combato, 0 3 5 6 2, the gaph how fgue, the egee each vetce coepog to the gve ege combato ae, IV. Algothm Cotat bae Mmal Spag Tee Geeato Itally we geeate aom weghte gaph accog to the gve umbe oe a ege ety. The weght matx the aomly geeate gaph ue a put fo geeato mmal pag tee the gaph. The output the algothm mmal weght pag tee (S) whee each oe the gaph epeete by the ege umbe fom 0,,2,..,. The weght, w the ege toe the ajacecy matx f thee a ege betwee the oe. Step 4.: Geeate aom weghte gaph a coepog weght matx accog to the gve umbe oe a ege ety. Step 4.2: Calculate aveage egee (v a ) oe ug the fomula how ecto 2.8. Sce aveage egee oe v a theefoe, maxmum egee a oe cotuctg mmal pag tee wll be coe lowe value v a.e.. Step 4.3: Select ay oe v k havg aveage egee v a o moe gaph G, fo cotucto mmal pag tee. Step 4.4: Select a mmum weght ege e whch ajacet to oe v k, put th ege to cotuctg MST, o that the ege o ot fom ccut a egee v k coul ot be moe tha aveage egee v a. Copyght 203 MECS I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86
A Appoach Degee Cotat MST Algothm 85 Step 4.5: Cotuct ew gaph G emovg the ege aleay electe cotuctg mmal pag tee a ag G to G. Step 4.6: Apply teatvely tep 3 to tep 5, tll (-) ege ae ot electe to cotuctg Mmal Spag Tee. Step 4.7: Calculate um the weght the ege the cotuctg MST, S. Step 4.8: Dplay/toe output. Step 4.9: Stop. comple ue fo complato a executo pupoe. The expemet ha bee pefome o eveal gaph ffeet type. The toage equemet th algothm 2 popotoal to ( ). The expemetal eult the algothm gve Table a compaatve tuy. Table: Executo tme Kukal, Pm a New algothm: No. Noe No. Ege Executo Tme Algothm * 00 ( Seco) Kukal Pm New Algothm 3 3.70.95.7 V. Ccut Tetg Algothm The ccut tetg algothm ue to f out the ccut the cotuctg pag tee gve below. Step 5.: Fom - ege a cece matx egee each oe obtae whch cotbute by - ege ue coeato. Step 5.2: Tetg oe whethe at leat two oe egee oe ext o ot. If ot, tep 6 execute. Othewe the poce cotue. Step 5.3: It tete whethe at leat thee oe egee o moe tha oe peet o ot. If ot, the tep 5 followe. Step 5.4: Peat ege ae elete, f thee extece - ege a the egee the oe ae me accogly a cae o to tep 2. Othewe tep 6 execute. Step 5.5: Ege combato ae tee. Step 5.6: Stop. VI. Complexty the Algothm The Ccut tetg ot eque the mmum pag tee geeato algothm becaue we have alway choe a oe v the gaph G exactly oce fo the MST, S. The otg ege a fg the mmum weght ege eghbo the cotucte tee ot eque. The tme complexty ew algothm O( N log E ) a t euce ue to o equemet checkg ccut geeato tee. The memoy pace eque to execute the pogam 2 ew algothm whee the umbe vetce the gaph G. VII. Reult Aaly a Cocluo Hawae ue to pefom th expemet Petum IV compute a 2 GB DDR2 RAM. The pogam wtte C pogammg laguage a Tubo C 4 4 4.56 4.46 4.52 4 5 4.67 4.72 4.5 5 8 7.36 7.42 7.32 6 2 8.84 8.90 8.62 7 3 8.78 6.75 6.22 7 7 9.2 20.59 8.68 8 25 8.89 8.89 8.40 9 2 24.44 2.75 2.24 9 32 37.35 3.69 30.79 0 8 33.28 32.76 32.04 0 42 38.66 36.80 35.58 27 36.80 36.74 35.53 50 40.8 37.56 36.37 2 20 36.68 37.4 35.62 2 53 5.30 40.32 39.02 3 3 73.60 5.74 50.78 3 70 79.94 55.03 53.4 4 55 7.94 67.87 65.73 4 82 24.68 20.20 7.2 5 32 87.60 73.68 72.69 5 72 2.65 0.85 99.0 6 48 98.25 74.35 72.47 6 08 23.70 8.65 4.0 7 4 2.40 09.30 06.08 7 55 44.75 24.55 20.27 8 76 46.35 25.85 20.02 9 68 77.95 56.80 50. 20 95 37.60 23.8 222.73 2 74 343.80 32.60 292.49 22 69 530.6 292.2 270. 23 26 596.40 336.63 3.32 24 82 56.22 44.02 420.79 25 78 540.34 434.77 408.3 30 30 662.32 66.43 590.33 Copyght 203 MECS I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86
86 A Appoach Degee Cotat MST Algothm Refeece [] N. Deo, Gaph Theoy wth Applcato to Egeeg a Compute Scece, PHI, Eglewoo Clff, N. J., 2007 [2] Thoma H. Coeme, Chale E. Leeo, Roal L. Rvet, Clffo Ste, Itoucto to Algothm, PHI, Seco Eto, 2008 [3] Haowtz Saha & Rajekaa, Fuametal Compute Algothm,Galgota Publcato Pvt. Lt., 2000 [4] J. A. Boy a U. S. R. Muty, Gaph Theoy wth Applcato, The Macmlla Pe, Geat Bta, 976 [5] http://e.wkpea.og/wk/bouvka _algothm, 28 Novembe 202 [6] http://e.wkpea.og/wk/degee_(gaph_theoy ), 24 Septembe 202 [7] ajoy Dagupta, Chto Papamtou, Umeh Vaza, Algothm, Tata McGaw-Hll, Ft Eto, 2008 [8] A. Rakht, A. K. Chouhuy, S. S. Sama a R.K. Se, A Effcet Tee Geeato Algoth m, IETE, vol. 27, pp. 05-09, 98 [9] Sajay Kuma Pal a Sama Se Sama, A Effcet All Spag Tee Geeato Algothm, IJCS, vol. 2, No., pp. 48 59, Jauay 2008 [0] F. A. Mutae-Batle a M. Ru Fot, A Note o egee Sequece Gaph wth etcto, http://upcommo.upc.eu/ept/btteam/27/ 490//equece.pf, 02 Jauay 203 [] Aumugam S. a Ramachaa S., Ivtato to Gaph Theoy, Sctech Publcato(INDIA) Pvt. Lt., Chea, 2002 ffeet teatoal /atoal joual, a moe tha foty yea acaemc a eeach expeece. Autho Ple Sajay Kuma Pal: Atat Peo Depatmet Compute Scece a Applcato ue Wet Begal Uvety Techology, Kolkata. Publhe oe book ame Alluemet Some Gaph Algothm, a havg foty eeach publcato ffeet teatoal/atoal joual, moe tha 9 yea acaemc a twelve yea utal expeece. Sama Se Sama: Peo Depatmet Compute Scece a Egeeg Uvety Calcutta, Kolkata. Autho ha publhe two book, a havg eghty publcato Copyght 203 MECS I.J. Ifomato Techology a Compute Scece, 203, 09, 80-86