Skip to content

Prim'S Algorithm

Pranav Kumar edited this page Aug 26, 2019 · 1 revision

Prim'S Algorithm

Prim-MST(G)
     Select an arbitrary vertex s to start the tree from.
     While (there are still nontree vertices)
         Select the edge of minimum weight between a tree and nontree vertex
          Add the selected edge and vertex to the tree Tprim.

Graph Traversal

  • BFS
  • DFS

Graph Types

Clone this wiki locally