Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
    Greedy Algorithm
PRESENTED BY:
Mehul Gadhiya
2
Actually greeddy algorithms is not a algorithms
but its a one of the techniqe or method of
designing any algorithms.
It is a method by which you “may” have optimum
solution of your problem.
There are so many algorithms which are using
greddy technique for optimization.
What is Greedy algorithm?????What is Greedy algorithm?????
1.)Divide your problem in smaller object as
much as you can.
2.)Go for optimimum solution for that
problem.
3.)Do this process recursively.
What Greedy algorithmWhat Greedy algorithm
says????????says????????
Every optimum solution will give you more
positive effect on optimum solution.
4
GreedyGreedy
Algorithm.........................Algorithm.........................
....Let's illustrate it by
example..................
U= # of objects of problem
X= # of object choosen from U.
X ≤ U (X subset of U)
Ex:- Shifting of stuff of a house.
5
GreedyGreedy
Algorithm.........................Algorithm.........................
....
Greedy technique use in problem of changing in
cash............
Shopping------------> .₹ 247
Cash to counter person---> .₹ 1000
Change-------------> .₹ 753
Domains:--
From 500,100,50,10,5<----note
5,3,2,1<--------coin
500x1=500 100x2=200 50x1=50 2x1=2 1x1=1
Total 4 note and 3 coin
6
GreedyGreedy
Algorithm.........................Algorithm.........................
....
Greedy technique use in problem of changing in
cash............
Solution is Depend on domains......Solution is Depend on domains............
250,150,30<------note
1,3,10<-----coin
250 x 2=500
150 x 1=150
30 x 3=90
3 x 3=3
Total 6 note and 3 coin
7
GreedyGreedy
Algorithm.........................Algorithm.........................
....
TASK SCHEDULING.........
# task is N ,so as per regular techniqe we
decide that we must have a N machine...
Example:-
8
GreedyGreedy
Algorithm.........................Algorithm.........................
....
TASK SCHEDULING.........
2.)recursive it......
3.)Task can be completed using minimum
machine
---> again it deoends on
domains............
9
Example of finding a ball which has more weight
than out of 100 balls (We have also solved in
R.S.Agrewal)
GreedyGreedy
Algorithm.....................Algorithm.....................
............
THANK YOUTHANK YOU

More Related Content

Greedy Algoritham