Given a connected undirected weighted graph in the form of a 2D array where each row is of the type [start node, end node, weight]… Read More

# Tag Archives: MST

Given a disconnected graph G with N vertices and M edges and an array cost[] corresponding to each vertex, the task is to find the… Read More

Prerequisites – Graph, Spanning tree, Disjoint Set (Union – Find). A minimum spanning tree (MST) T, for a given graph G, spans over all vertices… Read More

Spanning tree: A spanning tree (T) of an undirected graph(G) is a subgraph which is a tree that includes all the vertices of a graph… Read More

For a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects all the vertices together.… Read More

Given a 2D array houses[][] consisting of N 2D coordinates {x, y} where each coordinate represents the location of each house, the task is to… Read More

The minimum bottleneck spanning tree in an undirected graph is a tree whose most expensive edge is as minimum as possible. In this article, we… Read More

Given a bi-directed weighted (positive) graph without self-loops, the task is to generate the minimum spanning tree of the graph.Examples: Input: N = 9, E… Read More

Kruskal’s algorithm for MST Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and connects… Read More

Below are the steps for finding MST using Kruskal’s algorithm 1. Sort all the edges in non-decreasing order of their weight. 2. Pick the smallest edge.… Read More

Prerequisite – Spanning Tree Protocol Spanning Tree Protocol (STP) is used to make a loop free network by monitoring the network to track all the links… Read More

There are n cities and there are roads in between some of the cities. Somehow all the roads are damaged simultaneously. We have to repair… Read More

Minimum spanning Tree (MST) is an important topic for GATE. Therefore, we will discuss how to solve different types of questions based on MST. Before… Read More

Reverse Delete algorithm is closely related to Kruskal’s algorithm. In Kruskal’s algorithm what we do is : Sort edges by increasing order of their weights.… Read More

If a graph is a complete graph with n vertices, then total number of spanning trees is n(n-2) where n is the number of nodes… Read More