
- Graph Theory - Home
- Graph Theory - Introduction
- Graph Theory - History
- Graph Theory - Fundamentals
- Graph Theory - Applications
- Types of Graphs
- Graph Theory - Types of Graphs
- Graph Theory - Simple Graphs
- Graph Theory - Multi-graphs
- Graph Theory - Directed Graphs
- Graph Theory - Weighted Graphs
- Graph Theory - Bipartite Graphs
- Graph Theory - Complete Graphs
- Graph Theory - Subgraphs
- Graph Theory - Trees
- Graph Theory - Forests
- Graph Theory - Planar Graphs
- Graph Theory - Hypergraphs
- Graph Theory - Infinite Graphs
- Graph Theory - Random Graphs
- Graph Representation
- Graph Theory - Graph Representation
- Graph Theory - Adjacency Matrix
- Graph Theory - Adjacency List
- Graph Theory - Incidence Matrix
- Graph Theory - Edge List
- Graph Theory - Compact Representation
- Graph Theory - Incidence Structure
- Graph Theory - Matrix-Tree Theorem
- Graph Properties
- Graph Theory - Basic Properties
- Graph Theory - Coverings
- Graph Theory - Matchings
- Graph Theory - Independent Sets
- Graph Theory - Traversability
- Graph Theory Connectivity
- Graph Theory - Connectivity
- Graph Theory - Vertex Connectivity
- Graph Theory - Edge Connectivity
- Graph Theory - k-Connected Graphs
- Graph Theory - 2-Vertex-Connected Graphs
- Graph Theory - 2-Edge-Connected Graphs
- Graph Theory - Strongly Connected Graphs
- Graph Theory - Weakly Connected Graphs
- Graph Theory - Connectivity in Planar Graphs
- Graph Theory - Connectivity in Dynamic Graphs
- Special Graphs
- Graph Theory - Regular Graphs
- Graph Theory - Complete Bipartite Graphs
- Graph Theory - Chordal Graphs
- Graph Theory - Line Graphs
- Graph Theory - Complement Graphs
- Graph Theory - Graph Products
- Graph Theory - Petersen Graph
- Graph Theory - Cayley Graphs
- Graph Theory - De Bruijn Graphs
- Graph Algorithms
- Graph Theory - Graph Algorithms
- Graph Theory - Breadth-First Search
- Graph Theory - Depth-First Search (DFS)
- Graph Theory - Dijkstra's Algorithm
- Graph Theory - Bellman-Ford Algorithm
- Graph Theory - Floyd-Warshall Algorithm
- Graph Theory - Johnson's Algorithm
- Graph Theory - A* Search Algorithm
- Graph Theory - Kruskal's Algorithm
- Graph Theory - Prim's Algorithm
- Graph Theory - Borůvka's Algorithm
- Graph Theory - Ford-Fulkerson Algorithm
- Graph Theory - Edmonds-Karp Algorithm
- Graph Theory - Push-Relabel Algorithm
- Graph Theory - Dinic's Algorithm
- Graph Theory - Hopcroft-Karp Algorithm
- Graph Theory - Tarjan's Algorithm
- Graph Theory - Kosaraju's Algorithm
- Graph Theory - Karger's Algorithm
- Graph Coloring
- Graph Theory - Coloring
- Graph Theory - Edge Coloring
- Graph Theory - Total Coloring
- Graph Theory - Greedy Coloring
- Graph Theory - Four Color Theorem
- Graph Theory - Coloring Bipartite Graphs
- Graph Theory - List Coloring
- Advanced Topics of Graph Theory
- Graph Theory - Chromatic Number
- Graph Theory - Chromatic Polynomial
- Graph Theory - Graph Labeling
- Graph Theory - Planarity & Kuratowski's Theorem
- Graph Theory - Planarity Testing Algorithms
- Graph Theory - Graph Embedding
- Graph Theory - Graph Minors
- Graph Theory - Isomorphism
- Spectral Graph Theory
- Graph Theory - Graph Laplacians
- Graph Theory - Cheeger's Inequality
- Graph Theory - Graph Clustering
- Graph Theory - Graph Partitioning
- Graph Theory - Tree Decomposition
- Graph Theory - Treewidth
- Graph Theory - Branchwidth
- Graph Theory - Graph Drawings
- Graph Theory - Force-Directed Methods
- Graph Theory - Layered Graph Drawing
- Graph Theory - Orthogonal Graph Drawing
- Graph Theory - Examples
- Computational Complexity of Graph
- Graph Theory - Time Complexity
- Graph Theory - Space Complexity
- Graph Theory - NP-Complete Problems
- Graph Theory - Approximation Algorithms
- Graph Theory - Parallel & Distributed Algorithms
- Graph Theory - Algorithm Optimization
- Graphs in Computer Science
- Graph Theory - Data Structures for Graphs
- Graph Theory - Graph Implementations
- Graph Theory - Graph Databases
- Graph Theory - Query Languages
- Graph Algorithms in Machine Learning
- Graph Neural Networks
- Graph Theory - Link Prediction
- Graph-Based Clustering
- Graph Theory - PageRank Algorithm
- Graph Theory - HITS Algorithm
- Graph Theory - Social Network Analysis
- Graph Theory - Centrality Measures
- Graph Theory - Community Detection
- Graph Theory - Influence Maximization
- Graph Theory - Graph Compression
- Graph Theory Real-World Applications
- Graph Theory - Network Routing
- Graph Theory - Traffic Flow
- Graph Theory - Web Crawling Data Structures
- Graph Theory - Computer Vision
- Graph Theory - Recommendation Systems
- Graph Theory - Biological Networks
- Graph Theory - Social Networks
- Graph Theory - Smart Grids
- Graph Theory - Telecommunications
- Graph Theory - Knowledge Graphs
- Graph Theory - Game Theory
- Graph Theory - Urban Planning
- Graph Theory Useful Resources
- Graph Theory - Quick Guide
- Graph Theory - Useful Resources
- Graph Theory - Discussion
Graph Theory - Introduction
What is Graph Theory?
Graph theory is a branch of mathematics that studies graphs. Graphs are structures made up of points called vertices (or nodes) connected by lines called edges (or links). They model relationships between objects and are used in many fields to represent networks, relationships, and structures.
Formally, a graph is a pair of sets (V, E), where V is the set of vertices and E is the set of edges, connecting the pairs of vertices. Take a look at the following graph −

In the above graph,
V = {a, b, c, d, e} E = {ab, ac, bd, cd, de}
History of Graph Theory
Graph theory dates back to the 18th century. Swiss mathematician Leonhard Euler is credited with founding graph theory in 1736 when he solved the Seven Bridges of Knigsberg problem.
Since then, graph theory has grown significantly, with contributions from many mathematicians, and is now widely used to solve modern problems.
Basic Definitions and Concepts
Here are some basic terms in graph theory −
- Vertex (Node): A fundamental unit representing a point or an object in a graph.
- Edge (Link): A line connecting two vertices, representing a relationship or pathway.
- Adjacent Vertices: Vertices connected by an edge.
- Degree of a Vertex: The number of edges connected to a vertex.
- Path: A sequence of vertices connected by edges, with each vertex visited only once.
- Cycle: A path that starts and ends at the same vertex, forming a loop.
- Connected Graph: A graph where there is a path between every pair of vertices.
- Subgraph: A graph made from a subset of vertices and edges of another graph.

In this image,
- 1, 2, 3, 4, 5, 6 are the vertices (nodes) of the graph.
- The edges of the graph are represented by the pairs (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 1), and (1, 3), showing the connections between the vertices.
- Adjacent vertices are shown by the edges, such as 1 and 2, 2 and 3, 4 and 5, etc.
- The degree of a vertex is reflected in how many edges it is connected to, for example, vertex 1 has a degree of 2.
- A path is represented by a continuous sequence of edges, such as 1 2 3 4 5 6 1.
- A cycle is illustrated by the loop 1 2 3 4 5 6 1.
- The graph is connected, meaning every vertex is reachable from any other vertex.
- The subgraph, consisting of vertices 1, 2, and 3, is a smaller portion of the original graph.
Types of Graphs
Graphs can be classified into different types −
- Undirected Graph: A graph where edges have no direction, meaning connections are bidirectional.
- Directed Graph (Digraph): A graph where edges have a direction, indicating one-way relationships between vertices.
- Weighted Graph: A graph where edges have weights or costs, representing the strength or capacity of connections.
- Unweighted Graph: A graph where all edges are equal, with no weights assigned.
- Simple Graph: A graph with no loops (edges connecting a vertex to itself) and no multiple edges between the same vertices.
- Multigraph: A graph that allows multiple edges between the same vertices.
- Bipartite Graph: A graph whose vertices can be divided into two sets where no two vertices within the same set are adjacent.
- Complete Graph: A graph where there is an edge between every pair of vertices.

Graph Representation
Graphs can be represented in various ways −
- Adjacency Matrix: A square matrix where the element at row i and column j indicates the presence of an edge between vertices i and j.
- Adjacency List: A collection of lists where each list contains the vertices adjacent to a particular vertex.
- Incidence Matrix: A matrix where rows represent vertices and columns represent edges, showing which vertices are connected by which edges.

In this image,
Adjacency List: 1: [2] 2: [1, 3] 3: [2, 4] 4: [3, 5] 5: [4] Adjacency Matrix: [[0. 1. 0. 0. 0.] [1. 0. 1. 0. 0.] [0. 1. 0. 1. 0.] [0. 0. 1. 0. 1.] [0. 0. 0. 1. 0.]] Incidence Matrix: [[1. 0. 0. 0.] [1. 1. 0. 0.] [0. 1. 1. 0.] [0. 0. 1. 1.] [0. 0. 0. 1.]]
Graph Algorithms
Graph theory includes many algorithms for solving graph-related problems −
- Depth-First Search (DFS): An algorithm for exploring a graph by going as deep as possible along each branch before backtracking.
- Breadth-First Search (BFS): An algorithm for exploring a graph by visiting all vertices at the current depth before moving deeper.
- Dijkstra's Algorithm: An algorithm for finding the shortest paths between vertices in a weighted graph.
- Prim's Algorithm: An algorithm for finding a minimum spanning tree in a weighted, connected graph.
- Kruskal's Algorithm: An algorithm for finding a minimum spanning tree by adding edges in increasing weight order.
- Floyd-Warshall Algorithm: An algorithm for finding shortest paths between all pairs of vertices in a weighted graph.
Importance of Graph Theory
Graph theory is important because it helps analyze and solve complex problems involving relationships and interactions.
By representing problems as graphs, we can use mathematical tools to find efficient solutions. Graph theory helps us understand the structure of networks and systems, aiding in decision-making in various fields.
Learning Graph Theory
Learning graph theory involves studying its basic concepts, definitions, and theorems, and exploring its applications through examples and exercises.
A strong foundation in graph theory allows you to apply its principles to real-world problems and contribute to advances in science, technology, and mathematics.