## Minimum operations of the given type required to make a complete graph

Given N vertex where N is even. Initially there is no edge between any of the vertices. You are allowed to perform operation as illustrated… Read More »

## Finding in and out degrees of all vertices in a graph

Given a directed graph, the task is to count the in and out degree of each vertex of the graph. Examples: Input: Output: Vertex In… Read More »

## Check if the given graph represents a Star Topology

Given a graph G, the task is to check if it represents a Star Topology. A Star Topology is the one shown in the image… Read More »

## Check if the given graph represents a Ring Topology

Given a graph G, the task is to check if it represents a Ring Topology. A Ring Topology is the one shown in the image… Read More »

## Check if the given graph represents a Bus Topology

Given a graph G, check if it represents a Bus Topology. A Bus Topology is the one shown in the image below: Examples: Input: Output:… Read More »

## Maximum number of edges among all connected components of an undirected graph

Given integers ‘N’ and ‘K’ where, N is the number of vertices of an undirected graph and ‘K’ denotes the number of edges in the… Read More »

## Number of Walks from source to destination

Given a graph and two vertices src and dest, count the total number of paths from src to dest where the length of the path… Read More »

## All vertex pairs connected with exactly k edges in a graph

Given a directed graph represented as an adjacency matrix and an integer ‘k’, the task is to find all the vertex pairs that are connected… Read More »

## Maximize number of nodes which are not part of any edge in a Graph

Given a graph with n nodes and m edges. Find the maximum possible number of nodes which are not part of any edge (m will… Read More »

## Detect cycle in an undirected graph using BFS

Given an undirected graph, how to check if there is a cycle in the graph? For example, the following graph has a cycle 1-0-2-1. Recommended:… Read More »

## Number of single cycle components in an undirected graph

Given a set of ‘n’ vertices and ‘m’ edges of an undirected simple graph (no parallel edges and no self-loop), find the number of single-cycle-components… Read More »

## Number of shortest paths in an unweighted and directed graph

Given an unweighted directed graph, can be cyclic or acyclic. Print the number of shortest paths from a given vertex to each of the vertices.… Read More »

## Eulerian Path in undirected graph

Given an adjacency matrix representation of an undirected graph. Find if there is any Eulerian Path in the graph. If there is no path print… Read More »

## Count the number of non-reachable nodes

Given an undirected graph and a set of vertices, we have to count the number of non reachable nodes from the given head node using… Read More »

## Number of cyclic elements in an array where we can jump according to value

Given a array arr[] of n integers. For every value arr[i], we can move to arr[i] + 1 clockwise considering array elements in cycle. We… Read More »