Tag Archives: MST

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. A single graph can have many different spanning trees. A minimum product spanning tree for a weighted, connected and undirected graph is a spanning tree with weight product less than… 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 graph Output : Edges in MST 0 – 1 1 – 2 2 – 3 3 – 4 2 – 5 5 – 6 6 – 7 2 – 8… 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.