Skip to content

Category Archives: Graph

Prerequisites:  BFS for a Graph Dictionaries in Python In this article, we will be looking at how to build an undirected graph and then find… Read More
A Graph is a non-linear data structure consisting of nodes and edges. The nodes are sometimes also referred to as vertices and the edges are… Read More
Given a binary valued undirected graph with V vertices and E edges, the task is to find the hexadecimal equivalents of all the connected components… Read More
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
Prerequisite: NP-Completeness, Hamiltonian cycle. Hamiltonian Cycle: A cycle in an undirected graph G =(V, E) which traverses every vertex exactly once. Problem Statement:Given a graph… Read More
Given an undirected graph with N vertices and E edges and two vertices (U, V) from the graph, the task is to detect if a… Read More
Given a directed graph and a source vertex in the graph, the task is to find the shortest distance and path from source to target… Read More
Prerequisite: NP-Completeness A clique is a subgraph of a graph such that all the vertices in this subgraph are connected with each other that is… Read More
Subgraph Isomorphism Problem: We have two undirected graphs G1 and G2. The problem is to check whether G1 is isomorphic to a subgraph of G2.… Read More
Given a Tree with N vertices and N – 1 edge where the vertices are numbered from 0 to N – 1, and a vertex… Read More
Pre-requisite: Dominant Set of a Graph, NP-Complete A dominating set in a graph G = (V, E) is a subset of vertices V’ following the… Read More
Pre-requisite: Travelling Salesman Problem, NP Hard Given a set of cities and the distance between each pair of cities, the travelling salesman problem finds the… Read More
Given an undirected graph G, the task is to find the shortest path of even-length, given 1 as Source Node and N as Destination Node.… Read More
Given a binary-valued Undirected Graph with V vertices and E edges, the task is to find the maximum decimal equivalent among all the connected components… Read More

Start Your Coding Journey Now!