0% found this document useful (0 votes)
58 views13 pages

ComputationalComplexity Group8 H OS

This document discusses computational complexity theory and different complexity classes. It begins by defining computational complexity as the amount of resources like time and memory required for an algorithm. Time complexity is most commonly considered and measured by counting the number of steps an algorithm takes based on the input size. The document then covers deterministic polynomial time (P) problems that can be solved in polynomial time and non-deterministic polynomial time (NP) problems that have solutions that can be verified in polynomial time. Examples of different complexity classes and applications are provided.

Uploaded by

Muskan Valbani
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)
58 views13 pages

ComputationalComplexity Group8 H OS

This document discusses computational complexity theory and different complexity classes. It begins by defining computational complexity as the amount of resources like time and memory required for an algorithm. Time complexity is most commonly considered and measured by counting the number of steps an algorithm takes based on the input size. The document then covers deterministic polynomial time (P) problems that can be solved in polynomial time and non-deterministic polynomial time (NP) problems that have solutions that can be verified in polynomial time. Examples of different complexity classes and applications are provided.

Uploaded by

Muskan Valbani
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/ 13

COMPUTATIONAL

COMPLEXITY

Project Presentation
Optimisation with Spreadsheets
Group 8
1. PGP/24/441: ASHWARYA BISEN
2. PGP/24/456: MUSKAN VALBANI
3. PGP/24/471: SHRUNATRA MISHRA
4. PGP/24/485: TSERING DESKIT
INTRODUCTION
Computational complexity of an algorithm is the amount of resources
required to run that algorithm. Particular focus is given to time and
memory requirements. The resources required  to run the algorithm
depends on the size of the input, the complexity is expressed as a
function.
n → f(n), 
(where n is the size of the input)

f(n) is either the worst-case complexity (the maximum of the amount of


resources that are needed over all inputs of size n) or the average-case
complexity (the average of the amount of resources over all inputs of
size n)  Mathematical operation computational complexity
Time Complexity
Resources Space Complexity

• The resource that is most • Space complexity of a program is


commonly considered is time. the amount of memory consumed
When complexity is used without by the algorithm until it completes
qualification, this generally means its execution.
time complexity.  • The way in which the amount of
• The usual units of time are not storage space required by an
used in complexity algorithm varies with the size of the
theory because they are too problem to be solved.
dependent on the choice of a • The space occupied by the program
specific computer and on the are:
evolution of technology. • A fixed amount of memory
Computational complexity theory
• We count the number of steps occupied by the space for
that algorithm uses on a
focuses on classifying computational program code & space
particular input as a function of problems according to occupied by the variables used
the length of the string their resource usage, and relating these • A variable amount of memory
representing the input. classes to each other. Lets discuss the occupied by the component
• We consider worst case analysis, two types of resources time and space whose size is dependent on
i.e., the longest time of all inputs the problem being solved
of a particular length
.
Deterministic Polynomial-Time (P) Type
Deterministic Polynomial-Time (P)

• Deterministic or Turing machines are B


• P also known as PTIME is the complexity
extremely basic symbol-manipulating class containing decision problems which
devices which –despite their simplicity- can be solved by a deterministic Turing
can be adapted to simulate the logic of machine using a polynomial amount of
any computer that could possibly be computation time, or polynomial time.
constructed.
Simple PowerPoint Presentation
A problem is basically classified as that belonging to the
PowerPoint Presentation
P (polynomial time) class if there is at least one algorithm
which can solve that problem; the number of steps
employed by the algorithm being restricted by a
polynomial in “n”, where n gives the size of input data.
P is known to contain many natural problems, including the decision
version of linear programming, calculating the greatest common divisor,
and finding a maximum matching, determining if a number is prime etc.

All basic mathematical operations; addition, subtraction,


division, multiplication.
Application
Testing for primacy, hash table lookup, string
operations, sorting problems, shortest path algorithms.

Linear and Binary Search Algorithms for a given set of numbers.

For Example- Consider the game of checkers. What is the complexity for determining the optimal move on a
given turn? If we constrain the size of the board to 8 by 8, then this is believed to be a polynomial time
problem. But if we say it is an N by N board, it is no longer a polynomial time problem.
Non Deterministic Polynomial-Time (NP)
Type

Definition
 An NP problem is one which has a solution, inputs to the
solution and a verifier which runs in polynomial time by a
deterministic Turing machine.
 It consists of the set of all decision problems wherein the state
of the problem, whether ‘yes’ or ‘no’ has to be supported by
effectively verifiable proofs.

Phases
 The first phase involves making the nearest possible guess
about the solution which is determined in a non-deterministic
manner.
 The second phase makes use of a deterministic algorithm that
does the job of verifying or rejecting the guess made by the
user.
Application of NP Complexity Class:
Travelling Salesman Problem
Question:
Given a list of cities and the distances between each pair of cities, what is the
shortest possible route that visits each city exactly once and returns to the
origin city?

A non-deterministic Turing machine can find such a route as follows:


 At each city he visits, it will “guess’ the next city to visit, until it has
visited every vertex.
 If it gets stuck, it stops immediately.
 At the end it verifies that the route it has taken has cost less than k in O(n)
time where n is the number of cities and total distance is less than k.

Bonus Complexity Class: Exponential Problems


 These are a set of problems that can be solved in exponential time.
 EXPTIME-complete problems are widely applied in succinct circuits and generalized games.
Computational Complexity: Analysis of
problems in real life
Examples to where it can be applied Step 1
convert the real life problems into a yes-no problem without
1. Machine Deadline Scheduling altering its complexity. A threshold value in the input is needed
2. Machine Line Balancing for the conversion.

The problems are generally of two types-


feasibility or satisfice problems

Step 2
finding the complexity of a problem. Contributors to complexity: perfect division
of resources is required, sequencing decisions considering both where you
currently are and where you were before, finding out the largest substructure
which satisfies a property, minimizing/maximizing unions & intersections of
sets., etc.

Examples of contributors to complexity-


Integer Programming, Machine-weighted
flow time minimization, Steiner Tree
Complexity Classes and general application

Big O Name Complexity Applications


Notation
O (1) Constant Resource will always be the same - Finding if a number is even/odd
- Look-up Table (average)
- Check if an item on an array is null
- Print the first element from a list
- Find a value on a map

O (log n) Logarithmic Resource grows very slowly despite new data Using Binary search for finding elements in a sorted array:
being added - Finding a word in a physical dictionary
- Finding a person on a phone book
O (n) Linear Resource increases linearly - Find max element in an unsorted array
- Find a given element in a collection.
- Print all the values in a list
O (n2) Quadratic Resource increases in polynomial time - Check if a collection has duplicated values.
-Sorting items in a collection using bubble sort, insertion sort, or
selection sort.
- Find all possible ordered pairs in an array.

O (2n) Exponential Resource doubles with each data item; grows Content
- Power Set: finding Hereon a set.
all the subsets
exponentially - Fibonacci.
- Travelling salesman problem using dyanmic programming
O (n!) Factorial Resource gets added in a factorial/exponential - Permutations
manner due to number of permutations - Travelling Salesman problems
- Sudoku Solvers
Your Picture Here

You can simply impress your audience and


add a unique zing and appeal to your
Presentations. Easy to change colors,
photos and Text. Get a modern
PowerPoint Presentation that is
beautifully designed. You can simply
impress your audience and add a unique
zing and appeal to your Presentations.
Easy to change colors, photos and Text.
Get a modern PowerPoint Presentation
that is beautifully designed.

Modern
Portfolio
Presentation
COMPUTATIONAL COMPLEXITY IN
BUSINESSES

FINANCE
MARKETING • Clearing of Financial
Networks
Customer Relationship
Management • Asset Pricing

OTHERS Optimal Product


designing • Valuation
Logistics Application
Advertisement slotting
Maps Application
Medication – Cancer
REFERENCES
1. https
://www.tse-fr.eu/sites/default/files/TSE/documents/sem201
8/finance/bossaerts.pdf

2. http://www.cs.jhu.edu/~
scheideler/courses/600.471_S05/lecture_1.pdf

3. https
://www.sciencedirect.com/science/article/abs/pii/03772217
89903299

4. https
://www.researchgate.net/publication/274095047_Sensitivit
y_and_Computational_Complexity_in_Financial_Networks
5. https://www.baeldung.com/cs/tsp-dynamic-programming

6. https://medium.com/@amejiarosario/8-time-complexity-ex
amples-that-every-programmer-should-know-171bd21e5b
a
Thank You
GROUP 8
1. PGP/24/441: ASHWARYA BISEN
2. PGP/24/456: MUSKAN VALBANI
3. PGP/24/471: SHRUNATRA MISHRA
4. PGP/24/485: TSERING DESKIT

You might also like