AGT Lab File
AGT Lab File
Pase
AssIGNMENT NO: 1 Dalo. o2.1) .22
Pseoalem stalement
Matrie
Tet Rn
Page NO, - 4
2) Uadiüee tad Weigltod goaph
a
s) Dineetad Onweiglted
Da stsuetue wel:
In tthis algositm
the matin , ohere n is eoay nins used to
the mhe of vextices in
Computatim Compleily i
The adjaeoney matia tales ov) tne to
ee eaeh oeain of the implemet
woih orne value.
yare maie vxv s initialael
The spaee eomgleg is O(v)
Speeial Featues:
) Eay to mplement, manipelale and deeole.
2) Undüheelal
Undieeted qaph ereae symmetie matix
Page N0,- 5
) e pare mathit
4)
<dac nd self loop.
Starehing valvalueue olol aa chas takes oli) int
Page NO-6
ASSIGNMENT NO: 2 Dalo, 02.11.22
Psoslom Statement
Iumplementatim ot apa uingintdouee mais
oeighted D
cla) S
D(3)
Data stucture used:
Psoblem Statenen:
A a Velmental mati
Wis weigut of an
for kaoh edge n E
gprapl is ndieotd tunweigltd
node2i
Conneet mode 1 woith AC:1
Conneel mode 2 weith AL1
ese is undiieeled wseigltd
modo 4 w>
hode 2 Lj,w>
Conmee node 1 with A C
Cenneet nodo 2 th A )
Psoblem Statemin:
DIS si be peniomed
wsgthe vertex as
VenzSueh proern usl be penlosmed untilsartiy
all nodes
u eae o diu etod
edge, each time
octod,5t neeory o eheed that if amt oi the
so
Veniees ún a bEs does not eormet to a
mode in puiows DFS.f pseviony
Suehese ocCw)
then they acth wl tosum a
cum ainge Cempennt athes thas
fage No, - 19
two aifenent tomponento
wil de anmine the nmhen of
3)fde in 0rder of hauerangeompenin.
he orden ef vetices Can lbe wsed to Jepheyu the egs
in oxden of havesal . Dwrng
sed ventaa,aeh vertix haversed and
DrS,fsom -the second bhav
ual oill
thal
vertezbrarersd lasfen
upesenled the edge ohen beth ventax is direetiy
Alacnitha at aglaneu i- Jmple mentation oft OES ton
a
4hen
Stap 3.3).J: oint the wale of mode and the vertex
waeet DESe
eud of DFS funetion.
Sep4: Tahe input the uemaen ot vertiee) and edge) and the
end woxiess of amy elge then take inpat o al the
element, sf adjaconey matrie ad{l c]and Po, Undineeed
wshere nand m he end Veres et edge
tep 5: Snttialire tuearialleto o aund
nemenled i lay
1upto ng the loop and penfem the Polloutug.
phint eaeh -elanant of adiaceney tmari
to te on eolumh node values, adjl]tileornpo
CPaintg txe-edqe)
Stap bl.1: Mae a elwre eall to DES funetion shre
gument
end etR
end ton
(Psintig the tokusad edg
Suitiallae i to to vjejt| do
Sap 4.1, Dnitialne jto o to vjkjtt do
marked Lile
ot masked [i7 and DFse tomponen of
the DfSe eomponent of marod Ci1 then
Stap sil.1.2 Pit the edge lactuoeen (it)th note to (ít1)h
mode
-tnd of
step: ( Printing the eros
Titialoe i to o to v ititI do
stap a.1: iinitialiej to o to V, jej+1 do
1.1: T# DrS Component of marked Li> DES Qomponint ot
Sep 41.
Component ot marked L51 d DFSe
ot
Cemponent et marked IuDESC Componnt
Stap 9l.1.2: print the edge behseen liitl) th nade to ljt )thnede
end ot l
end of
1
D
1
1 1
V V3
V 1 1
1 0
1
1
1
1
Vu
Component, are I2 4 5 3 G