Untitled

tobiasc.dk

Untitled

Ω Θ


Ω Θ


Ω Θ


Ω Θ






CO2

CO2

CO2








NO2

NO2 40 µg/m3

200 µg/m3

100 µg/m 3 0−50 µg/m 3


CO2







• CO2

















CO HC NOx


NOx


8, 5◦ 8, 5◦ 8, 5◦ ≥ 8, 5◦








NOx SO2 CO HC CO2








CO2

CO2








CO2
























































































































































































































































































































































































Ω Θ


Ω Θ









f g

C k

|f(x)| ≤ C|g(x)|

f(x) O(g(x)) x > k C k f(x)

O(g(x)

f O(g(x)) g

g f x

g f f


f(n) f(n) n


f(n) = 1 + 2 + ... + n ≤ n + n + ... + n


n

f(n) n n n f(n)


= n 2

n n n 2

k = 1 C = 1

f(n) O(n 2 )




x, y ∈


|x| + |y| ≥ |x + y|



x ≥ 0 y ≥ 0 |x| + |y| = x + y = |x + y|

x ≥ 0 y < 0 |x| + |y| = x + (−y) > x + y = |x + y| y

−y > y

x < 0 y ≥ 0

|x| + |y| = (−x) + y > x + y = |x + y|

x < 0 y < 0 |x| + |y| = (−x) + (−y) = −(x + y) = |x + y|


f(x) = an·x n +an−1·x n−1 +...+a1·x+a0 a0, a1, ..., an−1, an

f(x) O(x n ) O(x n )

f

k = 1 x > 1


|f(x)| = |anx n + an−1x n−1 + ... + a1x + a0|

≤ |an|x n + |an−1|x n−1 + ... + |a1|x + |a0|

= x n


|an| + |an−1|

x

|a1|x |a0|

+ ... + +

xn−1 xn



≤ x n (|an| + |an−1| + ... + |a1| + |a0|)

= Cx n


x

x x

x n



k = 1

C = |an| + |an−1| + ... + |a1|n + |a0|

f(x) = 2 · x 7 − 5 · x 5 + 3 · x 4 − 3 · x + 5

f(x) O(x 7 ) f(x)



f1(x) O(g1(x)) f2(x) O(g2(x)) (f1+f2)(x) O(max(|g1(x)|, |g2(x)|))

f1(x) O(g1(x)) f2(x) O(g2(x)) (f1 · f2)(x) O(g1(x) · g2(x))




Ω Θ

Ω Θ


Ω Θ


f g

C k

|f(x)| ≥ C|g(x)|

f(x) Ω(g(x)) x > k


g C k g f x k

Θ


f g

f(x) O(g(x)) f(x) Ω(g(x)) f(x) Θ(g(x))

f(x) g(x)

f(x) O(g(x)) Ω(g(x))

C1 C2 k1 k2 k1 k2

f(x) Θ(g(x)) f(x) O(g(x)) f(x) Ω(g(x))


Θ

Θ

x > k Θ



Ω Θ





















b = 2


n

10−9

2(n) 7 · 10−9

n 10 −7

n · 2(n)) n(n) 7 · 10 −7

n b 10 −5

b n 4 · 10 13

n! 10 100

10 9


10−9

n


b 10000

n ≈ ∞






n < 10




10100


∩ = ∅


n








c1, ..., c4







n+1 i = n i

n

T (n) = 1 · c1 + (n + 1) · c2 + n · c3 + n · c4

= (c2 + c3 + c4) · n + c1 + c2

≤ c · n

O(n)



n · n

n

n · n

T (n) = n · c1 + (n · n) · c2 + (n · n) · c3

= n · c1 + (n 2 )(c2 + c3)

≤ c · n 2

O(n 2 )


G = (V, E) V

E

V = {v1, v2, . . . , vn}


E = {e1, e2, . . . , em}


(vi, vj) vi vj


a

b

a b



a b
















v deg(v)


G



v v v deg(v)

v


v

v v















L(vi) vi

vi w(vi, vj) vi vj


G

n

a z

i := 1 n

L(vi) := ∞


L(a) := 0

S := ∅

w(vi, vj) = ∞ w(vi, vi) = 0

z /∈ S

u := S L(u)

S := S ∪ u

v S

L(u) + w(u, v) < L(v)

L(v) := L(u) + w(u, v)


S

S




O(n 2 ) n

G

n n

n − 1


n · (n − 1) + n = n 2 − n + n = n 2

O(n 2 )


w(vi, vj) a h a

L(vi)


a h

a

a a b c

b = 4 c = 3

c


c d e


d 3 + 2 = 5 e 3 + 6 = 9

b b

d d b d

e d

h

h

(a, c, e, g, h)

h


G

n



k v

v ∈ S

k v

S v /∈ S




k = 0 : S = ∅

∞.


k v

S k (k + 1)

v u

v

k + 1

u S (k + 1)

u S v v

u Lk(u) v

Lk(v) + w(u, v) k + 1

Lk+1(u) Lk(u) Lk(v) + w(u, v)



vi vj vh





G n

∞ G


h := 1 n

i := 1 n

j := 1 n

w(vi, vh) + w(vh, vj) < w(vi, vj)

w(vi, vj) := w(vi, vh) + w(vh, vj)






k vi vj i ≤

k ∧ j ≤ k




k = 0 :

vi vj


k w(vi, vj) vi vj

(k + 1) n


k + 1 vk+1

vi vj

vi vk+1 vk+1 vj

w(vi, vj) w(vi, vj)

w(vi, vk+1) + w(vk+1, vj)

w(v1, vj)

k + 1


O(n 3 ) n

G

n

n · n · n = n 3

O(n 3 )





∞ w(vi, vj)

i j i j


0 2 ∞


4

⎢ 2

⎣ ∞

0

2

2

0

5 ⎥

3 ⎦

4 5 3 0




0 2 4


4

⎢ 2

⎣ 4

0

2

2

0

5 ⎥

3 ⎦

4 5 3 0






O(n3 )

O(n2 )







(n2 − n)/2


O(n2 ) · O(n2 ) = O(n2 · n2 ) = O(n4 )





(162 −16)/2



O(n 2 ) · O(120) =

O(120 · n 2 ) n















G = (V, E) v0, v1, . . . , vn−1, vn,

vi = vj 0 ≤ i < j ≤ n

G


G


G = (V, E)

n > 1


v0, v1, . . . , vn−1, vn, v0

v0, v1, . . . , vn−1, vn





1
















T SP NP T SP NP


HK NP

HK NP NP

HK T SP NP

T SP T SP NP


HK T SP

HK T SP


C w(C) ≤ B

B

G = (V, E) v1, v2, . . . , vp

HK

G ′ = (V, E ′ )

G

G ′


1 (vi, vj) ∈ G

w(vivj) =

2

(vi, vj)

vi vj w(vi, vj) B = p p



G G ′




p


2


n = p r = 2

n!

r!(n − r)!

p! p · (p − 1)

= =

2!(p − 2)! 2

p2 − p

2

G G ′ O(p 2 )




G ′ G

C w(C) ≤ B = p G

G ′

G w(C) ≤ B = p ⇔ G ′ w(C ′ ) ≤ B = p

⇒:

C G C

v1, . . . , vp, v1 G ′

p C ′ v1, . . . , vp, v1 G ′

p

⇐:

C ′ G ′ B = p p


1 1

C ′ 1 G

C G p









n

n − 1




O(e · log v)

O(e · log(e)) e v

v v · (v − 1)/2





G


S G

K

S = V

(u, v) G u S u S

K



G n V

O(e·log v) e

v


e O(log(e))

G

v · (v − 1)/2


v · (v − 1)

log

= log(v · (v − 1)) − log(2) = log(v) + log(v − 1) − log(2)

2

O(log(v)) v

O(v · log(v))

K

G n



G


K G T

K

S V \S K S

V \S G

S

(u, v) S V \S

(u, v) K

(u, v) T

(u, v) /∈ T (u, v)

T (u, v) T (u, v)

S V \S S V \S e

T e (u, v) T ′ (u, v) e

(T ) = (e) +

(T ′ ) = ((u, v)) +

(u, v) S V \S

((u, v)) ≤ (e) (T ′ ) ≤ (T )

T T ′


k K


k = 0 : K


K k S K

K (u, v)


k + 1





O(n 2 )






n


G T

(u, v) ∈ T u v



u ∈ T ′ P = (x1, x2, ..., xn) x1 = xn = u







deg(vny) =

2 · deg(vgammel)












u v t u t u v

v t

T G T





T

P

P


T

(T ) < ( ) ⇔ 2 · (T ) < 2 · ( )

T

() = 2 · (T )



() < 2 · ( )



( ) < 2 · ( )



T

T








P a


P = (a, b, c, d, c, b, a)

P = (a, b, c, d)

c a 28















P = NP K



v

K P = NP

K

G = (V, E)

G ′ = (V, E ′ ) G ′


w(e) =

1 e ∈ G

v · p + 1

e G ′ p G ′

O(p 2 )


• G G ′

p

v · p

• G G ′

v·p+1 ≥ p−1+v·p+1 > v·p

G ′

> v · p


P = NP

P = NP


P = NP


P = NP


P = NP K



v

K P = NP

K

G = (V, E)

G ′ = (V, E ′ ) G ′


w(e) =

1 e ∈ G

v · p + 1

e G ′ p G ′

O(p 2 )


• G G ′

p

v · p

• G G ′

v·p+1 ≥ p−1+v·p+1 > v·p

G ′

> v · p


P = NP

P = NP


P = NP


P = NP














1/2



























1/2



























1/2















































































































≤ 16



O(n2 )


(m2 − m)/2 m

O(n2 · m2 ) m2 m = 7 n = 2000

n



O(m!) m



















n

m


O(n) O(n2 )




O(n2 )





O(m)






b a


a b

m2−m 2 O(m2 ·d)

d


for

O(n2 )


while

O(n) for

n

while n

O(n2 ) while


for n


O(n2 )


for

for n for



for

for if

n for


for

for

n


for n

while O(n3 )


O(n)


O(n3 )


O(m2 )

O(m2 · n3 )


n


for


m − 2

(m − 2)!


O(m!)






O(n · a) a

a ≤ n O(n2 )

O(m2 · n3 + m!)



n m

O(m2 · n3 + m!)


for


m − 2

(m − 2)!


O(m!)






O(n · a) a

a ≤ n O(n2 )

O(m2 · n3 + m!)



n m

O(m2 · n3 + m!)


























(,, /) =

/ + 2 · 10 10 · · (0, 07 − (/) 2 ) 5












= 50 = 0 200

0, 25



= 0


0 0, 13

0, 39

0 0, 25

> 0, 25 < 0
















a c


a =

· (0, 07 − ( )2 ) 5

b =

c = · (0, 07 − ( ) 2 ) 5


d =


+1

e = 100 +


f =


)+

(

100

g =




− ( ) 1,5

a c

a

















a c





a c


a c




f
















0, 012 − 0, 016 0, 23


e f

/ 0 0, 39

e 100 f


/

d g /

/


a c






















1/2


1054, 09+1135, 07+1204, 45−2·679, 01 = 2035, 59










100%


1054, 09+1135, 07+1204, 45−2·679, 01 = 2035, 59










100%


CO2


O(n2 ) O(n3 )



Ω Θ


T SP P = NP


T SP P = NP






















n n · (n − 1)/2

n = 1

n = k

k k · (k − 1)/2

k k


k · (k − 1)

2

+ k =

k · (k − 1)

2

k · (k − 1)

2

k2 − k + 2 · k

=

2

(k + 1) · k

n = k + 1

+ 2 · k

+ k

2

= k · (k − 1) + 2 · k

2

2

n n − 1


n = 1

n = k k

k − 1

k + 1

k n = k + 1

n

(n 2 − n)/2

n = 1

n = k

k 2 − k

2

k


k2 − k

+ k

2


k2 − k

2 + k = k2 − k + 2 · k

2

= k2 + k

2

k2 + k

2

= (k + 1)2 − (k + 1)

2

n = k + 1


=

=

Similar magazines