## Check if a cycle of length 3 exists or not in a graph that satisfy a given condition

Given an array Arr of N integers representing the nodes of a graph. The edges are defined between those pair whose bitwise AND is not… Read More »

## Shortest cycle in an undirected unweighted graph

Given an undirected unweighted graph. The task is to find the length of the shortest cycle in the given graph. If no cycle exists print… Read More »

## Detect cycle in the graph using degrees of nodes of graph

Given a graph, the task is to detect a cycle in the graph using degrees of the nodes in the graph and print all the… 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 »

## Detect Cycle in a Directed Graph using BFS

Given a directed graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least… Read More »

## Find whether it is possible to finish all tasks or not from given dependencies

There are a total of n tasks you have to pick, labeled from 0 to n-1. Some tasks may have prerequisites, for example to pick… Read More »

## Degree of a Cycle Graph

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 »

## Total number of Spanning trees in a Cycle Graph

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

## Coloring a Cycle Graph

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 »

## Product of lengths of all cycles in an undirected graph

Given an undirected and unweighted graph. The task is to find the product of the lengths of all cycles formed in it. Example 1: The… Read More »

## Longest chain of arr[i], arr[arr[i]], .. without repetition

Given an array of size n such that elements in array are distinct and in range from 0 to n-1. We need to find out… Read More »

## Print all the cycles in an undirected graph

Given an undirected graph, print all the vertices that form cycles in it. Pre-requisite: Detect Cycle in a directed graph using colors In the above… 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 »

## How does Floyd’s slow and fast pointers approach work?

We have discussed Floyd’s fast and slow pointer algorithms in Detect loop in a linked list. The algorithm is to start two pointers, slow and… 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 »