0% found this document useful (0 votes)
45 views10 pages

Interactable Problems.

The document discusses intractable problems that cannot be solved in polynomial time compared to tractable problems. It provides examples of problems that are solved in polynomial time like linear search versus those that require exponential time like the 0/1 knapsack problem. The 0/1 knapsack problem is used as a case study to illustrate how it is an NP-complete problem that is solved using a recursive algorithm to try all possible combinations of items.

Uploaded by

Arshman Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views10 pages

Interactable Problems.

The document discusses intractable problems that cannot be solved in polynomial time compared to tractable problems. It provides examples of problems that are solved in polynomial time like linear search versus those that require exponential time like the 0/1 knapsack problem. The 0/1 knapsack problem is used as a case study to illustrate how it is an NP-complete problem that is solved using a recursive algorithm to try all possible combinations of items.

Uploaded by

Arshman Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Overview of the

Intractable
Problems
Name:- Arshman Shahbaz
ID:- F2019376001
Section:- Y1
Introduction
 Automata.

 Decidability.

 Intractable problems.

 Large instances requires


immense amount of time.
Contd.
 Turing machine is used to distinguish between undecidable and intractable

problems.

 Polynomial and exponential.

 n, log(n) vs 2n
Contd.
 Examples: -

Polynomial time Exponential time


Linear search => n 0/1 knapsack => 2n

Binary search => logn Travelling SP => 2n

Insertion sort => n2 Sum of subsets => 2n

Mega sort => nlogn Graph colouring => 2n

Matrix Multiplication => n3 Hamiltonian cycle => 2n


Contd.

 Exponential type : -
 P => Deterministic & polynomial.
 NP => Non-deterministic & polynomial.

 Types of NP: -
 NP hard: - Hard exponential problem such as satisfiability.
Contd.
 NP complete: - When you have a complete algorithm for satisfiability.
 NP complete = Intersection of NP hard & NP.

 Satisfiability: -
 It is used as the base of all exponential problems, 2n.
 It has direct relation with all exponential problems which means if you prove a problem ab which has direct
relation with satisfiability would prove NP hard/complete for all other problems which has direct relation with
ab.
 Example => satisfiability ∝ ab => ab ∝ be, cd, ….. n.
 Our goal is to convert NP hard problems with exponential time into polynomial time.
Contd.
 Example: - 0/1 Knapsack problem.
 m=8 p={1,2,,5,6}
 n=4 w={2,3,4,5}
 (p,w)
 So ={(0,0)} => no profit no weight
 1So ={(1,2} => first object and add it to S o
 S1 ={(0,0), (1,2)} => merge So & 1So
 1S1 ={(2,3), (3,5)}
 S2 ={(0,0), (1,2), (2,3), (3,5)}
Contd.
 2S1 ={(5,4), (6,6), (7,7), (8,9)} => we cut the object by dominance rule.
 S3 ={(0,0), (1,2), (2,3), (3,5), (5,4), (6,6), (7,7)}
 3S1 ={(6,5), (7,7), (8,8), (11,9), (12,11), (13,12)}
 S4 ={(0,0), (1,2), (2,3), (5,4), (6,6), (6,5), (7,7), (8,8)}

 1) (8,8) ∈ S4
but (8,8) ∉ S3 therefore x4 =1
(8-6, 8-5) => (2,3)
Contd.
 2) (2,3) ∈ S3
but (2,3) ∈ S2 therefore => x3 =0
 3) (2,3) ∈ S2
but (2,3) ∉ S1 therefore => x2 =1
(2-2, 3-3) = (0,0)
4) (0,0) ∈ S1 and (0,0) ∈ S0
therefore x1 = 0

Therefore => {0,1,0,1}


Contd.
 p={1,2,,5,6}
 w={2,3,4,5}
 {0,1,0,1}
 Hence proved, maximum profit = 8, weight = 8.

You might also like