
- 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 - Edge List
Edge List
An Edge List is a simple way of representing a graph where each edge is stored as a pair (or tuple) of vertices that it connects. It is a representation that stores all the edges of a graph, with each edge listed once, along with the two vertices it connects.
The major characteristics of an edge list are −
- Simple Representation: Each edge is represented as a pair of vertices (u, v), indicating that there is an edge between vertex u and vertex v.
- Easy to Construct: Edge lists are easy to construct, especially when the graph is sparse or when edges are being added one by one.
For example, in an edge list, if a graph has edges between vertex A and B, and between vertex B and C, the edge list would look like [(A, B), (B, C)].
Structure of the Edge List
The edge list is simply a list (or array) of edges where each edge is represented by a pair (or tuple) of vertices. Each edge is usually represented as a tuple (u, v) for an undirected graph, where u and v are the vertices connected by the edge.
In a directed graph, each edge is represented as (u, v), where the direction of the edge goes from vertex u to vertex v.
For an Undirected Graph
In the case of an undirected graph, each edge is simply represented by the pair of vertices that the edge connects. For example, if there is an edge between vertex A and vertex B, it is represented as (A, B).
Consider a simple undirected graph with 3 vertices: V = {A, B, C} and edges {A-B, A-C}. The edge list for this graph would be −
Edge List: [(A, B), (A, C)]
For a Directed Graph
In the case of a directed graph, each edge is represented by a directed pair (u, v), where u is the starting vertex, and v is the destination vertex.
Consider a directed graph with 3 vertices: V = {A, B, C} and edges {A->B, A->C}. The edge list for this graph would be −
Edge List: [(A, B), (A, C)]
Properties of the Edge List
The edge list has several properties that distinguish it from other graph representations, such as the adjacency matrix or adjacency list. These properties make it useful for certain types of graphs and applications.
Space Complexity
The space complexity of the edge list is O(E), where E is the number of edges in the graph. Since each edge is stored as a pair of vertices, the space required is directly proportional to the number of edges.
Efficiency for Sparse Graphs
The edge list is efficient for sparse graphs, where the number of edges is much smaller than the number of vertices. In these cases, the edge list is much more easy to manipulate than other graph representations like the adjacency matrix.
Edge Traversal
The edge list is also efficient for edge traversal. Since the list directly stores the edges, iterating through the edges is easy, and each edge can be accessed in constant time.
This is useful in graph traversal algorithms such as Depth-First Search (DFS) and Breadth-First Search (BFS), where the focus is on exploring the edges of the graph.
Applications of the Edge List
Edge lists are used in various graph-related applications, particularly when the focus is on edges rather than the vertices.
Graph Construction
Edge lists are commonly used for constructing graphs, especially when the graph is sparse and the primary goal is to store the edges. In cases where the vertices are already known, the edge list provides a simple way to represent the edges of the graph.
Graph Traversal Algorithms
In graph traversal algorithms such as DFS and BFS, the edge list is often used to explore the edges of the graph. During traversal, the algorithm iterates through the edge list to discover adjacent vertices and process the graph's edges.
Network Flow Algorithms
Edge lists are widely used in algorithms that model flow networks, such as the Ford-Fulkerson method for computing maximum flow. These algorithms require access to the edges, and the edge list format provides a natural way to store the edges of a flow network.
Pathfinding Algorithms
Pathfinding algorithms like Dijkstra's and Bellman-Ford rely on the edges of the graph. The edge list allows these algorithms to easily iterate through the edges and compute shortest paths, especially in sparse graphs.
Graph Coloring
In graph coloring problems, edge lists can be used to represent the edges of the graph, allowing for traversal of the graph as vertices are colored and adjacent vertices are checked for conflicts.
Edge List: Pros and Cons
While the edge list is a simple representation for many types of graphs, it also has limitations that make it less suitable for certain applications.
Advantages
Following are the advantages of edge list −
- Space Efficiency for Sparse Graphs: The edge list is very space-efficient for sparse graphs because it only stores the edges, making it more compact compared to other representations like the adjacency matrix.
- Easy Edge Manipulation: Adding, removing, or updating edges in the edge list is easy, as the edges are stored as pairs of vertices, and modifications can be done by directly manipulating the list.
- Efficient Edge Traversal: Since the edge list directly stores the edges, iterating through the edges is simple and can be done in constant time.
- Simple Representation: The edge list provides a simple representation of the graph, especially in cases where the algorithm focuses on the edges.
Disadvantages
Following are the disadvantages of edge list −
- Slow Vertex Lookup: The edge list does not provide an efficient way to check whether a particular vertex is adjacent to another vertex. This can be inefficient for certain graph algorithms that require frequent adjacency checks.
- Lack of Efficient Vertex Operations: Unlike adjacency matrices or lists, the edge list does not provide an efficient way to perform vertex-specific operations, such as finding all neighbors of a vertex without scanning the entire edge list.
- No Quick Access to Vertex Degree: In the edge list representation, the degree of a vertex (the number of edges incident to it) is not available. Calculating vertex degrees requires scanning the entire list of edges.
Edge List Alternatives
We can use several optimizations and alternative for graph representations depending on the specific problem or graph structure.
Adjacency List
The adjacency list is an alternative representation where each vertex is associated with a list of its adjacent vertices. This structure allows for efficient vertex lookups and is space-efficient for sparse graphs. Unlike the edge list, it allows for fast access to the neighbors of a vertex.
Adjacency Matrix
The adjacency matrix is another representation where the graph is stored as a 2D matrix, with each cell indicating the presence or absence of an edge between two vertices. While the adjacency matrix is less space-efficient for sparse graphs, it allows for fast lookups of edge existence between two vertices.
Incidence Matrix
The incidence matrix is another graph representation that relates vertices to edges. It is especially useful in graph algorithms that involve edge manipulation or flow networks, but it has higher space complexity compared to the edge list and is generally more suitable for specific use cases.