58 lines
1.5 KiB
TeX
Executable File
58 lines
1.5 KiB
TeX
Executable File
\section{Review}
|
|
|
|
\definition{}
|
|
A \textit{graph} consists of a set of \textit{nodes} $\{A, B, ...\}$ and a set of edges $\{ (A,B), (A,C), ...\}$ connecting them.
|
|
A \textit{directed graph} is a graph where edges have direction. In such a graph, edges $(A, B)$ and $(B, A)$ are distinct.
|
|
A \textit{weighted graph} is a graph that features weights on its edges. \\
|
|
A weighted directed graph is shown below.
|
|
|
|
\begin{center}
|
|
\begin{tikzpicture}[node distance = 20mm]
|
|
% Nodes
|
|
\begin{scope}
|
|
\node[main] (A) {$A$};
|
|
\node[main] (B) [below right of = A] {$B$};
|
|
\node[main] (C) [below left of = A] {$C$};
|
|
\end{scope}
|
|
|
|
% Edges
|
|
\draw[->]
|
|
(A) edge[bend right] node[label] {$4$} (B)
|
|
(B) edge node[label] {$2$} (C)
|
|
(C) edge node[label] {$2$} (A)
|
|
(B) edge[bend right] node[label] {$1$} (A)
|
|
;
|
|
\end{tikzpicture}
|
|
\end{center}
|
|
|
|
\vfill
|
|
|
|
\definition{}
|
|
We say a graph is \textit{bipartite} if its nodes can be split into two groups $L$ and $R$, where no two nodes in the same group are connected by an edge: \\
|
|
|
|
\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, hatch] (D) at (20mm, 0mm) {$D$};
|
|
\node[main, hatch] (E) at (20mm, -10mm) {$E$};
|
|
\node[main, hatch] (F) at (20mm, -20mm) {$F$};
|
|
\end{scope}
|
|
|
|
% Edges
|
|
\draw
|
|
(A) edge (D)
|
|
(A) edge (E)
|
|
(B) edge (F)
|
|
(C) edge (E)
|
|
(C) edge (D)
|
|
;
|
|
\end{tikzpicture}
|
|
\end{center}
|
|
|
|
\vfill
|
|
\pagebreak |