14.1: Basics and Examples
a diagram consisting of a finite collection of points connected by line segments or arcs
Suppose we have jugs \(A,B,C\) with capacities \(8,5,3\) litres, respectively. Jug \(A\) is full of water and jugs \(B,C\) are empty. Can we divide the water into two exactly equal parts? If so, find the most efficient pouring sequence.
Solution
Construct a graph with points labelled by elements \((a,b,c) \in \mathbb{N} \times \mathbb{N} \times \mathbb{N}\text{,}\) where \(a,b,c\) are the volumes of water in jugs \(A,B,C\text{,}\) respectively. Join two points with a line segment if we can obtain one set of volumes from the other in a single pour. We will ignore pours that return us to a configuration previously achievable by fewer pours.
Following the left leg of the graph gets us to the desired configuration in \(7\) pours.
an ordered pair \((V,E)\text{,}\) where \(V\) is a finite set and \(E\) is a finite, unordered list of subsets of \(V\text{,}\) each of which has exactly \(1\) or \(2\) elements
a point in a graph (i.e. an element of \(V\))
synonym for vertex
a connecting line or arc between two vertices (i.e. an element of \(E\))
the graph \((\emptyset,\emptyset)\text{,}\) with no vertices and no edges
Warning \(\PageIndex{1}\)
The list \(E\) is not a set, since duplicate entries in this list have a graphical meaning; see below.
An element \(e \in E\) represents an edge as follows. If \(e\) consists of exactly two elements of \(V\text{,}\) draw a line between these two vertices. If \(e\) consists of exactly one element of \(V\text{,}\) draw a line from this vertex to itself.
The graph \(G = (V,E)\text{,}\) where
\begin{align*} V & = \{ v_1, v_2, v_3 \}, & E & = \bigl\{ \{v_1,v_2\}, \{v_1,v_3\}, \{v_2,v_3\} \bigr\}, \end{align*}
has three vertices and three edges.
The graph \(G = (V,E)\text{,}\) where
\begin{align*} V & = \{ v_1, v_2, v_3, v_4 \}, & E & = \bigl\{ \{v_1, v_2\}, \{v_1, v_2\}, \{v_1, v_2\}, \{ v_3 \}, \{ v_3 \} \bigr\}, \end{align*}
has four vertices and five edges.