Module #7 Flashcards
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
greedy algorithms have how many components
5 components
from which a solution is created
Candidate Set
which chooses the best
candidate to be added to the solution
Selection Function
that is used to determine if a
candidate can be used to contribute to a solution
Feasibility Function
which assigns a value to a
solution, or a partial solution, and
Objective Function
which will indicate when we have
discovered a complete solution
Solution Function
is a greedy algorithm that finds a minimum spanning tree for a weighted
undirected graph.
Prim’s Algorithm
also known as Jarnik’s Algorithm
Prim’s Algorithm
The algorithm operates by building this tree one vertex at a time, from
an arbitrary starting vertex, at each step adding the cheapest possible
connection from the tree to another vertex.
Prim’s Algorithm
The prim’s algorithm was developed in ____ by Czech mathematician Vojtěch Jarník
1930
Prim’s Algorithm was later rediscovered and republished by computer scientists Robert C. Prim in
1957
Prim’s Algorithm was later rediscovered and republished by computer scientists Robert C. Prim and Edsger W. Dijkstra in
1959
Time Complexity of Prim’s Algorithm
O(n^2)
Each iteration of for loop takes
O(n) time