Simple Graphs as Vertex and Edge Sets
A graph represents a collection of objects together with selected pairwise relationships between them. The objects are the vertices; the relationships are the edges. In this tutorial, graphs are finite and simple. The word “simple” specifies the permitted form of an edge: it connects two distinct vertices, and a particular pair of vertices can be joined by at most one edge.
An edge \(uv\) is an unordered pair: \(uv\) and \(vu\) name the same edge. In particular, the order of the endpoint labels does not create a different relationship. The edge set \(E\) is itself a set, so listing the same pair twice does not create two edges. These conventions make a simple graph an appropriate model when the information of interest is just which distinct pairs are related, with each relationship recorded once.
The two restrictions are built into the requirement that each edge be a two-element subset. A loop would have the same endpoint twice, so it would be a one-element set rather than a two-element set. Repeating an edge would not add another element to a set. Other graph models can allow such features, but they are not simple graphs; those models have their own definitions.
Reading the Notation
The vertex set tells you which objects are included in the graph, even if some have no edges. The edge set tells you exactly which pairs are joined. The order counts vertices, while the size counts edges. Neither count is determined by the labels themselves: vertices named \(1,2,3\) do not mean the graph has size \(3\); the size comes from counting its distinct edges.
When the vertices are labelled with numbers, \(12\) is shorthand for \(\{1,2\}\), not the number twelve. For example, writing \(E=\{12,24\}\) specifies the two edges \(\{1,2\}\) and \(\{2,4\}\). Edge notation without braces is convenient, but the endpoints must belong to the stated vertex set.
Proof. If \(G\) is a simple graph, its definition says that \(V\) is finite and that \(E\) is a set of two-element subsets of \(V\). Each such subset contains two distinct vertices, so no edge is a loop. Because \(E\) is a set, a given two-element subset is either present once or absent; it cannot occur as two different edges. Conversely, suppose \(V\) is finite and the edges are distinct unordered pairs of distinct elements of \(V\), with no pair repeated. Each edge is then a two-element subset of \(V\), and the collection of these pairs is a set \(E\). Therefore \(G=(V,E)\) satisfies the definition of a simple graph. \(\square\)
Worked Example: Finding Order and Size
Let \(G=(V,E)\), where \(V=\{1,2,3,4\}\) and \(E=\{12,13,34\}\). Find the order and size, and check that the edge list is valid.
The vertex set has four elements, so \(n=|V|=4\). The edge set lists \(12\), \(13\), and \(34\); these are three distinct unordered pairs, so \(m=|E|=3\). Each pair has two different labels, and each label belongs to \(V\), so every listed edge is permitted.
Check: The six possible two-element subsets of \(V\) are \(12,13,14,23,24,34\). The stated edge set contains exactly three of them: \(12,13,34\). This independently confirms that the graph has size \(3\), with no loop or repeated edge.
For any fixed finite vertex set, the definition also gives a direct count of the possible simple graphs on that set. There is one possible edge for each unordered pair of distinct vertices. Each possible pair can either be included in \(E\) or omitted, independently of the other pairs.
Proof. An edge must be a two-element subset of \(V\), and there are \(\binom{n}{2}\) such subsets: there are \(n(n-1)\) ordered choices of two distinct vertices, and each unordered pair is counted twice, once in each order. For each of these \(\binom{n}{2}\) candidate edges, a graph’s edge set makes exactly one choice: include it or omit it. Thus each candidate pair contributes two choices, giving \(2^{\binom{n}{2}}\) edge sets. When \(n=0\) or \(n=1\), there are no candidate pairs, and there is exactly one choice of edge set, namely \(E=\varnothing\); the formula gives \(2^0=1\) in both cases. \(\square\)
Worked Example: A Vertex with No Edges
Let \(H=(V,E)\), where \(V=\{a,b,c,d,e\}\) and \(E=\{ab,bc,cd\}\). Find the order and size, and identify the vertex that appears in no edge.
There are five listed vertices, so \(n=|V|=5\). There are three distinct listed edges, so \(m=|E|=3\). The label \(e\) does not occur in any edge, so it is a vertex of the graph even though it has no edge in this list. The graph is simple: \(a,b,c,d\) are distinct endpoints within each pair, and no pair is listed twice.
Check: The number of possible unordered pairs from five vertices is \(\binom{5}{2}=5\cdot4/2=10\). The three edges in \(E\) are \(ab,bc,cd\); each is one of those ten pairs, and the other seven possible pairs are absent. In particular, no edge involving \(e\) is present.
Labels, Edge Sets, and Counting
Different edge sets on the same vertex set describe different graphs. For instance, changing one edge changes which pair is related, even when the vertex set is unchanged. On the other hand, changing vertex labels alone does not change the kind of information being represented: labels identify the objects, while the edge set records the selected pairs. When interpreting a graph, read \(V\) and \(E\) together rather than inferring one from the other.
The formula for the number of possible graphs can be checked on a small vertex set. With \(V=\{1,2,3\}\), the possible edges are \(12,13,23\). Each can be selected or omitted, so there are \(2\cdot2\cdot2=8\) possible edge sets, including the empty edge set and the set containing all three pairs. This agrees with \(2^{\binom{3}{2}}=2^3=8\).
Worked Example: Checking a Proposed Edge Set
Consider the proposed notation \(J=(V,E)\), where \(V=\{p,q,r,s\}\) and \(E=\{pq,qr,rs,pq\}\). Decide whether this notation describes a simple graph as written, and give the corresponding edge set if repeated listing is ignored.
Every listed pair uses two distinct labels from \(V\), so none is a loop and none has an endpoint outside \(V\). The pair \(pq\), however, appears twice in the written list. Since an edge set is a set, duplicate listings do not make a second edge. Interpreting the display as a set therefore gives \(E=\{pq,qr,rs\}\), with three distinct edges.
Check: The four vertices allow \(\binom{4}{2}=4\cdot3/2=6\) possible unordered pairs: \(pq,pr,ps,qr,qs,rs\). The corrected edge set contains exactly \(pq,qr,rs\), three distinct allowed pairs. Thus \(J\), with the edge set interpreted as a set, is a simple graph of order \(4\) and size \(3\). The repeated text does not raise the size to \(4\).
Common Pitfalls
Counting written entries instead of distinct edges. In the last example, counting the four entries in the display as four separate edges gives the wrong size. The correction is to use the set \(E=\{pq,qr,rs\}\) and count its distinct elements: \(m=3\).
Forgetting vertices with no listed edges. In the second example, \(e\) remains a vertex because it belongs to \(V\), even though it appears in no edge. Removing it would change the vertex set and the order.
Reading \(uv\) as an ordered pair. In a simple graph \(uv\) and \(vu\) denote the same unordered edge. Listing both does not create two edges. Also, \(uu\) is not a permitted edge: it does not have two distinct endpoints.
Confusing order with size. The order \(n\) is \(|V|\); the size \(m\) is \(|E|\). Count the elements of the relevant set rather than using the vertex labels or assuming that one count determines the other.
Check Your Understanding
Use the definitions and notation to answer each question.
- For \(V=\{1,2,3,4,5\}\) and \(E=\{12,15,23,45\}\), find the order and size.
- Why is \(33\) not an edge in a simple graph, even if \(3\in V\)?
- For a fixed vertex set with three elements, list the possible edges and calculate the number of possible simple graphs.
- Let \(V=\{a,b,c\}\) and \(E=\{ab,ba\}\) be written as a set of edge entries. How many distinct edges does \(E\) contain, and why?
- Can a vertex belong to \(V\) and occur in no element of \(E\)? Explain using the definition.