Module 7 Flashcards
It is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage with the intent of finding a global optimum.
Greedy Algorithm
In many problems, it does not usually produce an optimal solution.
Greedy Strategy/Algorithm
It may yield locally optimal solutions that approximate a globally optimal solution in a reasonable amount of time.
Greedy Heuristic/Algorithm
What is the heuristic of the travelling salesman problem?
“At each step of the journey, visit the nearest unvisited city.”
This heuristic does not intend to find a best solution, but it terminates in a reasonable number of steps.
Greedy Algorithm/Heuristic
In mathematical optimization, these optimally solve combinatorial problems having the properties of matroids, and give constant-factor approximations to optimization problems with submodular structure.
Greedy Algorithm
What are the Five Components of Greedy Algorithms?
(Ca - Se - F - O - S)
- Candidate Set
- Selection Function
- Feasibility Function
- Objective Function
- Solution Function
This component creates a solution.
Candidate Set
This component chooses the best candidate to be added to the solution.
Selection Function
This component determines if a candidate can be used to contribute to a solution.
Feasibility Function
This component assigns a value to a solution or a partial solution.
Objective Function
This component indicates when we have discovered a complete solution.
Solution function
What are the advantages of Greedy Algorithm?
- Finding a solution is quite easy.
- Analyzing the run time is generally much easier than other techniques.
What are the disadvantages of Greedy Algorithm?
- You have to work much harder to understand correctness issues.
- Even with the correct algorithm, it is hard to prove why it is correct.
- Proving that a greedy algorithm is correct is more of an art than a science.
In computer science, this algorithm (also known as Jarnik’s algorithm) is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph.
Prim’s Algorithm
This algorithm finds a subset of the edges that forms a tree that includes every vertex, where the total weight of all the edges in the tree is minimized.
Prim’s Algorithm
This algorithm operates by building this tree one vertex at a time, starting from an arbitrary vertex, at each step adding the cheapest possible connection from the tree to another vertex.
Prim’s Algorithm
When was Jarnik’s algorithm developed?
1930 by Czech Mathematician Vojtech Jarnik (Jarnik30)
When was Jarnik’s algorithm rediscovered by Robert C. Prim?
1957 (Prim57)
Prim’s Algorithm is also called?
- Jarnik’s Algorithm
- Prim-Jarnik Algorithm
- Prim-Dijkstra Algorithm
- DJP Algorithm