09 Introduction to Graph Theory
A structured introduction to graph theory covering graph terminology, representations, degrees, routes, cycles, connectivity, and subgraphs.
structure and terminology
theory studies relationships among objects. A is written as
where is a set of vertices and is a set of edges. For example, consider
This has four vertices and four edges. Vertices and are adjacent because the edge joins them. The edge is incident with both endpoints, and .
The neighborhood of a , written , is the set of vertices adjacent to . In this example,
Unless stated otherwise, introductory theory commonly uses simple undirected graphs:
An undirected edge has no direction, so and represent the same edge.
A simple has no loops and no repeated edges.
A loop joins a to itself.
A multigraph may have multiple edges joining the same pair of vertices.
A directed uses directed edges such as .
A weighted assigns a numerical value to each edge.
The order of a is , and its size is . An empty has no edges, while a trivial has one and no edges.
The term refers to the complete structure of vertices and edges, while the term refers to one of the individual objects in that structure.
Takeaway: A describes objects through vertices and relationships through edges; adjacency and incidence specify how those parts are connected.
Ways to represent a
Different representations emphasize different features of the same . For the with
the main representations are as follows.
An edge list records the edges directly:
An adjacency list records the neighbors of each . For example, the entries are , , , and .
An adjacency matrix is a square matrix whose rows and columns correspond to vertices. For a simple undirected , an entry is when the corresponding vertices are adjacent and otherwise. In the order ,
An undirected has a symmetric adjacency matrix, and a simple has zeros on the diagonal.
An incidence matrix has rows for vertices and columns for edges. Its entry is when the is an endpoint of the edge and otherwise. In a simple undirected , each column contains two entries equal to .
A drawing is also a representation. Its exact geometric appearance is unimportant: moving vertices or bending edges does not change the as long as the same incidences are preserved.
For sparse graphs, meaning graphs with relatively few edges compared with the maximum possible number, adjacency lists are often more economical than adjacency matrices. Adjacency matrices, however, make adjacency tests direct and are useful in algebraic and computational settings.
Takeaway: Choose a representation according to the task: lists are convenient for enumerating connections, matrices support systematic tests, and drawings provide an immediate visual picture.
Degrees and the
The of a measures its local connectivity. In the example ,
The sequence, usually listed in nonincreasing order, is therefore
A is regular when every has the same . If every has , the is called -regular.
The provides a useful consistency check:
For this ,
The factor of appears because every edge contributes one incidence at each of its two endpoints. Consequently, every finite undirected has an even number of odd- vertices.
A with is isolated, so it has no neighbors. A with is a leaf or pendant . If loops are allowed, a loop contributes to the because it creates two endpoint incidences at the same .
Takeaway: Degrees summarize local structure, while the connects all local counts to the 's total number of edges.
Walks, trails, paths, and cycles
Routes through a are classified by what they are allowed to repeat. A walk is a sequence of vertices
such that consecutive vertices are adjacent. Its length is . Both vertices and edges may repeat. For example, is a walk of length in the example .
A trail is a walk that does not repeat an edge, although it may repeat vertices. The sequence is a trail.
A is a walk that does not repeat vertices. For example, is a of length from to . The sequence is not a because it repeats .
A shortest between two connected vertices has the smallest possible length. That length is the distance between the vertices, commonly written . The has vertices and edges.
A is a closed : it starts and ends at the same , with no other repeated. In the example,
is a of length . The has vertices and edges, and every in it has .
The distinctions can be organized as follows:
A walk may repeat vertices and edges.
A trail may repeat vertices but not edges.
A repeats neither vertices nor edges.
A is a closed .
Takeaway: The restrictions become progressively stronger from walk to trail to ; cycles add the condition of returning to the starting .
Connectivity and components
Connectivity describes whether vertices can reach one another. Two vertices are connected when there is a between them. A is connected when every pair of vertices is connected.
The with edges is connected because, for example, is a from to . A that is not connected is disconnected, and its connected components are its maximal connected pieces.
For example, suppose
The connected components have sets
An isolated forms a component by itself. A is connected precisely when it has one .
Connectivity does not require a unique route. There may be multiple paths between two vertices. In fact, two distinct paths between the same pair of vertices imply that the contains a : following one forward and the other backward produces a closed route with a repeated starting point.
A with no cycles is acyclic. A connected acyclic is called a tree.
Takeaway: Paths determine reachability, connected components partition a disconnected into maximal reachable regions, and cycles provide alternative routes.
Subgraphs and selected structure
A subgraph is a smaller contained within a larger . If , then is a subgraph of when
and every edge in has both endpoints in . A subgraph can be created by deleting vertices, deleting edges, or doing both.
For
choosing
defines a valid subgraph. The edge cannot be included because .
Two important special cases are:
A spanning subgraph contains every of the original but may contain only some of its edges. Thus, it has the form with .
An is determined by a chosen set . It contains every original edge whose endpoints are both in , and is written .
For the example, the on contains all three edges , , and . A on the same three vertices that omits is still a subgraph, but it is not the on that set.
A can be viewed as an consisting of one maximal set of mutually reachable vertices.
Takeaway: A general subgraph may omit selected vertices or edges, a spanning subgraph keeps all vertices, and an keeps every edge allowed by its selected vertices.
An integrated example
Consider the
Its order is , and its size is . The degrees are
The sum verifies the :
The sequence is a of length , while is a from to . The is connected because every can be reached from every other .
The vertices , together with edges , form a subgraph that is a . The vertices , together with edges , form an induced subgraph on those vertices.
This example shows how the concepts fit together:
Degrees describe local connectivity.
Paths describe routes between vertices.
Cycles describe closed routes and alternative connections.
Connectivity describes the as a whole.
Subgraphs identify smaller structures inside the .
Final takeaway: To analyze a , first identify its vertices and edges, then examine representations and degrees, classify routes and cycles, determine connected components, and finally isolate relevant subgraphs.