Skip to content

Tag Archives: graph-cycle

We are given a directed graph. We need compute whether the graph has negative cycle or not. A negative cycle is one in which the… Read More
We are given a directed graph. We need to compute whether the graph has a negative cycle or not. A negative cycle is one in… Read More
Prerequisite – Graph Theory Basics Certain graph problems deal with finding a path between two vertices such that each edge is traversed exactly once, or finding… Read More
Given a weighted and undirected graph, we need to find if a cycle exist in this graph such that the sum of weights of all… Read More
Given a graph, the task is to find if it has a cycle of odd length or not.      Recommended: Please try your approach… Read More
A directed acyclic graph (DAG) is a graph which doesn’t contain a cycle and has directed edges. We are given a DAG, we need to… Read More
Given a directed and strongly connected graph with non-negative edge weights. We define the mean weight of a cycle as the summation of all the… Read More
Given a positive weighted undirected graph, find the minimum weight cycle in it. Examples:   Minimum weighted cycle is : Minimum weighed cycle : 7 +… Read More
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
Given a graph with both directed and undirected edges. It is given that the directed edges don’t form cycle. How to assign directions to undirected… Read More
Write a function that returns true if a given undirected graph is tree and false otherwise. For example, the following graph is a tree.  But… Read More
Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the… Read More
Given an undirected graph, how to check if there is a cycle in the graph?  Example,  Input: n = 4, e = 4  Output: Yes … Read More
A disjoint-set data structure is a data structure that keeps track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets. A… Read More
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

Start Your Coding Journey Now!