## Bellman Ford Algorithm (Simple Implementation)

We have introduced Bellman Ford and discussed on implementation here. Input: Graph and a source vertex src Output: Shortest distance to all vertices from src.… Read More »

- Breadth First Search without using Queue
- Shortest Path Faster Algorithm
- Minimum Cost Graph
- Traveling Salesman Problem using Genetic Algorithm
- Convert Adjacency Matrix to Adjacency List representation of Graph
- Count total ways to reach destination from source in an undirected Graph
- Implementing Water Supply Problem using Breadth First Search
- Add and Remove Edge in Adjacency List representation of a Graph
- Minimum cost to reach from the top-left to the bottom-right corner of a matrix
- Program to print all the non-reachable nodes | Using BFS
- Maximum of all distances to the nearest 1 cell from any 0 cell in a Binary matrix
- Why Prim’s and Kruskal's MST algorithm fails for Directed Graph?
- Diamond Tree
- Add and Remove vertex in Adjacency Matrix representation of Graph
- Add and Remove vertex in Adjacency List representation of Graph
- What is a Webcrawler and where is it used?
- Number of pairs such that path between pairs has the two vertices A and B
- Build a segment tree for N-ary rooted tree
- Minimum number of Water to Land conversion to make two islands connected in a Grid
- Minimum number of colors required to color a graph
- Minimum Spanning Tree using Priority Queue and Array List
- Check if cells numbered 1 to K in a grid can be connected after removal of atmost one blocked cell
- Check if a Tree can be split into K equal connected components
- D'Esopo-Pape Algorithm : Single Source Shortest Path
- Shortest path in a graph from a source S to destination D with exactly K edges for multiple Queries
- Path with minimum XOR sum of edges in a directed graph
- Maximal Clique Problem | Recursive Solution
- Shortest path with exactly k edges in a directed and weighted graph | Set 2
- Minimum labelled node to be removed from undirected Graph such that there is no cycle
- Find integral points with minimum distance from given set of integers using BFS

We have introduced Bellman Ford and discussed on implementation here. Input: Graph and a source vertex src Output: Shortest distance to all vertices from src.… Read More »

Given two arrays u and v, representing a graph such that there is an undirected edge from u[i] to v[i] (0 ≤ v[i], u[i] <… Read More »

Given an n-ary tree and Q queries where each query consists of an integer u which denotes a node. The task is to print the… Read More »

Given an array arr[] of integers, the task is to arrange the array elements such that the last digit of an element is equal to… Read More »

Given a connected graph with N vertices and M edges. The task is to find the shortest path from source to the destination vertex such… Read More »

Given a tree with N nodes which initially have no color and an array color[] of size N which represent the color of each node… Read More »

Given a directed graph. The task is to check if the given graph is connected or not. Examples: Input: Output: Yes Input: Output: No Recommended:… Read More »

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5… Read More »

Given a Weighted Directed Graph and a destination vertex in the graph, find the shortest distance from all vertex to the destination vertex. Input :… Read More »

Prerequisite : Graph and its representations In this article, we will be discussing Adjacency List representation of Graph using ArrayList in Java. Following is adjacency… Read More »

Travelling Salesman Problem (TSP): Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible route… Read More »

Given n expressions of the type x = y and x != y where 1 ≤ x, y ≤ n, the task is to check… Read More »

Given an undirected graph with N vertices and M edges and no self loops or multiple edges. The task is to convert the given undirected… Read More »

Given an undirected graph g, the task is to print the number of connected components in the graph. Examples: Input: Output: 3 There are three… Read More »

Given a graph, the task is to detect a cycle in the graph using degrees of the nodes in the graph and print all the… Read More »