SlideShare a Scribd company logo
1 of 25
Approximation
Algorithms
Bipesh Subedi
ME 2021, Computer Engineering
DoCSE
Outline
2
➔ Introduction
➔ Optimization Problem
➔ Statement
➔ Approximation Ratio
➔ Examples of Approximation algorithms
➔ Travelling Salesman Problem (TSP)
➔ Analysis
➔ Application
➔ Pros and Cons
➔ ‘Conclusion
Introduction
Approximation algorithms refers to the efficient algorithms that finds a
solution to an optimization problems ( in particular NP-Hard problems )
that is provably close to optimal solution.
When it is used ?
➔ When finding an optimal solution is very difficult
➔ In some cases, where exact solution is not needed and near-
optimal solution can be found quickly
3
➔ For NP-Complete problems, there is possibly no
polynomial-time algorithms to find an optimal solution.
➔ The idea of approximation algorithms is to develop
polynomial-time algorithms to get near optimal solution.
4
Optimization Problem
It refers to the problem of finding best option/solution among all
feasible/possible solutions.
Various important applied problems involve in finding the best possible way
to accomplish the task which is often done by finding the maximum or
minimum values to a function.
➔ Maximization Problem : Finding the maximum optimal value
➔ Minimization Problem : Finding the minimal optimum value
For example: the minimum time to make a certain journey, the minimum
cost for doing a task, the maximum power that can be generated by a
device, and so on.
5
Statement
➔ An algorithm for a problem of size n has an approximation ratio
ρ(n) if for any input, the algorithm produces a solution with cost
C that satisfies the property:
Where Copt is the cost of optimal solution and ρ(n) is a constant or a
function of n.
6
Approximation Ratio
➔ The approximation ratio of an algorithm is the ratio
between the result obtained by the algorithm and the
optimal cost.
Significance
➔ Performance Guarantee:
It guarantees that the result produced by the approximation
algorithm is not going to be worse than a factor of ρ(n)
compared to the optimal solution.
7
The algorithm with approximation ratio ρ(n) is then called
ρ(n)-approximation algorithm.
Here we will consider our approximation algorithm to have
constant approximation ratio.
For example: If ρ(n) = 2 then,
For maximization problem : our solution will be no less than half
the optimal solution. ( Copt/C <= 2 )
For minimization problem : our solution will be no more than
twice the optimal solution. (C/Copt <= 2)
8
Range of Approximation ratio
➔ If ρ(n) =1 then,
The algorithm can always find a
optimal solution
➔ If ρ(n) >1 then,
It gives the approximation in which
the algorithm works.
9
10
Examples of Approximation algorithms
➔ Travelling salesman Problem
➔ Vertex-Cover Problem
➔ Bin Packing
Travelling Salesman Problem (TSP)
A salesman should visit all the cities exactly once starting from one
city and return back to the starting city such that the total length of the
tour should be minimum.
➔ It is a NP-Complete problem so, there is no polynomial time.
➔ Use an approximation algorithm with a constant approximation
ratio.
11
Special Case of
Travelling
Salesman
Problem (TSP)
Triangle Inequality Property
a + b >= c
b + c >= a
a + c >= b
12
Approach
13
Step 1: Start with a complete graph.
Step 2: Compute a Minimum Spanning
Tree (MST) using algorithms like Prim’s,
kruskal’s.
Step 3: Perform a Depth-First Search
(DFS) traversal.
Step 4: Delete duplicate vertices.
Step 5: Join the edges in the order to
obtain approx. tour walk.
Given a weighted, undirected graph,
start from certain vertex, find a
minimum route to visit each vertices
once, and return to the original
vertex.
14
Computing Minimum Spanning Tree
Kruskal’s algorithm
Steps:
1. Sort all the edges in non-decreasing order
of their weight.
2. Pick the smallest edge. Check if it forms a
cycle in the spanning tree formed so far. If no
cycle is formed, include this edge. Otherwise,
discard it.
3. Repeat step 2 until it is a spanning tree.
15
After computing the
minimum spanning tree ,
we perform a depth-first
search in the MST
starting from a vertex A.
16
MST-DFS
17
A -> B -> D -> B
18
A -> B -> D -> B -> E -> B -> A
19
A -> B -> D -> B -> E -> B -> A -> C -> A
After deleting duplicate vertices we
get, A -> B -> D -> E -> C -> A path.
Joining the edges in the above
order we obtain the approx. tour
route.
20
Analysis
➔ Depth first tree tour (DFTT) length is exactly twice the MST’s weight.
➔ MST weight is not more than the length of optimal tour
➔ The tour length is at most twice the optimal length i.e C <= 2 x Copt
So, in this case ρ(n) = 2
Cost found by the APPROX-MST-DFS algorithm :
C = 15 + 10 + 25 + 25 + 30 = 105
Optimal cost ( Copt ) = Sum of MST weights = 15 + 10 + 25 + 10 = 60
C/Copt <= ρ(n)
105/60 <= 2
1.75 <= 2
21
➔ For companies like FedEx and their competitors traveling
salesman problem is used as a reference to solve related
/similar problems.
➔ Can be used in network design and routing purposes.
➔ Used in astronomy to determine the fastest way of drilling an
aluminium disk placed at the focal point of telescope for each
spot of interest to collect the light from the galaxy or star over
a given period of time .
22
Application
Pros
➔ Deals with NP- Complete
problems
➔ Finds solutions which are close
to optimal solution in
polynomial time
➔ Cost Effective
Cons
➔ This technique does not
guarantee the best solution
➔ May not be useful in all
practical application
23
Conclusion
To conclude we can say that the goal of an approximation
algorithm is to come as close as possible to the optimum value
in a reasonable amount of time which is at the most polynomial
time.
24
Thank you !!
25

More Related Content

What's hot

0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and boundAbhishek Singh
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithmsGanesh Solanke
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problemJayesh Chauhan
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentationSubid Biswas
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmHema Kashyap
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithmRezwan Siam
 
Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.mohanrathod18
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesFahim Ferdous
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AIVishal Singh
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problemhamza haseeb
 

What's hot (20)

String matching algorithm
String matching algorithmString matching algorithm
String matching algorithm
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
Approximation algorithms
Approximation algorithmsApproximation algorithms
Approximation algorithms
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Tsp branch and-bound
Tsp branch and-boundTsp branch and-bound
Tsp branch and-bound
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.Mathematical Analysis of Non-Recursive Algorithm.
Mathematical Analysis of Non-Recursive Algorithm.
 
BackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and ExamplesBackTracking Algorithm: Technique and Examples
BackTracking Algorithm: Technique and Examples
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Travelling salesman problem
Travelling salesman problemTravelling salesman problem
Travelling salesman problem
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 

Similar to Approximation algorithms

Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem sumit gyawali
 
UNIT-II.pptx
UNIT-II.pptxUNIT-II.pptx
UNIT-II.pptxJyoReddy9
 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxUnit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxMaryJacob24
 
Introduction to dynamic programming
Introduction to dynamic programmingIntroduction to dynamic programming
Introduction to dynamic programmingAmisha Narsingani
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design PatternsAshwin Shiv
 
Dynamic programmng2
Dynamic programmng2Dynamic programmng2
Dynamic programmng2debolina13
 
clear allclc Ex2-1 A) Compute the 5 gravity profiles.docx
clear allclc Ex2-1 A)  Compute the 5 gravity profiles.docxclear allclc Ex2-1 A)  Compute the 5 gravity profiles.docx
clear allclc Ex2-1 A) Compute the 5 gravity profiles.docxmonicafrancis71118
 
Unit 3 - Greedy Method
Unit 3  - Greedy MethodUnit 3  - Greedy Method
Unit 3 - Greedy MethodMaryJacob24
 
Unit 3 greedy method
Unit 3  greedy methodUnit 3  greedy method
Unit 3 greedy methodMaryJacob24
 
ETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxRahulSingh190790
 
Particle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman ProblemParticle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman ProblemIRJET Journal
 
Data_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.pptData_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.pptISHANAMRITSRIVASTAVA
 
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...WILIAMMAURICIOCAHUAT1
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsMuthu Vinayagam
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchAmrinder Arora
 

Similar to Approximation algorithms (20)

NP-Completeness - II
NP-Completeness - IINP-Completeness - II
NP-Completeness - II
 
Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem Presentation of daa on approximation algorithm and vertex cover problem
Presentation of daa on approximation algorithm and vertex cover problem
 
UNIT-II.pptx
UNIT-II.pptxUNIT-II.pptx
UNIT-II.pptx
 
Unit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptxUnit 3- Greedy Method.pptx
Unit 3- Greedy Method.pptx
 
Introduction to dynamic programming
Introduction to dynamic programmingIntroduction to dynamic programming
Introduction to dynamic programming
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
 
Combinatorial Optimization
Combinatorial OptimizationCombinatorial Optimization
Combinatorial Optimization
 
Algorithms Design Patterns
Algorithms Design PatternsAlgorithms Design Patterns
Algorithms Design Patterns
 
Dynamic programmng2
Dynamic programmng2Dynamic programmng2
Dynamic programmng2
 
clear allclc Ex2-1 A) Compute the 5 gravity profiles.docx
clear allclc Ex2-1 A)  Compute the 5 gravity profiles.docxclear allclc Ex2-1 A)  Compute the 5 gravity profiles.docx
clear allclc Ex2-1 A) Compute the 5 gravity profiles.docx
 
Unit 3 - Greedy Method
Unit 3  - Greedy MethodUnit 3  - Greedy Method
Unit 3 - Greedy Method
 
Unit 3 greedy method
Unit 3  greedy methodUnit 3  greedy method
Unit 3 greedy method
 
ETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptxETCS262A-Analysis of design Algorithm.pptx
ETCS262A-Analysis of design Algorithm.pptx
 
Greedymethod
GreedymethodGreedymethod
Greedymethod
 
Particle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman ProblemParticle Swarm Optimization to Solve Multiple Traveling Salesman Problem
Particle Swarm Optimization to Solve Multiple Traveling Salesman Problem
 
Data_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.pptData_Structure_and_Algorithms_Lecture_1.ppt
Data_Structure_and_Algorithms_Lecture_1.ppt
 
Computer Science Exam Help
Computer Science Exam Help Computer Science Exam Help
Computer Science Exam Help
 
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
APLICACIONES DE LA DERIVADA EN LA CARRERA DE (Mecánica, Electrónica, Telecomu...
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
 

Recently uploaded

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 

Approximation algorithms

  • 2. Outline 2 ➔ Introduction ➔ Optimization Problem ➔ Statement ➔ Approximation Ratio ➔ Examples of Approximation algorithms ➔ Travelling Salesman Problem (TSP) ➔ Analysis ➔ Application ➔ Pros and Cons ➔ ‘Conclusion
  • 3. Introduction Approximation algorithms refers to the efficient algorithms that finds a solution to an optimization problems ( in particular NP-Hard problems ) that is provably close to optimal solution. When it is used ? ➔ When finding an optimal solution is very difficult ➔ In some cases, where exact solution is not needed and near- optimal solution can be found quickly 3
  • 4. ➔ For NP-Complete problems, there is possibly no polynomial-time algorithms to find an optimal solution. ➔ The idea of approximation algorithms is to develop polynomial-time algorithms to get near optimal solution. 4
  • 5. Optimization Problem It refers to the problem of finding best option/solution among all feasible/possible solutions. Various important applied problems involve in finding the best possible way to accomplish the task which is often done by finding the maximum or minimum values to a function. ➔ Maximization Problem : Finding the maximum optimal value ➔ Minimization Problem : Finding the minimal optimum value For example: the minimum time to make a certain journey, the minimum cost for doing a task, the maximum power that can be generated by a device, and so on. 5
  • 6. Statement ➔ An algorithm for a problem of size n has an approximation ratio ρ(n) if for any input, the algorithm produces a solution with cost C that satisfies the property: Where Copt is the cost of optimal solution and ρ(n) is a constant or a function of n. 6
  • 7. Approximation Ratio ➔ The approximation ratio of an algorithm is the ratio between the result obtained by the algorithm and the optimal cost. Significance ➔ Performance Guarantee: It guarantees that the result produced by the approximation algorithm is not going to be worse than a factor of ρ(n) compared to the optimal solution. 7
  • 8. The algorithm with approximation ratio ρ(n) is then called ρ(n)-approximation algorithm. Here we will consider our approximation algorithm to have constant approximation ratio. For example: If ρ(n) = 2 then, For maximization problem : our solution will be no less than half the optimal solution. ( Copt/C <= 2 ) For minimization problem : our solution will be no more than twice the optimal solution. (C/Copt <= 2) 8
  • 9. Range of Approximation ratio ➔ If ρ(n) =1 then, The algorithm can always find a optimal solution ➔ If ρ(n) >1 then, It gives the approximation in which the algorithm works. 9
  • 10. 10 Examples of Approximation algorithms ➔ Travelling salesman Problem ➔ Vertex-Cover Problem ➔ Bin Packing
  • 11. Travelling Salesman Problem (TSP) A salesman should visit all the cities exactly once starting from one city and return back to the starting city such that the total length of the tour should be minimum. ➔ It is a NP-Complete problem so, there is no polynomial time. ➔ Use an approximation algorithm with a constant approximation ratio. 11
  • 12. Special Case of Travelling Salesman Problem (TSP) Triangle Inequality Property a + b >= c b + c >= a a + c >= b 12
  • 13. Approach 13 Step 1: Start with a complete graph. Step 2: Compute a Minimum Spanning Tree (MST) using algorithms like Prim’s, kruskal’s. Step 3: Perform a Depth-First Search (DFS) traversal. Step 4: Delete duplicate vertices. Step 5: Join the edges in the order to obtain approx. tour walk.
  • 14. Given a weighted, undirected graph, start from certain vertex, find a minimum route to visit each vertices once, and return to the original vertex. 14
  • 15. Computing Minimum Spanning Tree Kruskal’s algorithm Steps: 1. Sort all the edges in non-decreasing order of their weight. 2. Pick the smallest edge. Check if it forms a cycle in the spanning tree formed so far. If no cycle is formed, include this edge. Otherwise, discard it. 3. Repeat step 2 until it is a spanning tree. 15
  • 16. After computing the minimum spanning tree , we perform a depth-first search in the MST starting from a vertex A. 16
  • 17. MST-DFS 17 A -> B -> D -> B
  • 18. 18 A -> B -> D -> B -> E -> B -> A
  • 19. 19 A -> B -> D -> B -> E -> B -> A -> C -> A
  • 20. After deleting duplicate vertices we get, A -> B -> D -> E -> C -> A path. Joining the edges in the above order we obtain the approx. tour route. 20
  • 21. Analysis ➔ Depth first tree tour (DFTT) length is exactly twice the MST’s weight. ➔ MST weight is not more than the length of optimal tour ➔ The tour length is at most twice the optimal length i.e C <= 2 x Copt So, in this case ρ(n) = 2 Cost found by the APPROX-MST-DFS algorithm : C = 15 + 10 + 25 + 25 + 30 = 105 Optimal cost ( Copt ) = Sum of MST weights = 15 + 10 + 25 + 10 = 60 C/Copt <= ρ(n) 105/60 <= 2 1.75 <= 2 21
  • 22. ➔ For companies like FedEx and their competitors traveling salesman problem is used as a reference to solve related /similar problems. ➔ Can be used in network design and routing purposes. ➔ Used in astronomy to determine the fastest way of drilling an aluminium disk placed at the focal point of telescope for each spot of interest to collect the light from the galaxy or star over a given period of time . 22 Application
  • 23. Pros ➔ Deals with NP- Complete problems ➔ Finds solutions which are close to optimal solution in polynomial time ➔ Cost Effective Cons ➔ This technique does not guarantee the best solution ➔ May not be useful in all practical application 23
  • 24. Conclusion To conclude we can say that the goal of an approximation algorithm is to come as close as possible to the optimum value in a reasonable amount of time which is at the most polynomial time. 24