Professional Documents
Culture Documents
V"V"'
--
N
Llrn be¥ Sei.-5 :
- > .5 4 b set : A£ B
P'toprv S4b se-1:: : Ac B b~+- A::t (3 ,.e, A $-B
--:) Union : AU8 To+ers ed-ion : A nB Dif-f evmce: A-8 ol' A\B
U A B
•
Complement ; A 1 o"'I Ac 0¥ A
* FL!nc+ion~ :
d- = x Y
1 T '\
f4o(tion Oomaln ( o clom qln
-> Ol)e-i-o- One (I"nj ecthie) func ·tion : H :i.,:/=-· :X.2 -'> -f.(.XiJ =I= -H.xa)
-> onto C Su-a·J ec+ hJe) f' l-lnC +, on : VJ e co dofr)qi-o (-f) J +h eYe iS 3.x E= Dom.(+
..SI.le n +hat +c.:t) == ':}.
-) Bij ec+h•e func-Ho0 J:f +uric+ ion is one --!-o -one )ct oo+o also , i-l:- is
ca /Je cl biJ ec+ive fuoction.
Auo. cd Tyian.:> le :
AC t:,ABc..) =
-;jf
--
Slope '~
Line
A e1a+ ·,ori :
- :> L, L.z ci n peYprooli c. Llla( i-/- qncJ o0lj i+ r<) 1• me.== - ;[.
J
• <P = 1so· - e
ton 0 = rn /
f() 2 -
J-t-ro<rn,
* S ·h ' o 1-:)h
Polyn o m,q/
.;.r:, I '4/+ed J•
<o d t- icien-c
-;:, ~o"( n -th dec)Yee polj nomiG} J rnqx. nu of- h1Yn,n9 poin+s iJ'l.-1
rf- -f(oJ on.; feh) ho" oppo.si~e si~n., +hen :!fc s>ich +ho-I: fCc)::o,
fo)
( one-io -man{)
(one--l-o-one)
* Ho '! i zuntq l Linc Te:s i-: C Io\/n.Si b le -lest)
!:i-:::.C !::j-=:-C
0 0 ----------..;> J..
f(-')(X))
-> Sllbst-i-hu+e followin-3 -vql<u..s fYoro olomC9) --i-o fino) olol'<) (-fo~tx.)).
(J) {:t: l sc.xJ ¢ oloroG-)j
+ Inve-rse F1.mc ti on ;
f(_x')
( /'Y) I '!'Yoo )
* ~ Xp o n e n+i q l FL,f nc+ ·,on :
::c.
-> f(:x):: a:x: J \,JheYe a>o qncJ a=t= I j .x. ER e
Ooffl(f) =R
Ron~e Cf)::: Co1~)
* Lo 9 q Yi th rn i c F <-1 nc t Ion
OoroC~)= (c..,oa)
ffonseCj) = R.
10 3a:X., Jo~bz
)ojb Cl
>If G-i Yaph :
t : .s e + ot e d~r S E f: V XV)
,r. 'walk' :
* Pa+h :
--:> Pa+h wh o.se stqr·Hn~ ond endin~ vertex iS .SQrne. Can Yfpeqf vey+ex b'-i-/;
no{ an ecJ9e.
TYee :
(ii)
liJ Priro'o
kYu.skaJ'.s
a1001i+tn
<'.lll?)olii-hrn
J (('f)inirnurn SepaYa+o~ Lemma)
1
--i> P't'iro s lnCY<crnPotallj -9rows fT)\nirnuYf'I .Sfqn-nin~ -+rE'e .
1--- 20
10
- --l c
\
@-i¼1
\
\
3
6
IO
0 J.
@ Jo\ eo
® 0
10
3
&
c.O
4-
C.
(E ND )
.3 4,
g
6
@ 10
(END)
-> Fo1 -wef~h+ecJ .s h oY-t-ecJ pa+h .1 /en-,+h of a p a+h fS sum of +he wei9hts,
ho+ no . of ed ~e..':>,
-:) BF5 9 ive!> .S hoY{-eJ p q ih I(') +er rn of no. o+ ecJ3 e5, vJhich need not he
vJt' i.:?Jh+cd .s h or-1:e.s t Pat-h.
I::.
J ..s1 n.9 le .'.:>o utce l !All pail's,
'v
'¥
• Dfjk s ir-a 'S Alcaorithm Cnon- nr9 a-live rcJ~e) • FloHcJ-wav..shaW.s Al~orH-hm
• Bel/roan - F-o'6 J
- ) FoY °' 9 YO Ph w f th 11 -1 •
<','.)Q,ive (jcle C no+ ne9a+lve ec1~e) wei~hi-eJ ~hor-1-est
f<Hh is ho+ cl ef.loed ,
(staY-l:) "O
DO
6
go 6
5· iO
oO 00 oO
JO
0 i cO
4 so C>e)
©-- -- - --- -®
o()
00
©
o()
/ ' / \
/ ' ' I '
''
/ /
'' /
0
oO
80 ___/':;'\ 17\ 0()
0 ------ --- ~
/ / \.'
l..z)
. /
/ '
\ \
/
/ '' I
/ '
/ ' / '
/ ' I '
-- - - - - @ -- - - - - - -®
' JO oO / ' oO
/ - - - - ( D--
o@i--
16 oO
--------®
0()
,, c
/
/
/
©',
/
/
/ ''
30 / ',
- - - - -®
0 / / 10 0V
16 86 35
/ i -- - - - - - - -Q) /~)
//
/
/
/ ''
/ / \
/ IO 30 / ' ~'O
o o ·/ 11---------1 4 ----- - -- @
. 16 S6 35
® 2 - - - - -- --® 6
/ '\
/
/ '\
// 10 30 \ 4-5
a
0,1--------~1,--- -~4-- -- ---- ®
16 86
2 ---------6) 6 35
/
/
/
/
/
/
IO 30
o of
" - - - - - - 1 1 - - -- - ~ 4 - - ------
16
( Enol)
/
/
/
0
o,J=-_,.....,.,_
/
_ _
s
4- oO o()
5 oO
0() 00 =J- 5 5 6 3 ,©
6 o,/) 00 9 6 6 6 6 l 0.1/3
- '5't-(--\.::!}
=,.. oc, g g g 9 \::_I -1
- ;:,. H Bellman- FoycJ al'.30-ri-thrn clo~s n o t <onver3e Q·Hff n-1 iteyq+Jon s , -there
i.s
a ne.3a+ive <jcle,
-> AS!.i9i, Co lour~ +o nocJ()5 ..S uch t ho-! enc-Jpoi l'l!S of ecJ~e have di-f+C>Y<>n-/;
Co loi.J r.s.
- -
Vn tex Cove -r :
o~r
i - - -3
vc -= {3}
/VCCG,)j :.1_
vc = .[4-;2}
/vccc.,)/=-2
oY ~4-.,o.}
-;) .StJ bse+ of V .svch -/:-hqt ho t-wo are connec+ecl b_) an ecl.:)e.
1
Mevt'-5-/:-ecJ in fin d,n,.., ma :ximum /JepencJen+ se t .
I rn(G1)j = 3
-> D eE) Ye e o-f \Jrvtex : No . of i0coro i11~ )ov+ ~o h'\~ ecJ ~es .
- ) O (n2) (l3Fs o y OFS)
.:it- Ad jarfnr':1 Li .s + :
0 ~1,4-}
(8 f5 oi OFS) rn e<.-Jf)e5)
3 {¢}
4- OJ
-) Connec+rd G-ivqph : r-J evevj vev+ex is YeachqbJe +tom evrtj o+hei ver./:-ex.
--:1 Complete. Gnqph : J:.t eVC'Y~ veY-J-ex is <onnec+ecJ to t'verj ot-hey vet¼-ex:.i
(has n-1 d e~Yess)
-:) No . of veYtices
o-f odd cle9ree b Q/wo~ s even.
---
* 8~e acJ-l-h
-.> BFS
Fir.s -t
explotes 9toph
.Se ayc h :
level-b~-Jeve/ .
--;) Cnive .shor.i~c I p....Lh l _j
F -1
'
V vi.si+ecl Leve I fqYent
t T 0
C. F -I
3 F -1
4- F -,
F -, To e,<ploYe 'l,Ueue
5
6 F -,
V Vi.Sji-eol Level Poren -6
1 T 0
2 T I 1
3 T I 1
4- F -I
5 F -, To explore q,.L1eue
6 F -I 2 3
V 1 2. 3 4- 5 6 .Stock of suspmc.-leoi
v isi+ed veYfices
F F F F F F
I I I I I
!I Stock
l I I
I Stack
.1 I 2 I I
I 5+o ck
1 I2 4- I
IStack
1 I2 I 4- ]s I
151 .
V 1 2 3 4- 5 6 I Sl-ock
\tisi+eol9 T T T T T i= i 12 4- 5 13 I
6
I StQck
. l 2. I 4- I5 I I
V :J. 2. .3 4- 5 6 !Stock emp+y
15 I 6 I
(Now
? I
VisH- ed T T T T T T 1. 2 4
I stack)
7 As.si~n each WYfe.x an rn+-r-:1 qn~ exit no. -h CYea+e DF.s -free .
6 6 :i-
- -:.
Df-rec+rol 9 Yaph5 ran be c-le <ornpo !Je c/ in+o Secs.
->
ln sec, l:'a ch Pei i'( o + vt>di(es l..s .'.:i h or,j !_j connec+ed (i.e . if +heYe 1.s P o+h
fYorn i +o J +hen -+1-->ere ts q/vva~ pci+h fi e,<) J to i)
--
-.:k Cl4t 'vE'Y-frx :
-) rn '-'ndivec+ eol ronnec +ecJ ::,-raph I o. cu+ \Je't'tex lS an 01+1<1..11 <::ition fOi()i
'whose
Ye tnova1 ~i.::, <onnec-{-s +h e ~1aph.
.S e q,u en ce 1
0
02 '-+
I
2s~ 3' \
, ~ w- 3
6 =t
Seq,uenre 'J.) 0
0
0
2 1../-
,/ :16
I \ 2 Seq.,uence 1 J 0) 3
0
4
0
5
I
6
1
+ C.
.Seq,.uence 1;013;2
4 0
06 ~ q . 2.
1 Se 'l,..l-lenc e : 1 ; 0 J 3,2;5
0 / I
I)--;>=,.
5eq,uen ce : 1 J0,3c,54-1
1 J J 01 '.:J- ,1
Ta1<e 'o' a.'.> lon3 rs + pq+h foy <W ve-r+ire s iriitaJI~.
--) Rrfr) ove '<eY4 ex ""1+h o incie.9 Yee and L1pcJa+e lon~est pqth a0cl indeE)tecs.
-~ Repeat un+ill all vPdires listed.
C' 0
0
"2
L, 1 30
I
4
0 Top o lo.'.:) ica / OYcl e l ;
Lon~e.'.,+ pq+h io:
2. 1/
5 0--- - 6-0 - - ~ ~o
,~1 4
Lon~es!- pa+h +o : 0
o I O I 0 1
4
1/ ,
2 3~ / Top o lo;,ic aJ 01 <:let : 1 0
2
~
s0:____ 60- - \<
~ '
Lon9e5-1: pa+h -to : 0 0
oc , 04- 1
To po lo .'.') ica l oYciet · J.
l
0 3
J
' 5-----::,16 I ---; =f- 2. 2.
Lon9 es+ pa+h +o : o 0 1
?. 0
0 It- I
0
5 ~
2
·6 - - - >
O
i 2
2
Top o lo3 ico 1
Lon.9e.s+ path
otcJer :
-+o :
:L
o
0
0
3
1
2.
J.
o I
4-
l Tu polo_'.J ica/
Lon?Je.s+
orde '( : ;_ 0 3 c .s 6
,~ 4 Pa-ti\ +o : 0 0 l 1 2 3
T op o lo ~ i( a l CJ¥c/ er : J._
+4
0 3 2. 5 b 4- +
0
LQ,3e.5!- pa+h +o : C'.) 0 l 1 c 3 4
-clt· T-n1n~i -l i ve Cl os e t :
-> A iS rnxn
B iS nxp
C is Ax(3 which rnxp
n-1
-> ;Jj J =-
C [ L. A [ iJ k ] • B t k Jj ]
k=o