## Shortest path in a graph from a source S to destination D with exactly K edges for multiple Queries

Given a graph with N nodes, a node S and Q queries each consisting of a node D and K, the task is to find… Read More »

- Find the minimum number of moves to reach end of the array
- Print all neighbour nodes within distance K
- Check which player visits more number of Nodes
- Implementation of BFS using adjacency matrix
- Check if a cycle of length 3 exists or not in a graph that satisfy a given condition
- Print nodes having maximum and minimum degrees
- Shortest cycle in an undirected unweighted graph
- Convert Directed Graph into a Tree
- Widest Path Problem | Practical application of Dijkstra's Algorithm
- Find if a degree sequence can form a simple graph | Havel-Hakimi Algorithm

Given a graph with N nodes, a node S and Q queries each consisting of a node D and K, the task is to find… Read More »

Prerequisite: Graph and its representations Given a adjacency matrix representation of a Graph. The task is to convert the given Adjacency Matrix to Adjacency List… Read More »

Prerequisite: Segment tree and depth first search. In this article, an approach to convert an N-ary rooted tree( a tree with more than 2 children)… Read More »

Prerequisites: Genetic Algorithm, Travelling Salesman Problem In this article, a genetic algorithm is proposed to solve the travelling salesman problem. Genetic algorithms are heuristic search… Read More »

Given a small graph with N nodes and E edges, the task is to find the maximum clique in the given graph. A clique is… Read More »

Given an undirected graph with N nodes and E edges and a value K, the task is to print all set of nodes which form… Read More »

Prerequisites: Linked List, Graph Data Structure In this article, adding and removing a vertex is discussed in a given adjacency list representation. Let the Directed… Read More »

Prerequisites: Graph and Its Representation In this article, adding and removing edge is discussed in a given adjacency list representation. A vector has been used… Read More »

Given a directed graph with N nodes and E edges where the weight of each of the edge is > 1, also given a source… Read More »

Given a bi-directed weighted (positive) graph without self-loops, the task is to generate the minimum spanning tree of the graph. Examples: Input: N = 9,… Read More »

Given a directed weighted graph and two vertices S and D in it, the task is to find the shortest path from S to D… Read More »

Given N nodes on a 2-D plane represented as (xi, yi). The nodes are said to be connected if the manhattan distance between them is… Read More »

Given a graph with N nodes having values either P or M. Also given K pairs of integers as (x, y) representing the edges in… Read More »

Given an N * M matrix mat[][] consisting of lower case characters, the task is to find the minimum cost to reach from the cell… Read More »

Given a string S of length N consisting of lower case character, the task is to find the minimum cost to reach from index i… Read More »