Edge (Graph Theory) — Definition, Formula & Examples
An edge (in graph theory) is a link that connects two vertices (nodes) in a graph. Each edge represents a relationship or connection between a pair of vertices.
Given a graph , an edge is an element of the edge set, defined as an unordered pair of vertices in an undirected graph or an ordered pair in a directed graph. A graph may contain multiple edges between the same pair of vertices (a multigraph) or an edge from a vertex to itself (a loop).
Key Formula
Where:
- = Number of edges in a simple undirected graph (no loops or repeated edges)
- = Number of vertices, i.e., $n = |V|$
How It Works
Edges are the fundamental building blocks of a graph alongside vertices. To describe a graph, you list its vertices and then specify which pairs are connected by edges. For example, a social network graph might have people as vertices and friendships as edges. The number of edges meeting at a vertex determines that vertex's degree. When you draw a graph, each edge appears as a line or curve between two dots. Counting edges and analyzing how they connect vertices is central to problems like finding shortest paths, detecting cycles, and determining whether a graph is connected.
Worked Example
Problem: A simple undirected graph G has vertices {A, B, C, D} and edges {A, B}, {A, C}, {B, C}, {C, D}. Find the total number of edges, the degree of each vertex, and verify the Handshaking Lemma.
List the edges: The edge set is E = { {A,B}, {A,C}, {B,C}, {C,D} }.
Find each vertex's degree: Count how many edges touch each vertex. A appears in 2 edges, B in 2, C in 3, and D in 1.
Verify the Handshaking Lemma: The Handshaking Lemma states that the sum of all vertex degrees equals twice the number of edges.
Answer: The graph has 4 edges. The degrees are A: 2, B: 2, C: 3, D: 1, and their sum (8) equals 2|E|, confirming the Handshaking Lemma.
Another Example
Problem: What is the maximum number of edges in a simple undirected graph with 6 vertices?
Apply the formula: For a simple graph, the maximum number of edges occurs when every pair of distinct vertices is connected (a complete graph).
Calculate: Simplify the expression.
Answer: A simple undirected graph with 6 vertices can have at most 15 edges.
Why It Matters
Edges are essential in discrete mathematics and computer science courses, where you study networks, trees, and algorithms like Dijkstra's shortest path. In the real world, edges model connections in social networks, road maps, circuit design, and internet routing. Understanding edges and their properties is a prerequisite for nearly every topic in graph theory, from Euler paths to network flow problems.
Common Mistakes
Mistake: Confusing the number of edges with the number of vertices when calculating a vertex's degree.
Correction: The degree of a vertex is the number of edges incident to that specific vertex, not the total number of edges in the graph. Count only the edges that touch the vertex in question.
Mistake: Assuming two edges between the same pair of vertices are allowed in a simple graph.
Correction: A simple graph permits at most one edge between any pair of vertices and no loops. Multiple edges between the same pair require a multigraph.
