Graphs
Introduction
A graph consists of a non-empty set of vertices and a set of edges that connect pairs of vertices. There are many different types of graphs that have different formal definitions which we will cover in more detail in this topic.
Undirected graphs
A simple undirected graph, , consists of a non-empty set V of vertices, and a set of undirected edges. Every edge has two distinct vertices as endpoints, and such vertices and are then said to be adjacent in the graph.
Directed graphs
Adirected graph, , consists of a non-empty set of vertices, and a set of directed edges. Each directed edge has a start vertex , and an end vertex .
Multigraphs & pseudographs
Both directed and undirected multigraphs are very similar to normal directed and undirected graphs except they allow for multiple edges between any two vertices. Be careful as this definition differs slightly from the Rosen textbook where their definition allows for loops but the one used in this course does not.
Both directed and undirected pseudographs are very similar to directed and undirected multigraphs except they allow for loops from a vertex to itself, including multiple loops.
Degree & neighbourhood
The degree of a vertex in an undirected graph is the number of edges incident with it. The degree of the vertex is denoted by .
An undirected graph has an even number of vertices of odd degree.
For directed graphs, the ‘in-degree’ of a vertex , denoted , is the number of edges directed into . The ‘out-degree’ of , denoted , is the number of edges directed out of . Note that a loop at a vertex contributes 1 to both in-degree and out-degree.
The neighbourhood of a vertex in an undirected graph, denoted , is the set of vertices adjacent to .
Handshaking theorem
Let be an undirected graph with edges, then:
Each edge contributes twice to the degree count of all vertices. Hence, both the left-hand and right-hand sides of this equation equal twice the number of edges.
Complete graphs
A complete graph on vertices, denoted by , is the simple graph that contains exactly one edge between each pair of distinct vertices.
Cycles
A cycle for , denoted by , consists of n vertices , and edges .
n-Cubes
An n-dimensional hypercube, or n-cube, is a graph with vertices representing all bit strings of length n, where there is an edge between two vertices if and only if they differ in exactly one bit position.
Bipartite graphs
An equivalent definition of a bipartite graph is one where it is possible to colour the vertices either red or blue so that no two adjacent vertices are the same colour.
A graph can be shown to be bipartite by splitting its set to vertices into two subsets where none of the vertices in a given subset are neighbours.
A complete bipartite graph is a graph that has its vertex set partitioned into two subsets of size and of size such that there is an edge from every vertex in to every vertex in .
A bipartite graph is called -regular if every vertex in has degree exactly .
Matchings
A matching, , in a graph, , is a subset of edges, , such that there does not exist two distinct edges in that are incident on the same vertex. In other words, if , then either or .
A maximum matching in graph is a matching in with the maximum possible number of edges.
For a graph , we say that a subset of edges, , covers a subset of vertices, , if for all vertices , there exists an edge , such that is incident on , i.e. such that , for some vertex .
In a bipartite graph with bipartition , a complete matching with respect to , is a matching that covers , and a perfect matching is a matching, , that covers .
Subgraphs
A subgraph of a graph is a graph , where and . A subgraph of is a proper subgraph of if .
Let be a graph. The subgraph induced by a subset of the vertex set is the graph , whose edge set contains an edge in if and only if both endpoints are in .
Formally, a bipartite graph is a undirected graph whose vertices can be partitioned into two disjoint sets , with and , such that for every edge , such that and . In other words, every edge connects a vertex in with a vertex in .