# Category Archives: Graph

Given an undirected graph with N vertices and N edges. No two edges connect the same pair of vertices. A triangle is a set of… Read More
Given a connected acyclic graph with N nodes and N-1 edges, find out the pair of nodes that are at even distance from each other.… Read More
Given N dependencies of the form X Y, where X & Y represents two different tasks. The dependency X Y denotes dependency of the form… Read More
Given two integers N and K. The task is to find a connected graph with N vertices such that there are exactly K pairs (i,… Read More
In graph theory, vertex colouring is a way of labelling each individual vertex such that no two adjacent vertex have same colour. But we need… Read More
Given a dictionary, and two words start and target (both of the same length). Find length of the smallest chain from start to target if… Read More
Given an undirected graph having N nodes, the task is to print the nodes having minimum and maximum degree.Examples:   Input: 1-----2 | | 3-----4 Output:… Read More
It is highly recommended to read Dijkstra’s algorithm using the Priority Queue first.Widest Path Problem is a problem of finding a path between two vertices… Read More
Given an array arr[] of size N. There is an edge from i to arr[i]. The task is to convert this directed graph into tree… Read More