Introduction to Graph Theory
Graphs are the study of vertices and the edges “between” them. More formally, a simple graph or graph is a pair of sets where is any set and is defined as any family of doubletons from .
This introduction is mostly about (simple) graphs but will briefly cover other varieties of graphs for reference.
Types of Edges
There are a few popular forms of graphs, and they are studied based on what properties the edges take on:
- Edges which are bidirectional are undirected.
- Edges which are unidirectional are directed and may also be known as arrows.
- Edges paired with numerical values are weighted.
- Edges which are indexed are labeled.
- Multiple edges between two vertices are arcs.
- An edge which connects to the same vertex is a loop.
| graph | arrow | loop | arc |
|---|---|---|---|
| graph | ✗ | ✗ | ✗ |
| multigraph | ✗ | ✗ | ✓ |
| loop graph | ✗ | ✓ | ✗ |
| loop multigraph | ✗ | ✓ | ✓ |
| digraph | ✓ | ✗ | ✗ |
| multidigraph | ✓ | ✗ | ✓ |
| loop digraph | ✓ | ✓ | ✗ |
| quiver | ✓ | ✓ | ✓ |
There’s an unfortunate amount of disagreement on the precise meaning of these terms; some authors use multigraph and pseudograph interchangeably and others permit multigraphs with loops.
There are also hypergraphs where edges may connect more than two vertices at once.
- A graph with fewer than vertices is trivial.
- A graph with no vertices is the null graph.
- A connected graph is one where there is a path between any two unique vertices.
Notation
Let be a graph. Then for convenience we may refer to the vertex set of as and the edge set as . For extra brevity one may also see for vertices and for edges.
Graphs
Let a graph be a pair of sets with an incidence function mapping primitive edges to a codomain that is a subset of .
Terms
Diagonal Subset
This encodes for self-loops.
Quotient Set
This encodes for undirected edges.
Quotient Set
This encodes a simple graph.
Definitions
The incidence function and its codomain determines the kind of graph.
| graph | arrow | loop | arc | definition |
|---|---|---|---|---|
| graph | ✗ | ✗ | ✗ | |
| multigraph | ✗ | ✗ | ✓ | |
| loop graph | ✗ | ✓ | ✗ | |
| loop multigraph | ✗ | ✓ | ✓ | |
| digraph | ✓ | ✗ | ✗ | |
| multidigraph | ✓ | ✗ | ✓ | |
| loop digraph | ✓ | ✓ | ✗ | |
| quiver | ✓ | ✓ | ✓ |
Let be edges in a graph. If then they are parallel edges found in multigraphs. If the mapping is injective then there are no parallel edges.
Alternative Definition
Let be a set of vertices. All of the following graphs may be defined as a pair of sets where takes on different properties. These graphs are notable for being easily represented by an adjacency matrix.
Graph
A simple graph or graph may be defined as a pair of sets where is any family of doubletons from .
Alternatively stated,
Directed Graph
A directed graph or digraph may be identified:
Loop Graph
A loop graph may be identified:
Loop Digraph
A loop digraph may be identified:
Multigraph
A multigraph is a graph which permits parallel or multiple edges along any two distinct vertices. This may be represented in a variety of ways; for example we may have a multiplicity function which given any edge will return the multiplicity of that edge.
Directed Multigraph
A directed multigraph is a multigraph with directed edges (also known as arcs or arrows).
Graph Traversal
A closed walk is one where the starting and ending vertex is the same.
- A walk is an alternating sequence of vertices and edges.
- A trail is a walk with no repeated edges.
- A path is a trail with no repeated vertices.
- A circuit is a closed trail.
- A cycle is a closed path.
- A Hamiltonian path is a path which visits all vertices in a graph. A Hamiltonian circuit is a Hamiltonian path which is closed.
| term | repeat vertex | repeat edge | closed |
|---|---|---|---|
| walk | ? | ? | ? |
| trail | ? | ✗ | ? |
| circuit | ? | ✗ | ✓ |
| path | ✗ | ✗ | ✗ |
| cycle | ✓ | ✗ | ✓ |
Subgraph
Let and be graphs. Then a subgraph relation is defined:
Spanning Subgraph and Supergraph
Let . If can become by only removing edges then is a spanning subgraph. Conversely, a spanning supergraph is a graph attained by only adding edges.
Induced Subgraph
Let be a subgraph of . A vertex induced subgraph is one where all possible edges are preserved from its supergraph.
Let be a set of edges. An edge induced subgraph of is one where for any subset of edges we have all vertices incident to them. This may be denoted:
Properties
Order
The order of a graph is the cardinality of its vertex set, and is denoted .
Size
The size of a graph is the cardinality of the edge set, and is denoted .
Adjacency
Two vertices within a graph are adjacent if there is an edge which joins them together.
Neighborhood
The set of all vertices adjacent to a vertex is called the open neighborhood of , denoted . The closed neighborhood of is the open neighborhood but also including itself, denoted .
Incidence
If an edge has a vertex , then is incident to . This may be denoted .
Degree
Let be a graph. The degree of a vertex is the cardinality of its open neighborhood, and is denoted .
The minimum degree and maximum degree of is also defined:
When we use degree on a graph (as opposed to a vertex) we refer to its average degree.
As an observation we have:
Ratio of Edges to Vertices
The ratio of edges to vertices may be denoted:
Color
A graph coloring labels each vertex in a graph with a color such that no two adjacent vertices have the same color.
The chromatic number of a graph is the minimal number of colors necessary in a graph coloring, denoted .
Independent
A set of vertices and edges are independent when no two elements are adjacent.
Union and Intersection
Let and be graphs. Then their union and intersection is defined:
Bipartite Graph
Let be a graph and let be a partition of the vertex set.
A bipartite graph is one where:
- No two vertices in are adjacent
- No two vertices in are adjacent
- All edges join some a vertex of to a vertex of .
Complete Graph
Let be the number of vertices in a graph. Then a complete graph is one where all possible edges exist.
Size of
Since any pair of vertices may potentially have an edge, finding the total number of possible edges between all pairs of vertices is the same as finding all -element subsets, and thus is an choose problem.
If we allow loops in our graph then the size of is:
Tree
A forest is an acyclic graph and a (free) tree is a connected forest.
A rooted tree is a tree with a vertex (or node) labeled as the root.
Resources
- nLab