## Count single node isolated sub-graphs in a disconnected graph

A disconnected Graph with N vertices and K edges is given. The task is to find the count of singleton sub-graphs. A singleton graph is… Read More »

A disconnected Graph with N vertices and K edges is given. The task is to find the count of singleton sub-graphs. A singleton graph is… Read More »

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 »

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 »

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 »

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 on {IDE}… Read More »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »