The Wayback Machine - https://web.archive.org/web/20240118164733/https://www.geeksforgeeks.org/graph-data-structure-and-algorithms/
Open In App
Related Articles

Graph Data Structure And Algorithms

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Learn Data Structures and Algorithms | DSA Tutorial
Learn more about Graph in DSA Self Paced Course
Practice Problems on Graphs

What is Graph Data Structure?

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 are lines or arcs that connect any two nodes in the graph. More formally a Graph is composed of a set of vertices( V ) and a set of edges( E ). The graph is denoted by G(E, V).

Components of a Graph

  • Vertices: Vertices are the fundamental units of the graph. Sometimes, vertices are also known as vertex or nodes. Every node/vertex can be labeled or unlabelled.
  • Edges: Edges are drawn or used to connect two nodes of the graph. It can be ordered pair of nodes in a directed graph. Edges can connect any two nodes in any possible way. There are no rules. Sometimes, edges are also known as arcs. Every edge can be labeled/unlabelled.

Introduction to Graphs

Introduction to Graph:

BFS and DFS in Graph:

Cycles in Graph:

Shortest Path in Graph:

Minimum Spanning Tree:

Topological Sorting:

Connectivity in Graph:

Maximum Flow in Graph:

Some must do Problems on Graph:

Some Quizzes:

Quick Links :

Recommended:


Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 17 Jan, 2024
Like Article
Save Article
Share your thoughts in the comments
Similar Reads
Complete Tutorials