본문 바로가기

00/algorithm

Greedy algorithm

반응형

- An algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. So the problems where choosing locally optimal also leads to global solution are best fit for Greedy.

- Fractional Knapsack Problem, the local optimal strategy is to choose the item that has maximum value vs weight ratio. This strategy also leads to global optimal solution because we allowed to take fractions of an item.

반응형

'0 > algorithm' 카테고리의 다른 글

Union Find  (0) 2020.08.31
Trie  (0) 2020.05.24
힙 정렬  (0) 2020.05.14
N-Queens  (0) 2019.03.26
Coin Change (DP)  (0) 2019.03.23