Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.
-
Upload
lenard-ferguson -
Category
Documents
-
view
219 -
download
0
Transcript of Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.
![Page 1: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/1.jpg)
Internet EngineeringInternet Engineering
Czesław SmutnickiCzesław Smutnicki
Discrete Mathematics Discrete Mathematics – – Computational ComplexityComputational Complexity
![Page 2: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/2.jpg)
CONTENTS
• Asymptotic notation• Decision/optimization problems• Calculation models• Turing machines• Problem, instances, data coding• Complexity classes• Polynomial-time algorithms• Theory of NP-completness• Approximate methods• Quality measures of approximation• Analysis of quality measures• Calculation cost• Competitive analysis (on-line algorithms)• Inapproximality theory
![Page 3: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/3.jpg)
ASYMPTOTIC NOTATION – symbol O(n)
))(()( ngOnf
00 )()(0,,0 nnngcnfNnc
)(253 22 nOnn
)(8 23 nOnn
)(3 2nOn
Definition
Examples
![Page 4: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/4.jpg)
ASYMPTOTIC NOTATION – symbol (n)
))(()( ngnf
00 )()(0,,0 nnnfngcNnc
)(253 22 nnn
)(8 23 nnn
)(3 2nn
Definition
Examples
![Page 5: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/5.jpg)
ASYMPTOTIC NOTATION – symbol (n)
))(()( ngnf
021021 )()()(0,,0, nnngcnfngcNncc
)(253 22 nnn )(8 23 nnn )(12 2nn
Definition
Examples
![Page 6: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/6.jpg)
ASYMPTOTIC NOTATION - symbol o(n)
0)(
)(lim ng
nfn
))(()( ngonf
Definition
Examples
)(3 2non )(253 22 nonn
![Page 7: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/7.jpg)
ASYMPTOTIC NOTATION - symbol (n)
))(()( ngnf
)(
)(lim
ng
nfn
Definition
Examples
)(8 23 nnn )(253 22 nnn
![Page 8: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/8.jpg)
DECISION/OPTIMIZATION PROBLEMS
• decision problem: answer yes-no2-partition problem: given numbers . Does a set
exist such that
• optimization problem: find min or max of the goal function valueknapsack problem: given numbers , and . Find the set such that ,
• any optimization problem can be transformed into decision problemknapsack problem: given numbers , , and . Does a set exist such that ,
nnnaaa ,...,, 21
},...,2,1{ nNI INi iIi i aa \
12 n naaa ,...,, 21 nccc ,...,, 21b
},...,2,1{ nNI NIIi ic max baIi i
22 n naaa ,...,, 21 nccc ,...,, 21
b y},...,2,1{ nNI ycIi i baIi i
![Page 9: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/9.jpg)
CALCULATION MODELS
• Simple machine
• Finite-state machine
• Automata: Mealy
Moore
• Deterministic/non-deterministic finite automata
OIffOI oo :),,,(
S
oi
i o
OSIfSSIfffSOI osos :,:),,,,,(
OSIfSSIfsffSOI osoos :,:),,,,,,(
OSfSSIfsffSOI osoos :,:),,,,,,(
OSIfSIfsffSOI oS
soos :,2:),,,,,,(
![Page 10: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/10.jpg)
DETERMINISTIC TURING MACHINE
SssSAfASAfSSAfsfffSA nymosomos ,},1,0,1{:,:,:),,,,,,(
s
0 1 2 3 4-1-2 …
![Page 11: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/11.jpg)
NON-DETERMINISTIC TURING MACHINE
s
0 1 2 3 4-1-2 …
SssSAfASAfSAfsfffSA nymoS
somos ,},1,0,1{:,:,2:),,,,,,(
![Page 12: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/12.jpg)
CODING
• Instance I/ Problem P• Decimal coding of I• Binary coding of I• Unary coding of I• Data string x(I)• Size N(I) of the instance I• Coding of numbers and structural elements
32logloglogloglog)( 110 ncaybnIN ni ii
32lglglglglg)( 12 ncaybnIN ni ii
32)( 11 ncaybnIN ni ii
![Page 13: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/13.jpg)
COMPUTATIONAL COMPLEXITY FUNCTION
} whereI, instance thesolve tonecessary
machine computing of steps elementary ofnumber theis:max{)(
N(I)n
ttnfA
DEPENDS ON:• Coding rule• Model of calculations (DTM)
![Page 14: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/14.jpg)
FUNDAMENTAL COMPLEXITY CLASSES
Polynomial time algorithm O(p(n)), p – polynomial, solvable by DTM, P class
Exponential time algorithm
NP class, solvable in O(p(n)) on NDTM = solvable in O(2p(n)) on DTM
10 60
n 10-5 s 6·10-5 s
n3 10-3 s 2·10-1 s
n5 10-1 s 13 m
2n 10-3 s 3366 y
![Page 15: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/15.jpg)
NP COMPLETE PROBLEMS
21: PPf
yes)( yes 222 IfPI
)))((( 2INpO
POLYNOMIAL TIME TRANSFORMATION
PROBLEM P1 IS NP-COMPLETE IF P1 BELONGS TO NP CLASS AND FOR ANY P2 FROM NP CLASS, P2 IS POLYNOMIALLY TRANSFORMABLE TO P1
12 PP
PROBLEM IS PSEUDO-POLYNOMIAL (NPI CLASS) IF ITS COMPUTATIONAL COMPLEXITY FUNCTION IS A POLYNOMIAL OF N(I) AND MAX(I)
![Page 16: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/16.jpg)
COMPLEXITY CLASSES
NP CLASS
P CLASS
NPI CLASS NP COMPLETE CLASS
STRONGLY NP COMPLETE CLASS
![Page 17: Internet Engineering Czesław Smutnicki Discrete Mathematics – Computational Complexity.](https://reader035.fdocuments.in/reader035/viewer/2022081515/56649e9e5503460f94ba048d/html5/thumbnails/17.jpg)
Thank you for your attention
DISCRETE MATHEMATICSCzesław Smutnicki