##
DFS for a n-ary tree (acyclic graph) represented as adjacency list
September 22, 2017

A tree consisting of n nodes is given, we need to print its DFS. Examples : Input : Edges of graph 1 2 1 3… Read More »

September 22, 2017

A tree consisting of n nodes is given, we need to print its DFS. Examples : Input : Edges of graph 1 2 1 3… Read More »

September 21, 2017

A tree is always a Bipartite Graph as we can always break into two disjoint sets with alternate levels. In other words we always color… Read More »

September 19, 2017

The following graph G is called a Petersen graph and its vertices have been numbered from 0 to 9. Some letters have also been assigned… Read More »

September 16, 2017

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 »

September 15, 2017

Given a graph, the task is to find if it has a cycle of odd length or not. Recommended: Please try your approach on {IDE}… Read More »

September 11, 2017

In this article we would be implementing the Graph data structure in JavaScript. Graph is a non-linear data structure. A graph G contains a set… Read More »

September 3, 2017

In graph theory, the Erdos–Rényi model is either of two closely related models for generating random graphs. There are two closely related variants of the… Read More »

August 31, 2017

In graph theory, a clustering coefficient is a measure of the degree to which nodes in a graph tend to cluster together. Evidence suggests that… Read More »

August 12, 2017

Given a directed graph, a source vertex ‘src’ and a destination vertex ‘dst’, print all paths from given ‘src’ to ‘dst’. Consider the following directed… Read More »

July 29, 2017

Given a connected acyclic graph and a source vertex and a destination vertex, your task is to count the number of vertices between the given… Read More »

July 19, 2017

Boolean Satisfiability Problem Boolean Satisfiability or simply SAT is the problem of determining if a Boolean formula is satisfiable or unsatisfiable. Satisfiable : If the… Read More »

June 25, 2017

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 »

June 21, 2017

You are given a undirected graph G(V, E) with N vertices and M edges. We need to find the minimum number of edges between a… Read More »

Given an undirected tree with some marked nodes and a positive number K. We need to print the count of all such nodes which have… Read More »

June 11, 2017

Searching a graph is quite famous problem and have a lot of practical use. We have already discussed here how to search for a goal… Read More »