A graph is a non-linear data structure consisting of nodes (or vertices) and edges that connect these nodes. It's widely used to model relationships between objects in various applications.

🔢 Key Components

  • Nodes: Represent entities (e.g., cities, users)
  • Edges: Represent connections between nodes (e.g., roads, friendships)
  • Directed/Undirected: Edges may have direction (→) or not (↔)
  • Weighted/Unweighted: Edges can carry numerical values or not

📋 Types of Graphs

Type Description 📎 Example
Undirected Graph Edges have no direction A-B, B-C
Directed Graph Edges point from one node to another A→B, B←C
Weighted Graph Edges have weights A-B:5, B-C:3
Bipartite Graph Nodes divided into two disjoint sets Social network connections

🧠 Applications

  • Social network analysis 🕸️
  • Route planning in maps 🚗
  • Computer network topologies 🌐
  • Recommendation systems 🎯

📚 Related Topics

For deeper understanding, check our guide on Graph Algorithms or explore Tree Structures for comparisons.

graph_data_structure