About 12,200 results
Open links in new tab
  1. Prim’s Algorithm for Minimum Spanning Tree (MST)

    Aug 29, 2025 · Prim's algorithm relies on a priority queue, which can take up extra memory and slow down the algorithm on very large graphs. The choice of starting node can affect the MST …

  2. Prim's Algorithm in Python - GeeksforGeeks

    Jul 23, 2025 · Prim's algorithm is a greedy algorithm used to find the Minimum Spanning Tree (MST) of a connected, undirected graph. The MST is a subset of the edges that connects all …

  3. Prim's Algorithm in C - GeeksforGeeks

    Jul 23, 2025 · Let us consider the following example of weighted undirected graph and see how Prim's algorithm will generate the minimum spanning tree (MST) for it step-by-step:

  4. Kruskal’s Minimum Spanning Tree (MST) Algorithm

    Aug 26, 2025 · In Kruskal's algorithm, we sort all edges of the given graph in increasing order. Then it keeps on adding new edges and nodes in the MST if the newly added edge does not …

  5. Difference between Prim's and Kruskal's algorithm for MST

    Jul 12, 2025 · Prim's algorithm is a greedy algorithm that builds the MST incrementally. It starts with a single vertex and grows the MST one edge at a time, always choosing the smallest …

  6. 10 Project Ideas That Use Prim's Algorithm - GeeksforGeeks

    Jul 23, 2025 · The project will involve the use of Prim's algorithm, a minimum spanning tree algorithm, to optimize the gas pipeline system. The algorithm will be applied to the gas …

  7. Prim's Algorithm (Simple Implementation for Adjacency Matrix ...

    Jul 11, 2025 · We have discussed Prim's algorithm and its implementation for adjacency matrix representation of graphs. As discussed in the previous post, in Prim's algorithm, two sets are …

  8. Prim's Algorithm with a Java Implementation - GeeksforGeeks

    Jun 13, 2024 · In this article we explain about How to implement Prim's Algorithm with Java programming with required operations like adding edges, Graph Initialization and Setting the …

  9. Prim's algorithm using priority_queue in STL - GeeksforGeeks

    Jul 23, 2025 · The algorithm discussed here can be modified so that decrease key is never required. The idea is, not to insert all vertices in priority queue, but only those which are not …

  10. What is Minimum Spanning Tree (MST) - GeeksforGeeks

    Jul 23, 2025 · The algorithm works by iteratively building the minimum spanning tree, starting with each vertex in the graph as its own tree. In each iteration, the algorithm finds the cheapest …