Intermediate handouts
missing files
This commit is contained in:
31
src/Intermediate/An Introduction to Graph Theory/main.tex
Executable file
31
src/Intermediate/An Introduction to Graph Theory/main.tex
Executable file
@ -0,0 +1,31 @@
|
||||
% use [nosolutions] flag to hide solutions.
|
||||
% use [solutions] flag to show solutions.
|
||||
\documentclass[
|
||||
solutions,
|
||||
singlenumbering
|
||||
]{../../../lib/tex/ormc_handout}
|
||||
\usepackage{../../../lib/tex/macros}
|
||||
|
||||
|
||||
\input{tikxset.tex}
|
||||
\usepackage{adjustbox}
|
||||
|
||||
\uptitlel{Intermediate 2}
|
||||
\uptitler{\smallurl{}}
|
||||
\title{An Introduction to Graph Theory}
|
||||
\subtitle{
|
||||
Prepared by Mark on \today \\
|
||||
Based on a handout by Oleg Gleizer
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
|
||||
\input{parts/0 intro.tex}
|
||||
\input{parts/1 paths.tex}
|
||||
\input{parts/2 planar.tex}
|
||||
%\input{parts/3 counting.tex}
|
||||
|
||||
\end{document}
|
@ -0,0 +1,6 @@
|
||||
[metadata]
|
||||
title = "An Introduction to Graph Theory"
|
||||
|
||||
[publish]
|
||||
handout = true
|
||||
solutions = false
|
@ -0,0 +1,133 @@
|
||||
\section{Graphs}
|
||||
|
||||
\definition{}
|
||||
A \textit{set} is an unordered collection of objects. \par
|
||||
This means that the sets $\{1, 2, 3\}$ and $\{3, 2, 1\}$ are identical.
|
||||
|
||||
|
||||
\definition{}
|
||||
A \textit{graph} $G = (N, E)$ consists of two sets: a set of \textit{vertices} $V$, and a set of \textit{edges} $E$. \par
|
||||
Vertices are simply named \say{points,} and edges are connections between pairs of vertices. \par
|
||||
In the graph below, $V = \{a, b, c, d\}$ and $E = \{~ (a,b),~ (a,c),~ (a,d),~ (c,d) ~\}$.
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\begin{scope}[layer = nodes]
|
||||
\node[main] (a) at (0, 0) {$a$};
|
||||
\node[main] (b) at (0, -1) {$b$};
|
||||
\node[main] (c) at (2, -1) {$c$};
|
||||
\node[main] (d) at (4, 0) {$d$};
|
||||
\end{scope}
|
||||
|
||||
\draw[-]
|
||||
(a) edge (b)
|
||||
(a) edge (c)
|
||||
(a) edge (d)
|
||||
(c) edge (d)
|
||||
;
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
Vertices are also sometimes called \textit{nodes}. You'll see both terms in this handout. \par
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
Draw the graph defined by the following vertex and edge sets: \par
|
||||
$V = \{A,B,C,D,E\}$ \par
|
||||
$E = \{~ (A,B),~ (A,C),~ (A,D),~ (A,E),~ (B,C),~ (C,D),~ (D,E) ~\}$\par
|
||||
|
||||
\vfill
|
||||
|
||||
|
||||
We can use graphs to solve many different kinds of problems. \par
|
||||
Most situations that involve some kind of \say{relation} between elements can be represented by a graph.
|
||||
|
||||
\pagebreak
|
||||
|
||||
|
||||
Graphs are fully defined by their vertices and edges. The exact position of each vertex and edge doesn't matter---only which nodes are connected to each other. The same graph can be drawn in many different ways.
|
||||
|
||||
|
||||
\problem{}
|
||||
Show that the graphs below are equivalent by comparing the sets of their vertices and edges.
|
||||
|
||||
\begin{center}
|
||||
\adjustbox{valign=c}{
|
||||
\begin{tikzpicture}
|
||||
\begin{scope}[layer = nodes]
|
||||
\node[main] (a) at (0, 0) {$a$};
|
||||
\node[main] (b) at (2, 0) {$b$};
|
||||
\node[main] (c) at (2, -2) {$c$};
|
||||
\node[main] (d) at (0, -2) {$d$};
|
||||
\end{scope}
|
||||
|
||||
\draw[-]
|
||||
(a) edge (b)
|
||||
(b) edge (c)
|
||||
(c) edge (d)
|
||||
(d) edge (a)
|
||||
(a) edge (c)
|
||||
(b) edge (d)
|
||||
;
|
||||
\end{tikzpicture}
|
||||
}
|
||||
\hspace{20mm}
|
||||
\adjustbox{valign=c}{
|
||||
\begin{tikzpicture}
|
||||
\begin{scope}[layer = nodes]
|
||||
\node[main] (a) at (0, 0) {$a$};
|
||||
\node[main] (b) at (-2, -2) {$b$};
|
||||
\node[main] (c) at (0, -2) {$c$};
|
||||
\node[main] (d) at (2, -2) {$d$};
|
||||
\end{scope}
|
||||
|
||||
\draw[-]
|
||||
(a) edge (b)
|
||||
(b) edge (c)
|
||||
(c) edge (d)
|
||||
(d) edge (a)
|
||||
(a) edge (c)
|
||||
(b) edge[out=270, in=270, looseness=1] (d)
|
||||
;
|
||||
\end{tikzpicture}
|
||||
}
|
||||
\end{center}
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
\definition{}
|
||||
The degree $D(v)$ of a vertex $v$ of a graph
|
||||
is the number of the edges of the graph
|
||||
connected to that vertex.
|
||||
|
||||
|
||||
\theorem{Handshake Lemma}<handshake>
|
||||
In any graph, the sum of the degrees of its vertices equals twice the number of the edges.
|
||||
|
||||
|
||||
\problem{}
|
||||
Prove \ref{handshake}.
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{}
|
||||
Show that all graphs have an even number number of vertices with odd degree.
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{}
|
||||
One girl tells another, \say{There are 25 kids
|
||||
in my class. Isn't it funny that each of them
|
||||
has 5 friends in the class?} \say{This cannot be true,} immediately replies the other girl.
|
||||
How did she know?
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Say $G$ is a graph with nine vertices. Show that $G$ has at least five vertices of degree six or at least six vertices of degree 5.
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
@ -0,0 +1,237 @@
|
||||
\section{Paths and cycles}
|
||||
|
||||
A \textit{path} in a graph is, intuitively, a sequence of edges: $(x_1, x_2, x_4, ... )$. \par
|
||||
I've highlighted one possible path in the graph below.
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[
|
||||
node distance={15mm},
|
||||
thick,
|
||||
main/.style = {draw, circle}
|
||||
]
|
||||
|
||||
\node[main] (1) {$x_1$};
|
||||
\node[main] (2) [above right of=1] {$x_2$};
|
||||
\node[main] (3) [below right of=1] {$x_3$};
|
||||
\node[main] (4) [above right of=3] {$x_4$};
|
||||
\node[main] (5) [above right of=4] {$x_5$};
|
||||
\node[main] (6) [below right of=4] {$x_6$};
|
||||
\node[main] (7) [below right of=5] {$x_7$};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (1) -- (3);
|
||||
\draw[-] (2) -- (5);
|
||||
\draw[-] (2) -- (4);
|
||||
\draw[-] (3) -- (6);
|
||||
\draw[-] (3) -- (4);
|
||||
\draw[-] (4) -- (5);
|
||||
\draw[-] (5) -- (7);
|
||||
\draw[-] (6) -- (7);
|
||||
|
||||
\draw [
|
||||
line width=2mm,
|
||||
draw=black,
|
||||
opacity=0.4
|
||||
] (1) -- (2) -- (4) -- (3) -- (6);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
A \textit{cycle} is a path that starts and ends on the same vertex:
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[
|
||||
node distance={15mm},
|
||||
thick,
|
||||
main/.style = {draw, circle}
|
||||
]
|
||||
|
||||
\node[main] (1) {$x_1$};
|
||||
\node[main] (2) [above right of=1] {$x_2$};
|
||||
\node[main] (3) [below right of=1] {$x_3$};
|
||||
\node[main] (4) [above right of=3] {$x_4$};
|
||||
\node[main] (5) [above right of=4] {$x_5$};
|
||||
\node[main] (6) [below right of=4] {$x_6$};
|
||||
\node[main] (7) [below right of=5] {$x_7$};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (1) -- (3);
|
||||
\draw[-] (2) -- (5);
|
||||
\draw[-] (2) -- (4);
|
||||
\draw[-] (3) -- (6);
|
||||
\draw[-] (3) -- (4);
|
||||
\draw[-] (4) -- (5);
|
||||
\draw[-] (5) -- (7);
|
||||
\draw[-] (6) -- (7);
|
||||
|
||||
\draw[
|
||||
line width=2mm,
|
||||
draw=black,
|
||||
opacity=0.4
|
||||
] (2) -- (4) -- (3) -- (6) -- (7) -- (5) -- (2);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
A \textit{Eulerian\footnotemark} path is a path that traverses each edge exactly once. \par
|
||||
A Eulerian cycle is a cycle that does the same.
|
||||
|
||||
\footnotetext{Pronounced ``oiler-ian''. These terms are named after a Swiss mathematician, Leonhard Euler (1707-1783), who is usually considered the founder of graph theory.}
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
Similarly, a {\it Hamiltonian} path is a path in a graph that visits each vertex exactly once, \par
|
||||
and a Hamiltonian cycle is a closed Hamiltonian path.
|
||||
|
||||
\medskip
|
||||
|
||||
An example of a Hamiltonian path is below.
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[
|
||||
node distance={15mm},
|
||||
thick,
|
||||
main/.style = {draw, circle}
|
||||
]
|
||||
|
||||
\node[main] (1) {$x_1$};
|
||||
\node[main] (2) [above right of=1] {$x_2$};
|
||||
\node[main] (3) [below right of=1] {$x_3$};
|
||||
\node[main] (4) [above right of=3] {$x_4$};
|
||||
\node[main] (5) [above right of=4] {$x_5$};
|
||||
\node[main] (6) [below right of=4] {$x_6$};
|
||||
\node[main] (7) [below right of=5] {$x_7$};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (1) -- (3);
|
||||
\draw[-] (2) -- (5);
|
||||
\draw[-] (2) -- (4);
|
||||
\draw[-] (3) -- (6);
|
||||
\draw[-] (3) -- (4);
|
||||
\draw[-] (4) -- (5);
|
||||
\draw[-] (5) -- (7);
|
||||
\draw[-] (6) -- (7);
|
||||
|
||||
\draw [
|
||||
line width=2mm,
|
||||
draw=black,
|
||||
opacity=0.4
|
||||
] (1) -- (2) -- (4) -- (3) -- (6) -- (7) -- (5);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
\definition{}
|
||||
We say a graph is \textit{connected} if there is a path between every pair of vertices. A graph is called \textit{disconnected} otherwise.
|
||||
|
||||
\problem{}
|
||||
Draw a disconnected graph with four vertices. \par
|
||||
Then, draw a graph with four vertices, all of degree one.
|
||||
\vfill
|
||||
|
||||
|
||||
\problem{}
|
||||
Find a Hamiltonian cycle in the following graph.
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[
|
||||
node distance={20mm},
|
||||
thick,
|
||||
main/.style = {draw, circle}
|
||||
]
|
||||
|
||||
\node[main] (1) {$x_1$};
|
||||
\node[main] (2) [above right of=1] {$x_2$};
|
||||
\node[main] (3) [below right of=1] {$x_3$};
|
||||
\node[main] (4) [above right of=3] {$x_4$};
|
||||
\node[main] (5) [above right of=4] {$x_5$};
|
||||
\node[main] (6) [below right of=4] {$x_6$};
|
||||
\node[main] (7) [below right of=5] {$x_7$};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (1) -- (3);
|
||||
\draw[-] (2) -- (5);
|
||||
\draw[-] (2) -- (4);
|
||||
\draw[-] (3) -- (6);
|
||||
\draw[-] (3) -- (4);
|
||||
\draw[-] (4) -- (5);
|
||||
\draw[-] (5) -- (7);
|
||||
\draw[-] (6) -- (7);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
|
||||
\problem{}
|
||||
Is there an Eulerian path in the following graph? \par
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[
|
||||
node distance={20mm},
|
||||
thick,
|
||||
main/.style = {draw, circle}
|
||||
]
|
||||
|
||||
\node[main] (1) {$x_1$};
|
||||
\node[main] (2) [above right of=1] {$x_2$};
|
||||
\node[main] (3) [below right of=1] {$x_3$};
|
||||
\node[main] (4) [above right of=3] {$x_4$};
|
||||
\node[main] (5) [above right of=4] {$x_5$};
|
||||
\node[main] (6) [below right of=4] {$x_6$};
|
||||
\node[main] (7) [below right of=5] {$x_7$};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (1) -- (3);
|
||||
\draw[-] (2) -- (5);
|
||||
\draw[-] (2) -- (4);
|
||||
\draw[-] (3) -- (6);
|
||||
\draw[-] (3) -- (4);
|
||||
\draw[-] (4) -- (5);
|
||||
\draw[-] (5) -- (7);
|
||||
\draw[-] (6) -- (7);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Is there an Eulerian path in the following graph? \par
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[
|
||||
node distance={20mm},
|
||||
thick,
|
||||
main/.style = {draw, circle}
|
||||
]
|
||||
|
||||
\node[main] (1) {$x_1$};
|
||||
\node[main] (2) [above right of=1] {$x_2$};
|
||||
\node[main] (3) [below right of=1] {$x_3$};
|
||||
\node[main] (4) [above right of=3] {$x_4$};
|
||||
\node[main] (5) [above right of=4] {$x_5$};
|
||||
\node[main] (6) [below right of=4] {$x_6$};
|
||||
\node[main] (7) [below right of=5] {$x_7$};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (1) -- (3);
|
||||
\draw[-] (2) -- (4);
|
||||
\draw[-] (3) -- (6);
|
||||
\draw[-] (3) -- (4);
|
||||
\draw[-] (4) -- (5);
|
||||
\draw[-] (5) -- (7);
|
||||
\draw[-] (6) -- (7);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
When does an Eulerian path exist? \par
|
||||
\hint{Look at the degree of each node.}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
@ -0,0 +1,7 @@
|
||||
\section{Planar Graphs}
|
||||
|
||||
\textbf{TODO.} Will feature planar graphs, euler's formula, utility problem, utility problem on a torus
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
@ -0,0 +1,157 @@
|
||||
\section{Counting Graphs}
|
||||
|
||||
\definition{}
|
||||
A graph is \textit{bipartite} if its nodes can be split into two groups, where no two nodes in the same group share an edge. One such graph is shown below.
|
||||
|
||||
\problem{}
|
||||
Draw a bipartite graph with 5 vertices.
|
||||
|
||||
\vfill
|
||||
|
||||
\problem{}
|
||||
Is the following graph bipartite? \par
|
||||
\hint{Be careful.}
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
% Nodes
|
||||
\begin{scope}
|
||||
\node[main] (A) at (0mm, 0mm) {$A$};
|
||||
\node[main] (B) at (0mm, -10mm) {$B$};
|
||||
\node[main] (C) at (0mm, -20mm) {$C$};
|
||||
|
||||
\node[main] (D) at (20mm, 0mm) {$D$};
|
||||
\node[main] (E) at (20mm, -10mm) {$E$};
|
||||
\node[main] (F) at (20mm, -20mm) {$F$};
|
||||
\end{scope}
|
||||
|
||||
% Edges
|
||||
\draw
|
||||
(A) edge (D)
|
||||
(A) edge (E)
|
||||
(B) edge (F)
|
||||
(C) edge (E)
|
||||
(C) edge (D)
|
||||
(E) edge (F)
|
||||
;
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\vfill
|
||||
|
||||
\definition{}
|
||||
A \textit{subgraph} is a graph inside another graph. \par
|
||||
In the next problem, the left graph contains the left graph. \par
|
||||
The triangle is a subgraph of the larger graph.
|
||||
|
||||
|
||||
\problem{}
|
||||
Find two subgraphs of the triangle in the larger graph.
|
||||
|
||||
\begin{center}
|
||||
\adjustbox{valign=c}{
|
||||
\begin{tikzpicture}
|
||||
% Nodes
|
||||
\begin{scope}
|
||||
\node[main] (1) {1};
|
||||
\node[main] (2) [right of=1] {2};
|
||||
\node[main] (3) [below of=1] {3};
|
||||
\end{scope}
|
||||
|
||||
% Edges
|
||||
\draw
|
||||
(1) edge (2)
|
||||
(2) edge (3)
|
||||
(3) edge (1)
|
||||
;
|
||||
\end{tikzpicture}
|
||||
}
|
||||
\hspace{20mm}
|
||||
\adjustbox{valign=c}{
|
||||
\begin{tikzpicture}
|
||||
% Nodes
|
||||
\begin{scope}
|
||||
\node[main] (1) {1};
|
||||
\node[main] (4) [below of=1] {4};
|
||||
\node[main] (3) [left of=4] {3};
|
||||
\node[main] (5) [right of=4] {5};
|
||||
\node[main] (6) [right of=5] {6};
|
||||
\node[main] (2) [above of=6] {2};
|
||||
\node[main] (7) [below of=4] {7};
|
||||
\end{scope}
|
||||
|
||||
% Edges
|
||||
\draw
|
||||
(1) edge (4)
|
||||
(2) edge (5)
|
||||
(2) edge (6)
|
||||
(3) edge (4)
|
||||
(4) edge (5)
|
||||
(4) edge (7)
|
||||
(5) edge (6)
|
||||
(3) edge (7)
|
||||
;
|
||||
\end{tikzpicture}
|
||||
}
|
||||
\end{center}
|
||||
|
||||
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
||||
|
||||
A few special graphs have names. Here are a few you should know before we begin:
|
||||
|
||||
\definition{The path graph}
|
||||
The \textit{path graph} on $n$ vertices (written $P_n$) is a straight line of vertices connected by edges. \par
|
||||
$P_5$ is shown below.
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\node[main] (1) {1};
|
||||
\node[main] (2) [right of=1] {2};
|
||||
\node[main] (3) [right of=2] {3};
|
||||
\node[main] (4) [right of=3] {4};
|
||||
\node[main] (5) [right of=4] {5};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (2) -- (3);
|
||||
\draw[-] (3) -- (4);
|
||||
\draw[-] (4) -- (5);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
\definition{The complete graph}
|
||||
The \textit{complete graph} on $n$ vertices (written $K_n$) is the graph that has $n$ nodes, all of which share an edge.
|
||||
$K_4$ is shown below.
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\node[main] (1) {A};
|
||||
\node[main] (2) [above right of=1] {B};
|
||||
\node[main] (3) [below right of=1] {C};
|
||||
\node[main] (4) [above right of=3] {D};
|
||||
|
||||
\draw[-] (1) -- (2);
|
||||
\draw[-] (1) -- (3);
|
||||
\draw[-] (1) -- (4);
|
||||
\draw[-] (2) -- (3);
|
||||
\draw[-] (2) -- (4);
|
||||
\draw[-] (3) -- (4);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
|
||||
|
||||
\problem{}
|
||||
\begin{enumerate}
|
||||
\item How many times does $P_4$ appear in $K_9$?
|
||||
\item How many times does $C_4$ appear in $K_9$?
|
||||
\item How many times does $K_{4,4}$ appear in $K_9$?
|
||||
\item How many times does $C_5$ appear in $K_8$?
|
||||
\item How many times does $K_{3,3}$ appear in $K_{12}$?
|
||||
\item How many times does $K_{3,3}$ appear in $K_{6,6}$?
|
||||
\end{enumerate}
|
||||
|
||||
|
||||
|
45
src/Intermediate/An Introduction to Graph Theory/tikxset.tex
Normal file
45
src/Intermediate/An Introduction to Graph Theory/tikxset.tex
Normal file
@ -0,0 +1,45 @@
|
||||
\usetikzlibrary{arrows.meta}
|
||||
\usetikzlibrary{shapes.geometric}
|
||||
\usetikzlibrary{patterns}
|
||||
|
||||
% We put nodes in a separate layer, so we can
|
||||
% slightly overlap with paths for a perfect fit
|
||||
\pgfdeclarelayer{nodes}
|
||||
\pgfdeclarelayer{path}
|
||||
\pgfsetlayers{main,nodes}
|
||||
|
||||
% Layer settings
|
||||
\tikzset{
|
||||
% Layer hack, lets us write
|
||||
% later = * in scopes.
|
||||
layer/.style = {
|
||||
execute at begin scope={\pgfonlayer{#1}},
|
||||
execute at end scope={\endpgfonlayer}
|
||||
},
|
||||
%
|
||||
% Arrowhead tweak
|
||||
>={Latex[ width=2mm, length=2mm ]},
|
||||
%
|
||||
% Labels inside edges
|
||||
label/.style = {
|
||||
rectangle,
|
||||
% For automatic red background in solutions
|
||||
fill = \ORMCbgcolor,
|
||||
draw = none,
|
||||
rounded corners = 0mm
|
||||
},
|
||||
%
|
||||
% Nodes
|
||||
main/.style = {
|
||||
draw,
|
||||
circle,
|
||||
fill = white,
|
||||
line width = 0.4mm
|
||||
},
|
||||
every path/.style = {
|
||||
line width = 0.3mm
|
||||
},
|
||||
node distance={20mm},
|
||||
thick,
|
||||
main/.style = {draw, circle}
|
||||
}
|
Reference in New Issue
Block a user