## Kruskal’s Algorithm (Simple Implementation for Adjacency Matrix)

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… Read More »

## Computer Network | Types of Spanning Tree Protocol (STP)

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

## Minimum cost to connect all cities

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 »

## Problem Solving for Minimum Spanning Trees (Kruskal’s and Prim’s)

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 for Minimum Spanning Tree

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 »

## Total number of Spanning Trees in a Graph

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 »

## Minimum Product Spanning Tree

Given 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 »

## Kruskal’s Minimum Spanning Tree using STL in C++

Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Kruskal’s algorithm. Input : Graph as an array of… Read More »

## Prim’s algorithm using priority_queue in STL

Given an undirected, connected and weighted graph, find Minimum Spanning Tree (MST) of the graph using Prim’s algorithm. Input : Adjacency List representation of above… Read More »

## Steiner Tree Problem

What is Steiner Tree? Given a graph and a subset of vertices in the graph, a steiner tree spans though the given subset. The Steiner… Read More »

## Boruvka’s algorithm | Greedy Algo-9

We have discussed following topics on Minimum Spanning Tree. Applications of Minimum Spanning Tree Problem Kruskal’s Minimum Spanning Tree Algorithm Prim’s Minimum Spanning Tree Algorithm… Read More »

## Travelling Salesman Problem | Set 2 (Approximate using MST)

We introduced Travelling Salesman Problem and discussed Naive and Dynamic Programming Solutions for the problem in the previous post,. Both of the solutions are infeasible.… Read More »

## Prim’s MST for Adjacency List Representation | Greedy Algo-6

We recommend to read following two posts as a prerequisite of this post. 1. Greedy Algorithms | Set 5 (Prim’s Minimum Spanning Tree (MST)) 2.… Read More »

## Kruskal’s Minimum Spanning Tree Algorithm | Greedy Algo-2

What is Minimum Spanning Tree? Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and… Read More »

## Boruvka’s algorithm for Minimum Spanning Tree

Following two algorithms are generally taught for Minimum Spanning Tree (MST) problem. Prim’s algorithm Kruskal’s algorithm There is a third algorithm called Boruvka’s algorithm for… Read More »