SlideShare a Scribd company logo
1 of 42
• Stick with small
problems
• Stick with small problems.
• Find special cases solvable in polynomial
time.
• Stick with small problems.
• Find special cases solvable in polynomial time.
• Find near –optimal solutions with approximate
algorithms
Approximation
Algorithms
By Riya Singh
Introduction
 An Approximate Algorithm is a way of approach NP-COMPLETENESS for the
optimization problem. This technique does not guarantee the best solution.
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. Such algorithms are called approximation algorithm or
heuristic algorithm.
 For the traveling salesperson problem, the optimization problem is to find the
shortest cycle, and the approximation problem is to find a short cycle.
 For the vertex cover problem, the optimization problem is to find the vertex cover
with fewest vertices, and the approximation problem is to find the vertex cover
with few vertices.
Performance Ratios
 If for any input of size n, the cost C of the
solution produced by the algorithm is
within a factor of ρ(n) of the cost C* of an
optimal solution:
Max ( C/C* , C*/C ) ≤ ρ(n)
 We call this algorithm as an ρ(n)-
approximation algorithm.
Terminology
 P: Represents an NP-Hard problem such as 0/1 Knapsack or Traveling
Salesperson Problem.
 I: Represents an instance of problem P.
 F*(I): Represents an optimal solution to I.
 F^(I): Represents feasible solution produced for I by an approximation
algorithm.
 A: Represents an algorithm that generates a feasible solution to every
instance I of a problem P.
F*(I)>F^(I) if P is a maximization problem
F^(I)>F*(I) if P is a minimization problem
Approximation Scheme
 Absolute Approximation: A is absolute approximation
algorithm for problem P iff for every instance I of P,
|F*(I)-F^(I)|<=k for some constant k.
 f(n)-Approximation: A is an f(n)-approximation
algorithm of problem P iff for every instance I of size
n, |F*(I) – F^(I) |/ F*(I) <= f(n) for F*(I) >0.
 ε-Approximation: A is an epsilon (ε) approximation
algorithm of problem P iff A is f(n)-approximation
algorithm for which f(n) <=ε, where ε is some
constant.
Vertex Cover
The vertex-cover problem is to find a
vertex cover of minimum size in a
given undirected graph. We call such
a vertex cover an optimal vertex
cover. This problem is the
optimization version of an NP-
complete decision problem.
Vertex Cover
The VERTEX COVER problem is NP-hard.
VERTEX COVER
Input: An undirected graph G = (V, E).
Output: A subset of the vertices S ⊆ V
that touches every edge.
Goal: Minimize |S|.
Input: G
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
Output: C = { b, d, e }
b
a
c
e
d
f
gf
Greedy-Vertex-Cover (G)
1. C={ }
2. do choose v in V with max deg
3. C = C + {v}
4. remove v
5. and every edge adjacent to v
6. until all edges are covered
7. return C
Input: G
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
3 possible choices here determines the outcome
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
b
a
c
e
d
f
gf
Goodness of solution depends on
the (random) choices made
b
a
c
e
d
f
gf
Vertex Cover Algorithm
Approx-Vertex-Cover (G = (V, E))
{
C = empty-set;
E'= E;
While E' is not empty do
{
Let (u, v) be any edge in E': (*)
Add u and v to C;
Remove from E' all edges incident to
u or v;
}
Return C;
}
C={ }
E={ (a-b), (b-c), (c-e), (c-d), (e-f), (e-d), (f-d), (d-g) }
b
a
c
e
d
f
gf
C={ }
E={ (a-b), (b-c), (c-e), (c-d), (e-f), (e-d), (f-d), (d-g) }
b
a
c
e
d
f
gf
C={(b-c) }
E={ (e-f), (e-d), (f-d), (d-g) }
b
a
c
e
d
f
gf
C={(b-c) }
E={ (e-f), (e-d), (f-d), (d-g) }
b
a
c
e
d
f
gf
C={(b-c), (e-f) }
E={ (d-g) }
b
a
c
e
d
f
gf
C={ (b-c), (e-f) }
E={ (d-g) }
b
a
c
e
d
f
gf
C={ (b-c), (e-f), (d-g) }
E={ }
b
a
c
e
d
f
gf
C={ (b-c), (e-f), (d-g) }
C={ b, c, e, f, d, g }
|C|=6=2.3<=2.|C*|
the algorithm found a 2- approximation
b
a
c
e
d
f
gf
The traveling-salesman problem
 In the traveling salesman Problem, a salesman must visits n
cities. We can say that salesman wishes to make a tour or
Hamiltonian cycle, visiting each city exactly once and finishing
at the city he starts from. There is a non-negative cost c (i, j)
to travel from the city i to city j. The goal is to find a tour of
minimum cost. We assume that every two cities are connected.
Such problems are called Traveling-salesman problem (TSP).
 We can model the cities as a complete graph of n vertices,
where each vertex represents a city.
 It can be shown that TSP is NPC.
Traveling salesman problem
Given an undirected weighted
Graph G we are to find a
minimum cost Hamiltonian cycle.
Satisfying triangle inequality or
not this problem is NP-Complete.
We can solve Hamiltonian path.
Traveling salesman problem
Exact exponential
solution:
Branch and bound
• Lower bound: (sum of two
lower degree of vertices)/2
Traveling salesman problem
A: 2+3
B: 3+3
C: 4+4
D: 2+5
E: 3+6
= 35
Bound: 17.5
d
c
e
ba
7 4
3
3
56
2
6
4
Traveling salesman problem with
triangle inequality.
APPROX-TSP-TOUR(G, c)
1 select a vertex r Є V[G] to be root.
2 compute a MST for G from root r using Prim
Alg.
3 L=list of vertices in preorder walk of that MST.
4 return the Hamiltonian cycle H in the order L.
Traveling salesman problem with
triangle inequality.
root
MST
Pre-Order walk Hamiltonian
Cycle
The set-Cover
Generalization of vertex-cover problem.
We have given (X,F) :
X : a finite set of elements.
F : family of subsets of X such that every
element of X belongs to at least one subset
in F.
Solution C : subset of F that Includes all the
members of X.
Any Question?

More Related Content

What's hot

Linear programming in computational geometry
Linear programming in computational geometryLinear programming in computational geometry
Linear programming in computational geometryhsubhashis
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexityparamita30
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingzukun
 
Mb0048 operations research
Mb0048 operations researchMb0048 operations research
Mb0048 operations researchsmumbahelp
 
Transportation and assignment_problem
Transportation and assignment_problemTransportation and assignment_problem
Transportation and assignment_problemAnkit Katiyar
 
Reoptimization techniques for solving hard problems
Reoptimization techniques for solving hard problemsReoptimization techniques for solving hard problems
Reoptimization techniques for solving hard problemsJhoirene Clemente
 
Global optimization
Global optimizationGlobal optimization
Global optimizationbpenalver
 
COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY
COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY
COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY SOURAV DAS
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Amrinder Arora
 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programminghodcsencet
 
NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING karishma gupta
 
Adauctions
AdauctionsAdauctions
Adauctions超 刘
 
Value Function Geometry and Gradient TD
Value Function Geometry and Gradient TDValue Function Geometry and Gradient TD
Value Function Geometry and Gradient TDAshwin Rao
 
Numerical on dichotomous search
Numerical on dichotomous searchNumerical on dichotomous search
Numerical on dichotomous searchSumita Das
 
Mixed-integer and Disjunctive Programming - Ignacio E. Grossmann
Mixed-integer and Disjunctive Programming - Ignacio E. GrossmannMixed-integer and Disjunctive Programming - Ignacio E. Grossmann
Mixed-integer and Disjunctive Programming - Ignacio E. GrossmannCAChemE
 
dynamic programming Rod cutting class
dynamic programming Rod cutting classdynamic programming Rod cutting class
dynamic programming Rod cutting classgiridaroori
 

What's hot (20)

Linear programming in computational geometry
Linear programming in computational geometryLinear programming in computational geometry
Linear programming in computational geometry
 
Amortized complexity
Amortized complexityAmortized complexity
Amortized complexity
 
Skiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programmingSkiena algorithm 2007 lecture16 introduction to dynamic programming
Skiena algorithm 2007 lecture16 introduction to dynamic programming
 
Mb0048 operations research
Mb0048 operations researchMb0048 operations research
Mb0048 operations research
 
Transportation and assignment_problem
Transportation and assignment_problemTransportation and assignment_problem
Transportation and assignment_problem
 
Reoptimization techniques for solving hard problems
Reoptimization techniques for solving hard problemsReoptimization techniques for solving hard problems
Reoptimization techniques for solving hard problems
 
Global optimization
Global optimizationGlobal optimization
Global optimization
 
COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY
COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY
COST NOTES LECTURE ALL COST CURVES NUMERICALS EXAMPLES THEORY
 
Lecture11
Lecture11Lecture11
Lecture11
 
Constrained Optimization
Constrained OptimizationConstrained Optimization
Constrained Optimization
 
Golden Section method
Golden Section methodGolden Section method
Golden Section method
 
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
Bron Kerbosch Algorithm - Presentation by Jun Zhai, Tianhang Qiang and Yizhen...
 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programming
 
DP
DPDP
DP
 
NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING NON LINEAR PROGRAMMING
NON LINEAR PROGRAMMING
 
Adauctions
AdauctionsAdauctions
Adauctions
 
Value Function Geometry and Gradient TD
Value Function Geometry and Gradient TDValue Function Geometry and Gradient TD
Value Function Geometry and Gradient TD
 
Numerical on dichotomous search
Numerical on dichotomous searchNumerical on dichotomous search
Numerical on dichotomous search
 
Mixed-integer and Disjunctive Programming - Ignacio E. Grossmann
Mixed-integer and Disjunctive Programming - Ignacio E. GrossmannMixed-integer and Disjunctive Programming - Ignacio E. Grossmann
Mixed-integer and Disjunctive Programming - Ignacio E. Grossmann
 
dynamic programming Rod cutting class
dynamic programming Rod cutting classdynamic programming Rod cutting class
dynamic programming Rod cutting class
 

Similar to Approximation

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
 
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Nguyễn Công Hoàng
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Deepak John
 
Linear programming in computational geometry
Linear programming in computational geometryLinear programming in computational geometry
Linear programming in computational geometrySubhashis Hazarika
 
DAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptxDAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptxvaishnavi339314
 
Combinatorial optimization CO-1
Combinatorial optimization CO-1Combinatorial optimization CO-1
Combinatorial optimization CO-1man003
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsMuthu Vinayagam
 
Introduction to optimizxation
Introduction to optimizxationIntroduction to optimizxation
Introduction to optimizxationhelalmohammad2
 
Combinatorial optimization CO-2
Combinatorial optimization CO-2Combinatorial optimization CO-2
Combinatorial optimization CO-2man003
 
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
 

Similar to Approximation (20)

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
 
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
Giáo trình Phân tích và thiết kế giải thuật - CHAP 8
 
Analysis of Algorithm
Analysis of AlgorithmAnalysis of Algorithm
Analysis of Algorithm
 
Approx
ApproxApprox
Approx
 
Analysis and design of algorithms part 4
Analysis and design of algorithms part 4Analysis and design of algorithms part 4
Analysis and design of algorithms part 4
 
Chap8 new
Chap8 newChap8 new
Chap8 new
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
Combinatorial Optimization
Combinatorial OptimizationCombinatorial Optimization
Combinatorial Optimization
 
Approximation algorithms
Approximation  algorithms Approximation  algorithms
Approximation algorithms
 
P vs NP
P vs NP P vs NP
P vs NP
 
Linear programming in computational geometry
Linear programming in computational geometryLinear programming in computational geometry
Linear programming in computational geometry
 
DAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptxDAA - UNIT 4 - Engineering.pptx
DAA - UNIT 4 - Engineering.pptx
 
Combinatorial optimization CO-1
Combinatorial optimization CO-1Combinatorial optimization CO-1
Combinatorial optimization CO-1
 
Undecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation AlgorithmsUndecidable Problems and Approximation Algorithms
Undecidable Problems and Approximation Algorithms
 
Introduction to optimizxation
Introduction to optimizxationIntroduction to optimizxation
Introduction to optimizxation
 
Combinatorial optimization CO-2
Combinatorial optimization CO-2Combinatorial optimization CO-2
Combinatorial optimization CO-2
 
Daa chapter 3
Daa chapter 3Daa chapter 3
Daa chapter 3
 
Chap12 slides
Chap12 slidesChap12 slides
Chap12 slides
 
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
 

Recently uploaded

Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxPurva Nikam
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 

Recently uploaded (20)

Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
An introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptxAn introduction to Semiconductor and its types.pptx
An introduction to Semiconductor and its types.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

Approximation

  • 1.
  • 2. • Stick with small problems
  • 3. • Stick with small problems. • Find special cases solvable in polynomial time.
  • 4. • Stick with small problems. • Find special cases solvable in polynomial time. • Find near –optimal solutions with approximate algorithms
  • 6. Introduction  An Approximate Algorithm is a way of approach NP-COMPLETENESS for the optimization problem. This technique does not guarantee the best solution. 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. Such algorithms are called approximation algorithm or heuristic algorithm.  For the traveling salesperson problem, the optimization problem is to find the shortest cycle, and the approximation problem is to find a short cycle.  For the vertex cover problem, the optimization problem is to find the vertex cover with fewest vertices, and the approximation problem is to find the vertex cover with few vertices.
  • 7. Performance Ratios  If for any input of size n, the cost C of the solution produced by the algorithm is within a factor of ρ(n) of the cost C* of an optimal solution: Max ( C/C* , C*/C ) ≤ ρ(n)  We call this algorithm as an ρ(n)- approximation algorithm.
  • 8. Terminology  P: Represents an NP-Hard problem such as 0/1 Knapsack or Traveling Salesperson Problem.  I: Represents an instance of problem P.  F*(I): Represents an optimal solution to I.  F^(I): Represents feasible solution produced for I by an approximation algorithm.  A: Represents an algorithm that generates a feasible solution to every instance I of a problem P. F*(I)>F^(I) if P is a maximization problem F^(I)>F*(I) if P is a minimization problem
  • 9. Approximation Scheme  Absolute Approximation: A is absolute approximation algorithm for problem P iff for every instance I of P, |F*(I)-F^(I)|<=k for some constant k.  f(n)-Approximation: A is an f(n)-approximation algorithm of problem P iff for every instance I of size n, |F*(I) – F^(I) |/ F*(I) <= f(n) for F*(I) >0.  ε-Approximation: A is an epsilon (ε) approximation algorithm of problem P iff A is f(n)-approximation algorithm for which f(n) <=ε, where ε is some constant.
  • 10. Vertex Cover The vertex-cover problem is to find a vertex cover of minimum size in a given undirected graph. We call such a vertex cover an optimal vertex cover. This problem is the optimization version of an NP- complete decision problem.
  • 11. Vertex Cover The VERTEX COVER problem is NP-hard. VERTEX COVER Input: An undirected graph G = (V, E). Output: A subset of the vertices S ⊆ V that touches every edge. Goal: Minimize |S|.
  • 15. Output: C = { b, d, e } b a c e d f gf
  • 16. Greedy-Vertex-Cover (G) 1. C={ } 2. do choose v in V with max deg 3. C = C + {v} 4. remove v 5. and every edge adjacent to v 6. until all edges are covered 7. return C
  • 20. 3 possible choices here determines the outcome b a c e d f gf
  • 25. Goodness of solution depends on the (random) choices made b a c e d f gf
  • 26. Vertex Cover Algorithm Approx-Vertex-Cover (G = (V, E)) { C = empty-set; E'= E; While E' is not empty do { Let (u, v) be any edge in E': (*) Add u and v to C; Remove from E' all edges incident to u or v; } Return C; }
  • 27. C={ } E={ (a-b), (b-c), (c-e), (c-d), (e-f), (e-d), (f-d), (d-g) } b a c e d f gf
  • 28. C={ } E={ (a-b), (b-c), (c-e), (c-d), (e-f), (e-d), (f-d), (d-g) } b a c e d f gf
  • 29. C={(b-c) } E={ (e-f), (e-d), (f-d), (d-g) } b a c e d f gf
  • 30. C={(b-c) } E={ (e-f), (e-d), (f-d), (d-g) } b a c e d f gf
  • 31. C={(b-c), (e-f) } E={ (d-g) } b a c e d f gf
  • 32. C={ (b-c), (e-f) } E={ (d-g) } b a c e d f gf
  • 33. C={ (b-c), (e-f), (d-g) } E={ } b a c e d f gf
  • 34. C={ (b-c), (e-f), (d-g) } C={ b, c, e, f, d, g } |C|=6=2.3<=2.|C*| the algorithm found a 2- approximation b a c e d f gf
  • 35. The traveling-salesman problem  In the traveling salesman Problem, a salesman must visits n cities. We can say that salesman wishes to make a tour or Hamiltonian cycle, visiting each city exactly once and finishing at the city he starts from. There is a non-negative cost c (i, j) to travel from the city i to city j. The goal is to find a tour of minimum cost. We assume that every two cities are connected. Such problems are called Traveling-salesman problem (TSP).  We can model the cities as a complete graph of n vertices, where each vertex represents a city.  It can be shown that TSP is NPC.
  • 36. Traveling salesman problem Given an undirected weighted Graph G we are to find a minimum cost Hamiltonian cycle. Satisfying triangle inequality or not this problem is NP-Complete. We can solve Hamiltonian path.
  • 37. Traveling salesman problem Exact exponential solution: Branch and bound • Lower bound: (sum of two lower degree of vertices)/2
  • 38. Traveling salesman problem A: 2+3 B: 3+3 C: 4+4 D: 2+5 E: 3+6 = 35 Bound: 17.5 d c e ba 7 4 3 3 56 2 6 4
  • 39. Traveling salesman problem with triangle inequality. APPROX-TSP-TOUR(G, c) 1 select a vertex r Є V[G] to be root. 2 compute a MST for G from root r using Prim Alg. 3 L=list of vertices in preorder walk of that MST. 4 return the Hamiltonian cycle H in the order L.
  • 40. Traveling salesman problem with triangle inequality. root MST Pre-Order walk Hamiltonian Cycle
  • 41. The set-Cover Generalization of vertex-cover problem. We have given (X,F) : X : a finite set of elements. F : family of subsets of X such that every element of X belongs to at least one subset in F. Solution C : subset of F that Includes all the members of X.