A* Search Algorithm
A complete guide to the A* Search Algorithm with interactive grid visualization, explanations, heuristic functions, implementations in Python, Java, C++, and JavaScript, and related LeetCode problems.
A complete guide to the A* Search Algorithm with interactive grid visualization, explanations, heuristic functions, implementations in Python, Java, C++, and JavaScript, and related LeetCode problems.
Adjacency list is used to represent a graph using array and linked list
An adjacency matrix is a 2D array used to represent a graph, where each cell (i, j) is set to 1 if there's an edge from node i to node j, and 0 otherwise.
A complete guide to the Bellman-Ford Algorithm — find shortest paths in graphs with negative edge weights and detect negative weight cycles. Includes pseudocode, step-by-step trace, and implementations in C, C++, Java, and Python.
A complete guide to the Bellman-Ford Algorithm with explanations, dry run, negative cycle detection, implementations in Python, Java, C++, and JavaScript, and related LeetCode problems.
A bipartite graph is a graph whose vertices can be divided into two disjoint sets such that no two vertices within the same set are adjacent.
In this blog post, we'll explore Breadth-First Search (BFS), a graph traversal algorithm used to explore vertices and edges level by level in a graph.
A complete guide to Breadth-First Search (BFS) algorithm with explanations, use cases, and implementations in Python, Java, C++, and JavaScript.
In this blog post, we'll explore Depth-First Search (DFS), a graph traversal algorithm used to explore vertices and edges by going as deep as possible before backtracking.
A complete guide to Depth-First Search (DFS) algorithm with explanations, use cases, and implementations in Python, Java, C++, and JavaScript.
In this blog post, we'll explore Depth-First Search (DFS) using Java, a graph traversal algorithm used to explore vertices and edges by going as deep as possible before backtracking.
This post covers Dijkstra's Algorithm for finding the shortest paths in a graph, with code examples and explanations.
A complete guide to Dijkstra's Algorithm with explanations, use cases, and implementations in Python, Java, C++, and JavaScript.
Learn the Floyd-Warshall Algorithm for solving the All-Pairs Shortest Path problem using Dynamic Programming.
A complete guide to Floyd-Warshall Algorithm with explanations, use cases, and implementations in Python, Java, C++, and JavaScript.
The program is to return a deep copy of the graph, preserving the structure and values of its nodes.
Reverse a directed graph so that the incoming edges will be converted to outgoing edges betwwen the same nodes.
Calculating the longest path from a given source in a Directed Acyclic Graph (DAG) with weighted edges.
The multistage graph problem is finding the path with minimum cost from source to sink.
1. Easy Level
Practice problems for Graphs to help you understand the concepts better.
Solve the Rotten Oranges problem using Breadth-First Search (BFS) to determine the minimum time required for all fresh oranges to rot.
A complete guide to Topological Sort with explanations, use cases, and implementations in Python, Java, C++, and JavaScript.