# Category Archives: Graph

Given an Undirected Graph consisting of N vertices and M edges, where node values are in the range [1, N], and vertices specified by theâ€¦ Read More
Given an undirected weighted graph of N nodes and M edges in the form of a tuple lets say {X, Y, Z} such that thereâ€¦ Read More
Given a matrix board[][] consisting of the characters K or k, Q or q, B or b, N or n, R or r, and Pâ€¦ Read More
Given a Directed graph of N vertices and M edges, the task is to find the minimum number of edges required to make the givenâ€¦ Read More
Prerequisites: Graph and its representationsGiven an adjacency matrix g[][] of a graph consisting of N vertices, the task is to modify the matrix after insertionâ€¦ Read More
Given an un-directed and unweighted connected graph, find a simple cycle in that graph (if it exists). Simple Cycle: A simple cycle is a cycleâ€¦ Read More
Given a 2D screen arr[][] where each arr[i][j] is an integer representing the color of that pixel, also given the location of a pixel (X,â€¦ Read More
Every beginner computer science student would have once wondered why do we find shortest path in graph or what is the use of trees, areâ€¦ Read More
Given a weighted, directed graph G, an array V[] consisting of vertices, the task is to find the Minimum Cost Path passing through all theâ€¦ Read More
Given an integer N, which denotes the size of the matrix that is N*N. There is a robot placed over the top-left corner (0, 0)â€¦ Read More
Introduction: A Graph is a non-linear data structure consisting of vertices and edges. The vertices are sometimes also referred to as nodes and the edgesâ€¦ Read More
Given a directed Graph G(V, E) with V vertices and E edges, the task is to check that for all vertices of the given graph,â€¦ Read More
Given an undirected graph and two vertices X and Y, our task is to check whether the vertex X lies in the subgraph of theâ€¦ Read More
Given an undirected graph defined by the number of vertex V and the edges E[ ], the task is to find Maximal Independent Vertex Setâ€¦ Read More
Given a weighted directed graph consisting of V vertices and E edges. The task is to print the cyclic path whose sum of weight isâ€¦ Read More