Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Tree
1.4k+ articles
Data Structures
1.1k+ articles
Recursion
1k+ articles
DFS
340+ articles
BFS
210+ articles
DSA
>
Data Structures
>
Graph
Graph
940+ posts
Popular Articles
Recent Articles
Graph Algorithms
Last Updated: 21 April 2025
Graph algorithms are methods used to manipulate and analyze graphs, solving various range of problems like finding the shortest path, cycles
...read more
Graph
DSA
Data Structure Types, Classifications and Applications
Last Updated: 11 February 2025
A data structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it can be accesse
...read more
Arrays
Strings
Linked List
Tree
Graph
Stack
Queue
Data Structures
DSA
DSA-Blogs
Travelling Salesman Problem using Dynamic Programming
Last Updated: 26 November 2024
Given a2d matrix cost[][]ofsize nwherecost[i][j]denotes the cost of moving fromcity i to city j.The task is to complete atourfromcity 0 (0-b
...read more
Bit Magic
Microsoft
Google
Graph
NPHard
Opera
Dynamic Programming
DSA
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Tree
1.4k+ articles
Data Structures
1.1k+ articles
Recursion
1k+ articles
DFS
340+ articles
BFS
210+ articles
Detect cycle in an undirected graph
Last Updated: 07 April 2025
Given an undirected graph, the task is to check if there is a cycle in the given graph.Examples:Input: V = 4, edges[][]= [[0, 1], [0, 2], [1
...read more
Amazon
Adobe
Oracle
Flipkart
Samsung
Graph
MakeMyTrip
BFS
DFS
union-find
graph-cycle
DSA
Topological Sorting
Last Updated: 04 April 2025
Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u-v, vertex u comes
...read more
Microsoft
Amazon
Morgan Stanley
Flipkart
Samsung
Graph
Accolite
Moonfrog Labs
OYO
DFS
Topological Sorting
DSA
Bellman–Ford Algorithm
Last Updated: 14 April 2025
Given a weighted graph with V vertices and E edges, along with a source vertex src, the task is to compute the shortest distances from the s
...read more
Graph
Dynamic Programming
Shortest Path
DSA
Dijkstra's Algorithm to find Shortest Paths from a Source to all
Last Updated: 27 April 2025
Given a weighted undirected graph represented as an edge list and a source vertex src, find the shortest path distances from the source vert
...read more
Amazon
Adobe
Morgan Stanley
Dijkstra
Samsung
Cisco
Graph
Accolite
Vizury Interactive Solutions
Greedy
Shortest Path
DSA
Prim’s Algorithm for Minimum Spanning Tree (MST)
Last Updated: 26 February 2025
Prim’s algorithm is aGreedy algorithm like Kruskal's algorithm. This algorithm always starts with a single node and moves through several
...read more
Amazon
Minimum Spanning Tree
Samsung
Cisco
Graph
Greedy
Prim's Algorithm.MST
DSA
Graph and its representations
Last Updated: 05 October 2024
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
Graph
graph-basics
DSA
Kruskal’s Minimum Spanning Tree (MST) Algorithm
Last Updated: 05 March 2025
A minimum spanning tree (MST) or minimum weight spanning tree for a weighted, connected, and undirected graph is a spanning tree (no cycles
...read more
Kruskal
Kruskal'sAlgorithm
Graph
Greedy
MST
DSA
Introduction to Disjoint Set (Union-Find Algorithm)
Last Updated: 26 February 2025
Two sets are called disjoint sets if they don't have any element in common. The disjoint set data structure is used to store such sets. It s
...read more
Graph
Huawei
union-find
QA - Placement Quizzes-Data Interpretation
graph-cycle
Java-SecureRandom
TCS-coding-questions
B-Tree
DSA
Intellipaat
Floyd Warshall Algorithm
Last Updated: 16 April 2025
Given a matrix dist[][] of size n x n, where dist[i][j] represents the weight of the edge from node i to node j. If there is no direct edge,
...read more
Samsung
Graph
Dynamic Programming
Shortest Path
DSA
Floyd-Warshall
Detect Cycle in a Directed Graph
Last Updated: 05 April 2025
Given the number of vertices V and a list of directed edges, determine whether the graph contains a cycle or not.Examples: Input: V = 4, ed
...read more
Microsoft
Amazon
Adobe
Oracle
Flipkart
Samsung
Graph
BankBazaar
MakeMyTrip
Rockstand
DFS
graph-cycle
DSA
Breadth First Search or BFS for a Graph
Last Updated: 21 April 2025
Given aundirected graphrepresented by an adjacency listadj, where eachadj[i]represents the list of vertices connected to vertexi. Perform aB
...read more
Graph
Queue
BFS
Data Structures
graph-basics
DSA
Depth First Search or DFS for a Graph
Last Updated: 29 March 2025
In Depth First Search (or DFS) for a graph, we traverse all adjacent vertices one by one. When we traverse an adjacent vertex, we completely
...read more
Graph
Algorithms
DFS
graph-basics
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !