Usage examples of greedy algorithms?

后端 未结 10 1838
孤城傲影
孤城傲影 2021-02-02 15:36

What is the use of greedy algorithms? An real example?

相关标签:
10条回答
  • 2021-02-02 16:12

    I'm surprised no one pointed out huffman / shannon encoding ...

    0 讨论(0)
  • 2021-02-02 16:14

    Anything where an optimal solution would be impossible - or very very hard.

    Greedy algorithms take the best solution at the current point, even if that's not the best solution if you examined all aternatives

    0 讨论(0)
  • 2021-02-02 16:20

    What is the use of greedy algorithms?

    Greedy algorithms is choosing the best/optimal solution in each stage. Look at wikipedia article

    An real example?

    Minimum spanning tree algorithms are greedy algorithms

    • Prim's algorithm
    • Kruskal algorithm
    • Reverse-Delete Algorithm

    The famous Dijkstra's Algorithm is also greedy algorithm

    0 讨论(0)
  • 2021-02-02 16:21

    Here i have listed some Greedy algorithms and their potential real world use cases.

    Dijkstra's Algorithm

    • IP routing to find Open shortest Path First.
    • Networkrouting protocols

    Find more about the real world applications of Dijkstra's algorithm here

    Prim's Minimal Spanning Tree Algorithm

    • Cluster Analysis.

    • Real-time face tracking and verification (i.e. locating human faces in a video stream).

    • Protocols in computer science to avoid network cycles.

    • Entropy based image registration

    • Max bottleneck paths.

    • Dithering (adding white noise to a digital recording in order to reduce distortion).

    Travelling Salesman Problem

    • Job shop scheduling with no intermediate storage

    • Clustering a data array

    • Vehicle routing

    Graph - Map Coloring

    • Making schedule /Time table

    • Sudoku

    • Mobile radio Frequency Assignment

    You can read about this more in this paper

    Kruskal's Minimal Spanning Tree Algorithm

    • TV network formation

    • Tour operations

    Knapsack Problem

    • Used in Internet Download managers

    • Real world usage of deciding what to carry in a limited package trips

    0 讨论(0)
  • 2021-02-02 16:24

    What is the use of greedy algorithms?

    We use Greedy Algorithm for to get optimal solution.But all problems can't solve using greedy algorithm.

    Optimal substructure property and greedy choice property are key ingredients.if we can demonstrate that the problem has these properties, then we are well on the way to developing a greedy algorithm for it.

    Real examples?

    • Activity sheduling problem
    • Huffman code
    • Coin denomination
    • Single source shortest path problem (Dijkstra)
    • Minimum spanning tree (Prim's algoritnm ,Kruskal's algorithm)
    • Fractional Knapsack problem.

    Almost all problems that can solve using Dynamic approach can be solve by greedy approach.

    0 讨论(0)
  • 2021-02-02 16:25

    Minimum Spanning Tree - Prim's algorithm and Kruskal's algorithm

    Shortest Path Calculation - Dijkstra's algorithm

    More: (Fractional Knapsack Problem, Huffman Coding, Optimal Merging, Topological Sort).

    0 讨论(0)
提交回复
热议问题