Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Analysis and Design of Algorithms - Greedy Technique

Rating
-
Sold
-
Pages
21
Uploaded on
13-06-2022
Written in
2021/2022

This unit you covers the concepts of Greedy technique algorithms that are Used for optimization problems such as Kruskal's algorithm and F algorithm for finding minimum spanning trees. It also describes the Dijkstra s algorithm for finding single-source shortest paths, and the algorithm for finding optimum Huffman trees

Show more Read less
Institution
Course

Content preview

Unit 12 Greedy Technique
Structure:
12.1 Introduction

12.2
Objectives
Introduction to Greedy Technique
Types of greedy algorithm
Greedy choice property
Applications of greedy technique
12.3 Prim's Algorithm
Description
Correctness
Time complexity
12.4 Kruskal's Algorithm
Description
Correctness
Time complexity
12.5 Dijkstra's Algorithm
Description
Correctness
Time complexity
12.6 Huffman Trees
Huffman code
Constructing Huffman tree
Constructing Huffman code
12.7 Summary
12.8 Glossary
12.9 Terminal Questions
12.10 Answers

12.1 Introduction
In the previous unit we learnt about dynamic programming which is an
optimization technique. In this unit you will learn the concepts of Greedy
technique algorithms that are used for optimization problems such as
Kruskal's algorithm and Prim's algorithm for finding minimum spanning
trees. You will also learn about Dijkstra's algorithm for finding single-source
shortest paths, and the algorithm for finding optimum Huffman trees.

,objectives:
After studying this unit you should be able to:
describe the Greedy technique
construct Prim's,Kruskal's and Dijkstra's
algorithm
check for correctness of Prim's, Kruskal's and
Dijkstra's algorithm
construct the algorithm for finding optimum Huffman trees
12.2 Introduction to Greedy Technique
The Greedy technique constructs a solution to an
through a sequence of choices, each expanding a optimization problem
partially constructed
solution until a complete solution to the problem is reached.
The sequences of choices made should be:
Feasible, i.e. satisfying the constraints
.Locally optimal with respect to a neighborhood definition
Greedy in terms of some measures and irrevocable
The greedy algorithm, always takes the best immediate solution while
finding an answer.
Greedy algorithms find the globally optimal solution for
some optimization problems.
Now, let us see the different types of greedy techniques.
12.2.1 Types of greedy algorithm
Greedy algorithms can be classified as 'short sighted', and as
recoverable'. They are ideal for problems with 'non
optimal substructure. Greedy
algorithms are best suited for simple problems like giving
greedy algorithm can also be used as a selection algorithmchange.
The
to prioritize
options within a search, or branch and bound algorithm. The
few variations to the greedy following are a
algorithm:
Pure greedy algorithms
Orthogonal greedy algorithms
Relaxed greedy algorithms
Pure greedy algorithm
Pure greedy algorithm makes local choices in all iterations in order to find an
optimal solution. The Pure greedy algorithm chooses functions to use in
approximating.
Relaxed greedy algorithm
he Relaxed the approximation order,
greedy algorithm provides and gives
aConstructive proof of the estimate. There are several variants of the
elaxed greedy algorithm and their application for different dictionaries.

, Orthogonal greedy algorithm
In Orthogonal greedy algorithm the best approximation from the functions

generated at each iteration is taken.

12.2.2 Greedy-choice property
In greedy algorithms a globally optimal solution is arrived by making a
when considering which
locallyoptimal (greedy) choice That is to say
choice to make, the choice that looks best in the current problem, without
choices made
considering results from sub problems is selected. The by a

greedy algorithm can depend on choices of the past. but
it cannot depend
on any future choices or on the solutions to sub problems. This Is where

greedy algorithm differs from dynamic programming
In dynamic programming, choices are made at each step. but the choice
usually depends on the solutions to sub problems. Dynamic-programming
solves problems in bottom-up manner that is solving from smaller sub
problems to larger sub problems
Therefore a greedy strategy usually progresses in a top-down fashion
making one greedy choice after another, reducing each given problem
instance to a smaller one.

There are various applications of greedy technique. Let us see those next
12.2.3 Applications of greedy technique
if a greedy algorithm is proven to yield the global optimum solution for a
given problem class, it becomes the method of choice because it is faster
than other optimization methods hence such algorithms can be applied in
the following areas
Optimal solutions:
Change making for "normal" coin denominations
Minimum spanning tree (MST)
o


Single-source shortest paths
o
Simple scheduling problems
Huffman codes
Approximations/heuristics:
o Traveling salesman problem (TSP)
o Knapsack problem
Other combinatorial optimization problems

Written for

Institution
Course

Document information

Uploaded on
June 13, 2022
Number of pages
21
Written in
2021/2022
Type
Class notes
Professor(s)
Joseph
Contains
All classes

Subjects

$3.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
nikhilcs

Also available in package deal

Get to know the seller

Seller avatar
nikhilcs Nikhil
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
14
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions