0 ratings0% found this document useful (0 votes) 17 views11 pagesGraph Notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Graph DS
Yyrahins ae noo Lenton OS thet
consist f act werbias os nodes O-nd
edges that debits tue rel abionshrifp
lw the nocls. Mathematically a
Graph G = (VE) UN
Vis the sek Of Vertis and
E is the sek df edge.
» An edge rejrwertts Une reladionship
bbl a par of *erteies +
Rapswxntation a Lyrahh =
D Payaunuy Madras
2) Adycuuruy dust
3) Guidenue dist
ADSACENCY MATRIX
» Adjacenty matsia consusk of the
20 avray whoe Hu reuss and cols .
*tjrwonk the vertices.
H \Y\ is the nn of, nodes ,
Ske adjaurmnuy mabiix = VXV |
&
A e
©
MIG) = 5 1 hag
j 0 ‘ei
* Ai#-6. 4628
Bala. ch tea] Ep
8 | DPD
pt ee ae
Da tad
| The value in adjasunuy malyus
| ist if there isa funk bo node,
© othe
4. Wndaruted grahin => Symnmebsuc
relationshit
2 No duh decps
3. dure
S Considun Hu given adjaveny matrix
Comuut he gratin. Cnmnsnt on the
Whe 4 the gratin
* Bnode whith do net
Prk tae have any outgoing
edge
-+ Udegue A =0 Type 4 {pap
Bonu Node ——— a
Outdegiu 4 A=? >
Total deg = 2 Undouted tap
+ ndeg(B) =! Aah wxkhouk any doedions
Ourdeg (8) =! from the edges. ;
Total deg =?
+ Ondeg(c) = 2 Routed Ipablo
Outdeg(c) =0 > Sink Node Ypahh usth dreikion axrong
3 lh al th
- ~ O42 Trivial
f oan E TIN Lyabh
clo 0 | Wyaph unth only one ©
Node
Nut! fool J
Inaph isoa} /
Jpahh uth no edges and
only entities
Adjaxenuy dust Connuted Lsaph o
@oay of dunked Lat. Conreked rahh ax thee
The adi Lit in whi ux can staok from any
adinney ket pais ee
contains way dq bd whou the seth |
in Abe qua
motias are stored in the array r
and the adjacent nodes ase iadaved Disconnected Apraph ‘
Stored in the Lu indsaed bby te anray A qpatnis coil tobe discret
(a) > BEN > PM whan thon des not em any
on Je Path blu atieast one pain
fa vot,
[ce] > fauNi
gugulor Apa
A tyrahh is called A’
toe On
y Ruqulo when it satisfies
pnt Pema condutton $had a! the
| deg
Complete Lyra
Yer a the Vadis of te grahh
thoe trunk an edge bw wey par
vous
Oe
H Gwen’ n0- 4 .
noluss aid contains exauty,
Me, no-of edges , the grafh,ts
saidito bea complete Graph:
iis Goh
sath wah atleast 3 venkicas and
4 minima degw 2 and has
aeast | Cycle Bok
Maa Oe
PAaglic yop
e a
i ’
Bipartite Ivaph
& qrah is said tobe
bipartite if all the valu sould
be dinided into distin stt
X and ¥ and all distinut vedues
in X should be connuted [mahhed
to qentions io ¥ '
Both Ure sets should be: distinut
(Rnd TRAVERSAL
1, BREADTH FIRST SEARCH
(Fs)
| 2. DepTH FiRst SEARCH (OFS)ee
Breadth First Search Travesal | Conair du Yabh 6,
‘(dy perorm BFS uth 574
Ve. G=(we), durested | wrdouted |
wotightad [ ununeighited | Ned BFS(G,A>
Bde Sev og ie d F
h uw eae Q:
} Odixing rowenal | : fle As u
+ Predecessor Tv) =i”) } (on cae, be
i) adi 4 Mhe Lat ond emeve it fom
nook = posh, | Path woight to, quer) |
reath a nods. {roms dint | prc 902E7F
W) Breadkh Fiist Tree vooted at 5 “ Qrduning 4 BFS
Proliminartes
Tovd:
|
|
T(Al2w fal =o |
weW=h dcey=!
Tc) ILA! fai e} = |
Toy =8 ACol =2
a fe) =¢ del = 2
aa Ie. Ten f
F pitches ida eit i dita | ofepio niedgas 3
. 1 bo
3) lider JARvbeA}2 ° oR
explored - 2 status of rode Suu Ag BED ¥
3. Vohite - wnenouon | lt: ACB EOF
Grog - discovered f Tr(a atl
Blauk - expl ored
4. We take the huth of
te do BFSPseudocode
for eau vOntex uin V{od - $33
do ealeus [a] < ute
d{uj<
afud
do u < dequur (0)
for eau vin Adj{ud
do iF colour(y)) = white
then colour{v] 1()-6 a mane Cp
Gy
We haxe bw panto DFS
Seah for a node whiwh is nob y
having amy incornisng edge. fbr | OB © weadth Fist re
kav bing 0%. @) @) “}
‘i ; FS 3
Pofprrung pes) | Stat ong | ° o
{2-9
ae 7
7 Dad tur idanad o 2
10
L (ig) ene !
PPM 9 Pgge 05152 949395
me GoskdvouRing fror? 4, We gets
Option.) is Ure caret
ast orden is lexicagraphi
© Parjorrn a OFS on the follbusing
* Grable stanting at f).
2 ah
eC =. Le
Q huh ye cevurponds to that
DFS of the Gidhh quen below -
Tre sean Starts ak vekex o and
‘lexiogiephic ordwuing \s ayumed
fp the, tg, emanating from ch
Veen © md) 8 ong Seale
toon yar oie
A O12 71 ah Gein
B./0 1,295 43
er,
coo 1234
nie (a) ib
D013425_
ono sho. (ne @
+ | engList: 09 BE 9C 26 4p oe
9 Guide an anddeted grahh 6. tet
JT be O DFS Tranersal tan: debube a
verkex amd v be the fink umuisited
voor abtn visiting 4 - UWhiuh of the
fe\Lousung stakemunts fs alumuys bu?
Suatihy
p. (u,v) mut be an edge in &
8. (wv) mut be an edge and vis a
desemdank d U in T
C. % (uv) is not an edge, u and v have
She sume povent
D. % (uvyis not am edge then u is aleal,