0% found this document useful (0 votes)
13 views20 pages

Mfcs Unit 5

Uploaded by

stellamandru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views20 pages

Mfcs Unit 5

Uploaded by

stellamandru
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

5.

GaRAPEH THEORy
Basic concept5
2Gevaph theovy and i application
sul- qhaph»
Graph epentationy
a d j a c e n t y mahun

AIncedence matyiC,
Tsomophit ta
Path circults
E Ueulerean f him ilto nlan ophb
MulH gapho
B1pecth BiPatthite E Plamat 9haphwin',n
(o) Euler's theorem
Cvanh tolbrin k covesîng)
Ch1omadlc numbey
3 spanning tree
Primokushkalsalgorith m
BFs, DPs Apamning eer

(
Crvaph:
Gvaph Consists of Paivs ofVertits ond edges ie
where V repeSrS m0 of non' ernply finite
ueof vevtices nodes and e repesents no of
get linu
finite set of edges o
non empty ec
szuane
Ex tviangle, Rectangle,
1)

the vertex itelf


LOCP: Am edge connectin
Csef loop
Connecting to vertex.

Mulli hNove than One edge

and multigtaph 1
muligaPh
with lops
lo0pS and
Pbeudo A oph
called pseudoaph
no
oith no loops and
Simle glaph: A 7lorh
multighaph
Vu

Divected 9hafh: Vertices and edges epvesen-


0f
Agnaph Conslst Of verice i Calld
Calkd
Ovdered Pa
ted olth
divected gaph
Ordered Pairs (v),(n,vs)(viVs)
ahe

Indeyee: at
Verter i3 called
the Verter ib
No Of edge ending
In degyee B called

al the Verter
Ouldegree beginning
NO o0f
No edges
out degvee
o
Find Indeqta, Ouldegua , tolaldegu ouen ohap
V

Inde glu buttdegtee totad Veve


O 3 3
2

'N

Nult pb:
A haph wth no
edges Called null ghaph
TSolated gnaph:
A ghaph ith no veyhces s colled I90lalted

NulI Graph
Complete taph:
t
Ever yevteyinthe paph
A Evey
A Conneckd
cthey verRI m h 9naph
euevy

A
Edgen (n ) s(5-,
a
5( 0 to
nno o ventce
Bi Parhd graph
A haph I said to be biprkeo háph if

Ver tey v i8 Pantiioned into, v, x V, that


vevte,
oliomt set 9f edges isCOnnecting
S no Connection mteinally e
fUL but theve Or nd two
in V a r e Connecte
mo tuo vevtice
ave Conne cted
veyHices in V

v u u 43,V,,Va Vs,V4 j

V, V3,Vu
V,us
u

ISomeiieah 3aid to be isometvic hen lt


If a 9haph is ie, f f2 9, to9,
Connecton
is an b bijecton to fru)k
Vin is eGuivalent
S a erter uand g should sotle
aphs
fv) in giaph g2. There
of Ve¥Hces Should
be ame.
soma
uley le>no
should: be 8ame
no of edgey vertey
should Je
should
same
k 3ame
at the ,

SDegu

ae
Determine whetheY the givenV grofs
Sometic o not
N
h

Yertices are Same 5

NO edge3 5

at verte
Degvecs

V I t is ISometvíe
laph

fveartces
me

No of edges ape fov O (48


of edges fo - 12
at WerticeN ,,',',',1),/,
Degrees
Degfees at vertHces of a),
I3ometic
Fhishese 2 K
.
b 3

d3
e3
f3
33
h
NO of vertices fov Hgure D o
NO O, veytf ces for figure (i) e 8
edges for fqure= to
NO f
elges for fig uve o tD
NO of
of degvee fov figuw,O
NO of
3
3
b
3 2

d S 3
e G2
f 3 13

h3
20
to tal
20
Iometric haph
a
ITt is

Regular 9taph: allertices


ettces
Rs
s Colhd
Cahd
all
with egual deg ky The degne
aa Ry
degre i6
i
A 9haph
t is, huptisented
fiegulan aph
eitice
2 fa alL have to
and We have
to we
PlananRo-h
intev&eotion,
and hain
m0 gtafhha
with tui
|A 9haph sugion.
om
entria
olbrauw
intersectHon of the adges

eA
n thiB 9taph thou ae 4VeytiCes and c.d
G edo
n this ghaph es. ec au nsectiHng ese
s0 we0
uad ddaur an eztekio uglon 3 es
ulon

Aheel bvaph e
Tt is denoted as Wo. t S Similav to compete
gtaph but the dthem S Centval f ta Vutol
N

octh and Circwt


alk
s
alk t
alteonatin
a
laph
8equence of eLtices amd edges
defined os am

Y.,VV. .Vnthe ro of vertices, ¬se,k.e


no of edges,Beginning and ending with verHer
Only 8uch that ediuh Time e is ident with
Vi tovi+ere Vo iS Called initial verter amd Un
tminal Vertet. The' o OfK ealgesn ha
is Calle d
s knouon a the enth of the WaurSthe
oUk is o then-thi 10aUs has
Alalk 'no
lenah o£ the
it contoains giugle vevfer Suih walk
edg ane
Colled tvivial alk

Vs

N
V-V2-V3 -Vu-vs is a waLK
Ve eaVges Vye» Vs
Dial
Awalk is called *tvial f all edges ane distinct
V
es
VV-v4- V3-V2- vs
e
e e V,eV2et UuezV,e,vz
e
es VS

ath is called ath if all ts


vevtices ae di3in
A walk

V-v2-V3-VyVS
eV2 Vg¬s V,¬y Vs
poth s a.rial but evey ual
Nobt: Gvevy
Mecd not be a fath.

Cosed Path:
A closed ath is a path that stanting amd
etces ane 8ame
ending
V2 -Vy-V2
V,e2 V3e3Vyes V2

Civcut
defined as a closed path
A civcuit or cycle is
that doesnt' Contán repeattd
of non 3exo enth
edge V-V3-Vq-Ys-Va
V e eyvges2

Eularain Gtraph
Eular Path it cove
to be Eules Path if
A Path Is sdid
all disnct edges
Euler circuit
A 3
Civcuit
Civcuit if
S

is called Eule
Eules
Saune
Eules Path
Eules
vexticas
o
and ending
Starting
fa9haph coniot of odd , mo, ofyeytite
with odd dearee Constst only euler Pats
not Euler cir Cuit
conwt of odd no pf vertite wi
a haph then it.ha soth
even degua tAe
Euleypath ciut
V
e
e
es es
V3 e 3 e
V-V-V-Vu _v-V1-V V-V3-Ys-V4V3-V2-y

V-V2-v3 -V-Vy W-Vy

Eula fovmula
I R I 1 E l -l v l+2

sR RegBo n
EEdges
VVeYtices
total no of Yegions
tov thghofk
Find the V

R 5-4 +2
T423 e
V3
V42ib
HOmiltoniam Poth
A Path is Said to be haniltonian if i covnecs
Netfces f the given aph 9 wlth
all
all the
dlstinct vevtice Contains Btating and ending
the Path.
Hamiltonifan Cercuit
HomiHonian Path with &anting and ending vetices
then the Civcuit. s called hamiltonian
aHe a e

CCuit Poct
and tivcuit for 9lven
find Hami ltonian ghaph e
V-V-Vs-V3-Vy-v
Ne
e e e
Tuesy
Determîne
s l

whethev the
the fotlo uoing v4 C3 V3

4roph is hamiltonian ov Euler k ffnd, the


V
CoYresponding civcuit
is Homiltonam giap
This
Coes dís tinct
es
Since it
not di8tinct
vertices but
edges( Eulan giaph)
es Ys eu
civut:
VV2-V3-V4- Vs-Vg -V
Hamilto nian
hamilto-
guengroph.3
whetheY the
Determine
both and find C e e u a i
oY Eule OT
nian V2
drcuis e ev
ee
ea v
V
eiv2ee vGeqV
Vevev3e3 VueyVs es Vi e¢Vs
Sub 9haph
A ghaph 9 is 3ul divide d, inta 391,93.

the laph 9: 9,9v.9n


hence
Adjacent Vertices if Oim e.
A Vevter l8 Said to be adjatent
evtices
Heve the v,
two verticey
Connec
an edge nence., V, a
aYe
are Conected by
adjacent vevtices

nd a odjacent pons fov tho hoph.


VI
(V)
(va,V) Vs
Uy
(v, us)
(vsv)
to p h s n t
a ghaph
Theu aka tuo0 ways
Matvx
adjocenty
Incidence. Matvr
C
Adjocente Hotvi ts
H a i hapludentation of n vextíces
The +he no of vocta
Kn Heve n vepresenB
S
in graph.
moatnix in given graph:
tind adcenu
Vs
e
V

V
O

2
Intidence Ha
h matvic COus of m umbe of vevts bn no
then 1t 3 uvwmtta a mxn so

Find the
incdene matvix fov the given qaph

ooolo1

Cicult Harix k
o mumr of cituiils
mabun Con m
as mxn

is repusented
n.o oephey hen it'

C
C

Cs

se,e1,ey ecj Cs1e,,aj

yevter dele ted aph


ub
Bubglap,
9:3 wm to forma
Cownides th Haph

by deleting ver 1
Conoider es
ghaph q 3wOut to d'el C,h
form ub ghoph

V3
e3

Gtvaph colovin
to: be. ghhs calouted # .
a gtaph is1 2aid withdifferentColo

adjocent vevtex Colouved


vertex have he 3ame Colev
h e Same olev,
& no adjacent
Conalder the 9hoph 9
Sttp1:Heve we ude diffevent y
B
Colovs foY ecch vevtex. V

Aed, bireen, blue, yello


The total no of Colos bed in tRis naph
au 4 p
Heve we uplau veuer 3oith e d 6towse
R totl
Verter 3 i8not adjacent to v. then
ot Colovs used in tas 9taph

Heve we uplace twith aveen


vy

Hene h otol no of, Coloa. ued in ths


,

ph e 2
h1Oma-tic numbex

isvepexnfes aBBX(G) which is 1he minimurn no


i s OnS equced ov lhe qroph olouving
of
Differant
chomatic numbers for diflesent tyPe3 o
&1aphd
the chtomatic umben 2 2
for Btrtd g'oph
chvOmats'c numben a
afor Conylet bifoted oph

1)If nis odd the chvomatic numbes is 3


Snis even the chromatic numbe i6 .
for Complete oPh » t Kn he chvomatfc number is
hel has n-1
iv) Chvomatie nunbe fov aph Wn

Verticey
6 the Odered n-I is even then he chvomath
umber is 3.
Ovdeved n-t dodd then 1he hvomatc
cb) te
umber is

TreS
that Condains cytles is Called cycte
A oph is called
and Conected ayelic aph
foph
a tree

Any oph without may alo be called as


tycley
tvest Hence tYees a e comfonents of forest

lank of Gaph G
Kauk m-n +1 wheve
m is no of edges
is no of Vertice!
ank of tha iaph
Find the
KawK m-n+
5-4+

Ofannung vee

A Subghoph t o a aph G. iB Said to e


a spanming tvee e t ncludes evey ve,
verk of G
of G ie vertex of t:
Ananng tvee Comusts o edges
where Ym vepvesens no, oF, vertices n qlaph
Jn hoph G fa fnding the no of nanmig
wets f Re iven jlaPh Gwe kae

wse cayle ys foYmula n

n o of Vevtices vesent
9rph G
Find Spanning ee fov 9ven oph

6 3amuin tvees
(m-1) y-[ edgey
he no of edges aud no of vetites aud Je qrons
iven find he tptaldegu h guen
a
y deg (v.):alEl
Construct
To >Panning tvee thehe au two techwie
Bveadth Fivst Seanch
Depth fivst Sennch
5FSHgovithm:
a sootd luu i cowstuutted and
n Agovithn
thid
ced giaph othid Aooted u fhms a

the die visi't all


aung tvee he Tdea o FS S to to the xert
on a qiven
level bfote going
etices
kevel aud take it as
oct
a hott
chwse a
vettx arbilaly
Step1: ver tex
hi3 ver
thi3 3uc
tou 3uch
inúdent to
all edges Produe
Step : Ad
doesvit
adelition
he of edges added at
at this
that
that vertex
cycle. The mew,
at luvel 1 in
Cyde veytices
the tn
Place becovne tvee
m
Ovdeved
md
he namning
alitany mamnw
ovdey amd
a nd
Vibrted in ovdey
Step3Ferch wter al luel 1 this vevtex
to t h
to
to auy aycle
Cach tdge
incidEnt
doesntpvoduce
auy ycle
ay it
vee
tvee as Leug each
of V e v H l e s atverte
fhe childven t h VeyHles
Ovdeved Produces
PY:Ar6itarly
1. hi8
Lwel
at
at sex
uelin Otvee. al hu
PYoCe duru umtl
duru umtu
Bam proa
Coviwnu u been aded
SepS tee haue
Vertice in e
Pind a SPaning tvee of Grop r ng B
algovithm

Thuda N1 (n-)edgs
2 4
1 4 - 2

DFS (Depth ivt Seanch) ventie


Caver
the Poteduse to
algovthn gives.
This
levels in a tvee
Suitceviwe
8 also known as Back tyackmo
DFS algovithm
choose a veteu of t
aph
step11 Avbitanly as a dot
and Conideud

Verten
Step2: fath stanting,at his
tovm a
8ucLesivel adding edges aylena
y

bsible wheie each new edge l


in Hhe fatn
inident with the last ventex
withput Producing *yche vextices
tha9h all
p3 Path goes
then ee Connistin f
f he qhaph Apaviung tvee sthekuue
i s fath iS a
9 0to Mext sep
Stp4 uove back to the nextet,in athe
ah If fbuitle ftum a new Path
i s ventex Paiina thiough veti
has wete not
A)
alundy visied
movë batk
Step5: P this Camnot be done 4w0
Path ie.,
amothen Vestex in the
and p e a
Veslicey back in the Path
the Vocew as desckiled in Step2

tha
Step6: Repeat procedue om begnming
no moie edg Ca be added
wtl
ntl

roblem

VV V Vs V

t wigha
ueighbed

uu a
cf a
pommimg mhinu-
4munumum
Gwith
a pomning o
haph
unight Ksukals
K al Algdithm: elect n
Select edge
a n edge
we ihot ameng thu
ths algouthm ameng
o w e s t Weight
T
Tm COntinUe
Continue
which ha loops
of which
ane
not
h a e bee
been

edges in G
Cdges until
-
n-11 edges
hae
Ts Procew
sele cted munumum wnight
Step 1:choose an edg minimu)
tham one eahe
of
her is mde ag
chooSe abitaty
onm h o e
wheiqht
chose he edge F
At each stage
sep 2: wil not
lowest welght whose nclude
Cucles
Slep3: 9t G has n vetites then Stop aft n-1
haue bcem Chosen othewise Aepeat
edges
edges
Stop 2
VVs1

6 Vs
VsiV -3
V2Vs -
10 Vu-Sy
VVs
Ve
VV2Va Ngy+7
Vy Vs Vs V
2 3 S Vi,-8x
VI,V
N Uy,Vlo
N3,V
V,V-I
vs

b3, 1 3
37

V
Psimb Algorithm:
choose the edge
Step1: Select any veltex amd
th miimun ede eight
P2A each Stoge choose edge of `malast
mluded
joining a vetex alheaaly
weiqht
at intuded.
to,the ventey not
ae include d
SPP3Continue until all Venticer
fG has n vextices then tDp afte
n-1 edge hdi been
choosen othiuo
upeai t p 2.
Ans weA
e b
3
2

3 C
d
A92

39

You might also like