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, G=(V,E)G = (V,E), consists of a non-empty set V of vertices, and a set E[V]2E \subset [V]^2 of undirected edges. Every edge u,vE\\{u,v\\} \in E has two distinct vertices u,/=vu \mathrlap{\\,/}{=} v as endpoints, and such vertices uu and vv are then said to be adjacent in the graph.

Directed graphs

Adirected graph, G=(V,E)G = (V,E), consists of a non-empty set VV of vertices, and a set E[V]2E \subset [V]^2 of directed edges. Each directed edge (u,v)E(u,v) \in E has a start vertex uu, and an end vertex vv.

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 vv in an undirected graph is the number of edges incident with it. The degree of the vertex vv is denoted by deg(v)\text{deg}(v).

An undirected graph has an even number of vertices of odd degree.

For directed graphs, the ‘in-degree’ of a vertex vv, denoted deg−(v)\text{deg−}(v), is the number of edges directed into vv. The ‘out-degree’ of vv, denoted deg+(v)\text{deg+}(v), is the number of edges directed out of vv. Note that a loop at a vertex contributes 1 to both in-degree and out-degree.

The neighbourhood of a vertex vv in an undirected graph, denoted N(v)N(v), is the set of vertices adjacent to vv.

Handshaking theorem

Let G=(V,E)G = (V,E) be an undirected graph with mm edges, then:

2m=vVdeg(v)2m = \displaystyle\sum_{v \in V} \text{deg}(v)

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 nn vertices, denoted by KnK_n, is the simple graph that contains exactly one edge between each pair of distinct vertices.

Complete graphs

Cycles

A cycle for n3n \ge 3, denoted by CnC_n, consists of n vertices v1,v2,...,vnv_1,v_2,...,v_n, and edges v1,v2,v2,v3,...,vn1,vn,vn,v1\\{v_1,v_2\\},\\{v_2,v_3\\},...,\\{v_{n-1},v_n\\},\\{v_n,v_1\\}.

Cycles

n-Cubes

An n-dimensional hypercube, or n-cube, is a graph with 2n2^n 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.

n-Cubes

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.

Bipartite graph

A graph can be shown to be bipartite by splitting its set to vertices VV 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 V1V_1 of size mm and V2V_2 of size nn such that there is an edge from every vertex in V1V_1 to every vertex in V2V_2.

A bipartite graph is called kk-regular if every vertex in GG has degree exactly kk.

Matchings

A matching, MM, in a graph, G=(V,E)G = (V,E), is a subset of edges, MEM \subseteq E, such that there does not exist two distinct edges in MM that are incident on the same vertex. In other words, if u,v,w,zM\\{u,v\\},\\{w,z\\} \in M, then either u,v=w,z\\{u,v\\} = \\{w,z\\} or u,vw,z=\\{u,v\\} \cap \\{w,z\\} = \emptyset.

A maximum matching in graph GG is a matching in GG with the maximum possible number of edges.

For a graph G=(V,E)G = (V,E), we say that a subset of edges, WEW \subseteq E, covers a subset of vertices, AVA \subseteq V, if for all vertices uAu \in A, there exists an edge eWe \in W, such that ee is incident on uu, i.e. such that e=u,ve = \\{u,v\\}, for some vertex vv.

In a bipartite graph G=(V,E)G = (V,E) with bipartition (V1,V2)(V_1,V_2), a complete matching with respect to V1V_1, is a matching MEM' \subseteq E that covers V1V_1, and a perfect matching is a matching, MEM* \subseteq E, that covers VV.

Subgraphs

A subgraph of a graph G=(V,E)G = (V,E) is a graph H=(W,F)H = (W,F), where WVW \subseteq V and FEF \subseteq E. A subgraph HH of GG is a proper subgraph of GG if H,/=GH \mathrlap{\\,/}{=} G.

Let G=(V,E)G = (V,E) be a graph. The subgraph induced by a subset WW of the vertex set VV is the graph H=(W,F)H = (W,F), whose edge set FF contains an edge in EE if and only if both endpoints are in WW.

Formally, a bipartite graph is a undirected graph G=(V,E)G = (V,E) whose vertices can be partitioned into two disjoint sets (V1,V2)(V_1,V_2), with V1V2=V_1 \cap V_2 = \emptyset and V1V2=VV_1 \cup V_2 = V, such that for every edge eEe \in E, e=u,ve = \\{u,v\\} such that uV1u \in V_1 and vV2v \in V_2. In other words, every edge connects a vertex in V1V_1 with a vertex in V2V_2.