greedy algoritham

10
Greedy Algorithm PRESENTED BY: Mehul Gadhiya

Upload: rj-mehul-gadhiya

Post on 08-Aug-2015

53 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Greedy Algoritham

Greedy Algorithm

PRESENTED BY:

Mehul Gadhiya

Page 2: Greedy Algoritham

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?????

Page 3: Greedy Algoritham

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 algorithm says????????What Greedy algorithm says????????

Every optimum solution will give you more positive effect on optimum solution.

Page 4: Greedy Algoritham

4

Greedy Algorithm...........................Greedy 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.

Page 5: Greedy Algoritham

5

Greedy Algorithm...........................Greedy 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

Page 6: Greedy Algoritham

6

Greedy Algorithm...........................Greedy 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=500150 x 1=15030 x 3=903 x 3=3

Total 6 note and 3 coin

Page 7: Greedy Algoritham

7

Greedy Algorithm...........................Greedy Algorithm...........................

TASK SCHEDULING.........

# task is N ,so as per regular techniqe we decide that we must have a N machine...

Example:-

Page 8: Greedy Algoritham

8

Greedy Algorithm...........................Greedy Algorithm...........................

TASK SCHEDULING.........

2.)recursive it......3.)Task can be completed using minimum machine---> again it deoends on domains............

Page 9: Greedy Algoritham

9

Example of finding a ball which has more weight than out of 100 balls (We have also solved in R.S.Agrewal)

Greedy Greedy Algorithm...........................Algorithm...........................

Page 10: Greedy Algoritham

T THANK YOUTHANK YOU