# Tag Archives: graph-cycle

## Print negative weight cycle in a Directed Graph

Given a weighted directed graph consisting of V vertices and E edges. The task is to print the cyclic path whose sum of weight is… Read More »

## Count of all cycles without any inner cycle in a given Graph

Given an undirected graph consisting of N vertices numbered [0, N-1] and E edges, the task is to count the number of cycles such that… Read More »

## Sum of minimum element at each depth of a given non cyclic graph

Given a non-cyclic graph having V nodes and E edges and a source node S, the task is to calculate the sum of the minimum… Read More »

## Number of cycles formed by joining vertices of n sided polygon at the center

Given an N-sided regular polygon, we have connected all the vertices at the center of the polygon, thus dividing the polygon into N equal parts.… Read More »

## Find any one of the multiple repeating elements in read only array | Set 2

Given a read-only array arr[] of size N + 1, find one of the multiple repeating elements in the array where the array contains integers… Read More »

## Check if given intervals can be made non-overlapping by adding/subtracting some X

Given an array arr[] containing N intervals, the task is to check that if the intervals can be added or subtracted by X after which… Read More »

## Count of elements which form a loop in an Array according to given constraints

Given an array A containing N integers, the task is to count the number of elements which form a cycle in the array, based on… Read More »

## Minimum labelled node to be removed from undirected Graph such that there is no cycle

Given an undirected graph of N nodes labelled from 1 to N, the task is to find the minimum labelled node that should be removed… Read More »

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