# Category Archives: Graph

To understand this let’s take a binary tree Binary tree If we conduct BFS in this tree: In level 0 there is one node inâ€¦ Read More
BFS and DFS are two algorithms that we use for graph traversal. In both the algorithms we start from a node and iterate over theâ€¦ Read More
For N given cities, find how many ways a driver can traverse through them so that each town is visited exactly K times. From eachâ€¦ Read More
A graph is a data structure that is defined by two components : A node or a vertex. An edge E or ordered pair isâ€¦ Read More
In the field of graph theory, various shortest path algorithms especially Dijkstraâ€™s algorithm and Bellmann-Fordâ€™s algorithm repeatedly employ the use of the technique called Edgeâ€¦ Read More
Given a 2D array arr[] and value K, where each list in arr[] represents a point on Cartesian coordinates, the task is to group theâ€¦ Read More
Given N nodes, where each of them is numbered from 0 to N – 1, and array edges, where there is a directed edge fromâ€¦ Read More
Given a 2-D array A[][] of size NÃ—3, where each element of the array consists of {x, y, r}, where x and y are coordinatesâ€¦ Read More
Generally, when we come across a graph problem, we might need to traverse the structure of the given graph or tree to find our solutionâ€¦ Read More
Given an undirected graph with V vertices in the form of an adjacency matrix, the weight of any two edges cannot be the same. Forâ€¦ Read More
Given a weighted directed graph with N vertices and M edges, a source src and a destination target, the task is to find the shortestâ€¦ Read More
A Data Structure organizes and stores data in a computer so that we can perform operations on the data more efficiently. There are many diverseâ€¦ Read More
A clique is a collection of vertices in an undirected graph G such that every two different vertices in the clique are nearby, implying thatâ€¦ Read More
Given a directed graph with N nodes and M connections shown in the matrix mat[] where each element is of the form {xi, yi} denotingâ€¦ Read More
Prerequisite: NP-Completeness, NP Class, Sparse Graph, Independent Set Problem: Given graph G = (V, E) and two integers a and b. A set of aâ€¦ Read More