# Category Archives: Graph

Given a weighted Directed Graph where the weights may be negative, find the shortest path between every pair of vertices in the Graph using Johnson’s… Read More
Given the number of vertices in a Cycle Graph. The task is to find the Degree and the number of Edges of the cycle graph.… Read More
Wheel Graph: A Wheel graph is a graph formed by connecting a single universal vertex to all vertices of a cycle. Properties:- Wheel graphs are… Read More
Given the number of Vertices and the number of Edges of an Undirected Graph. The task is to determine the Circuit rank.Circuit Rank: The Circuit… Read More
Consider a directed graph given in below, DFS of the below graph is 1 2 4 6 3 5 7 8. In below diagram if… Read More
Given the number of vertices in a Cycle graph. The task is to find the Total number of Spanning trees possible. Note: A cycle/circular graph is… Read More
Given the number of vertices N of a graph. The task is to determine the Edge cover.Edge Cover: Minimum number of edge required to cover… Read More
Cycle:- cycle is a path of edges and vertices wherein a vertex is reachable from itself. or in other words, it is a Closed walk. … Read More
Given N number of vertices of a Graph. The task is to find the total number of edges possible in a complete graph of N… Read More
Give a complete graph with N-vertices. The task is to find out the maximum number of edge-disjoint spanning tree possible.Edge-disjoint Spanning Tree is a spanning… Read More
The level ancestor problem is the problem of preprocessing a given rooted tree T into a data structure that can determine the ancestor of a… Read More
Given an undirected and unweighted graph. The task is to find the product of the lengths of all cycles formed in it.Example 1:   Attention reader!… 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
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… Read More
Given an undirected weighted graph. The task is to find the minimum cost of the path from source node to the destination node via an… Read More