-
Notifications
You must be signed in to change notification settings - Fork 5
/
cheat5.tex
1122 lines (996 loc) · 53.1 KB
/
cheat5.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[a4paper,10pt]{article}
\usepackage{mypreamble}
%% Page setup
\geometry{
margin=2cm,
includehead,
includefoot,
headsep=8pt,
footskip=16pt,
}
\pagestyle{fancy}
\MakeSingleHeader% {<l>}{<r>}
{\TextCheatsheetEng: Graph Theory}%
{\TextDiscreteMathEng, \IconSpring~Spring 2024}
\fancyfoot{}
\fancyfoot[L]{\tiny Build time: \DTMnow}
\fancyfoot[R]{\tiny Source code can be found at \url{https://github.com/Lipen/discrete-math-course}}
% \fancyfoot[C]{\thepage\ of \zpageref{LastPage}}
%% Add custom setup below
% \titlespacing{\type}{left}{above}{below}[right]
\titlespacing{\section}{0pt}{*1}{*0.5}
\titlespacing{\subsection}{0pt}{*1}{*0.5}
\newcommand{\op}[1]{\operatorname*{#1}}
\newcommand{\dist}[1]{\op{dist}(#1)}
\newcommand{\degree}[1]{\op{deg}(#1)}
\newcommand{\minDegree}[1]{\delta(#1)}
\newcommand{\maxDegree}[1]{\Delta(#1)}
\newcommand{\eccentricity}[1]{\varepsilon(#1)}
\newcommand{\graphRadius}[1]{\op{rad}(#1)}
\newcommand{\graphDiameter}[1]{\op{diam}(#1)}
\newcommand{\graphGirth}[1]{\op{girth}(#1)}
\newcommand{\graphCenter}[1]{\op{center}(#1)}
\newcommand{\graphCentroid}[1]{\op{centroid}(#1)}
% \newcommand{\stabilitynumber}[1]{\alpha(#1)}
% \newcommand{\matchingnumber}[1]{\alpha'(#1)}
\newcommand{\vertexConnectivity}[1]{\varkappa(#1)}
\newcommand{\edgeConnectivity}[1]{\lambda(#1)}
\newcommand{\blockGraph}[1]{\op{B}(#1)}
\declaretheoremstyle[
spaceabove=6pt,
spacebelow=6pt,
postheadspace=0.5em,
notefont=\normalfont\scshape,
]{mystyle}
\declaretheorem[style=mystyle]{theorem}
\tikzset{
dot/.style = {
draw,
fill=black,
shape=circle,
minimum size=4pt,
inner sep=0pt,
},
position/.style args={#1:#2 from #3}{
at=(#3.#1), anchor=#1+180, shift=(#1:#2)
},
mylabel/.style args={#1:#2}{
append after command={
(\tikzlastnode.center) node [#1] {#2}
}
},
}
\colorlet{myred}{Red}
\colorlet{mygreen}{green!70!black}
\colorlet{myblue}{RoyalBlue}
\begin{document}
\selectlanguage{english}
\setcounter{section}{4}% +1 = actual
\section{Graph Theory Cheatsheet%
\texorpdfstring{\normalsize\hfill\href{https://en.wikipedia.org/wiki/Glossary_of_graph_theory}{Glossary}}{}}
\begin{terms}
\item \textbf{Graph}\Href{https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)} is an ordered pair $G = \Pair{V, E}$, where $V = \Set{v_1,\dotsc,v_n}$ is a set of vertices, and $E = \Set{e_1,\dotsc,e_m}$ is a set of edges.
\begin{terms}
\item Given a graph $G$, the notation $V(G)$ denotes the vertices of $G$.
\item Given a graph $G$, the notation $E(G)$ denotes the edges of $G$.
\item In fact, $V({\cdot})$ and $E({\cdot})$ functions allow to access \enquote{vertices} and \enquote{edges} of any object possessing them (\eg paths).
\end{terms}
\item \textbf{Order} of a graph $G$ is the number of vertices in it: $\card{V(G)}$.
\item \textbf{Size} of a graph $G$ is the number of edges in it: $\card{E(G)}$.
\item Simple \textbf{undirected}\Href{https://en.wikipedia.org/wiki/Undirected_graph} graphs have $E \subseteq V^{(2)}$, \ie each edge $e_i \in E$ between vertices $u$ and~$v$ is denoted by $\Set{u,v} \in V^{(2)}$.
Such~\emph{undirected edges} are also called \emph{links} or \emph{lines}.
\begin{terms}
\item $A^{(k)} = \Set{\Set{x_1,\dotsc,x_k} \given x_1 \neq \dotsb \neq x_k \in A} = \Set{ S \given S \subseteq A, \card{S} = k }$ is the set of $k$-sized subsets of~$A$.
\end{terms}
\item Simple \textbf{directed}\Href{https://en.wikipedia.org/wiki/Directed_graph} graphs have $E \subseteq V^{2}$, \ie each edge $e_i \in E$ from vertex $u$ to~$v$ is denoted by an ordered pair~$\Pair{u,v} \in V^{2}$.
Such \emph{directed edges} are also called \emph{arcs} or \emph{arrows}.
\begin{terms}
\item $A^k = A \times \dotsb \times A = \Set{\Tuple{x_1,\dotsc,x_k} \given x_1,\dotsc,x_k \in A}$ is the set of $k$-tuples (Cartesian $k$-power of~$A$).
\end{terms}
\begin{minipage}{\linewidth}
% \setlength{\intextsep}{0pt}%
% \setlength{\columnsep}{0pt}%
\begin{wrapfigure}{r}{0pt}
\setlength{\tabcolsep}{2pt}%
\begin{adjustbox}{tabular={@{} ccc @{}}}
\tikz[baseline=(label.base)]{
\path
(0,.1) node[dot] (a) {}
(.3,.8) node[dot] (b) {}
(1,.8) node[dot] (c) {}
(.7,.4) node[dot] (d) {}
(1.2,0) node[dot] (e) {}
(.5,-.2) node[dot] (f) {}
;
\draw
(a) -- (b) -- (c) -- (e) -- (f) -- (a)
(d) edge (a) edge (e) edge (f)
;
\node (label) at (.6,-.55) {Simple};
} &
\tikz[baseline=(label.base)]{
\path
(0,.1) node[dot] (a) {}
(.3,.8) node[dot] (b) {}
(1,.8) node[dot] (c) {}
(.7,.4) node[dot] (d) {}
(1.2,0) node[dot] (e) {}
(.5,-.2) node[dot] (f) {}
;
\draw
(b) -- (c) -- (e) -- (d) -- (a) -- (f)
(a) edge[bend left] (b) edge[bend right] (b)
(e) edge[bend left] (f) edge[bend right] (f)
;
\node (label) at (.6,-.55) {Multigraph};
} &
\tikz[baseline=(label.base)]{
\path
(0,.2) node[dot] (a) {}
(.25,.8) node[dot] (b) {}
(1,.8) node[dot] (c) {}
(.6,.4) node[dot] (d) {}
(1.2,.1) node[dot] (e) {}
(.5,-.2) node[dot] (f) {}
;
\draw
(b) -- (d) -- (f) -- (e)
(a) edge[bend left] (f) edge[bend right] (f)
(c) edge[bend left] (e) edge[bend right] (e) edge (b)
(e) edge[out=30,in=-50,loop] ()
(a) edge[out=130,in=50,loop] ()
;
\node (label) at (.7,-.5) {Pseudograph};
} \\[4pt]
\tikz[baseline=(label.base)]{
\node (label) {Null};
} &
\tikz[baseline=(label.base)]{
\path
(0,0) node[dot] (a) {}
(.4,.5) node[dot] (b) {}
(.4,-.2) node[dot] (c) {}
(.7,.2) node[dot] (d) {}
;
\node (label) at (.35,-.55) {Empty};
} &
\tikz[baseline=(label.base)]{
\path
(0,0) node[dot] (a) {}
(.4,.6) node[dot] (b) {}
(1,.3) node[dot] (c) {}
(.7,-.2) node[dot] (d) {}
;
\draw
(a) edge (b) edge (c) edge (d)
(b) edge (c) edge (d)
(c) edge (d)
;
\node (label) at (.5,-.55) {Complete};
}
\end{adjustbox}
\vspace{-\intextsep}
\end{wrapfigure}
\item \textbf{Multi-edges}\Href{https://en.wikipedia.org/wiki/Multi-edge} are edges that have the same end nodes.
\item \textbf{Loop}\Href{https://en.wikipedia.org/wiki/Loop_(graph_theory)} is an edge that connects a vertex to itself.
\item \textbf{Simple graph}\Href{https://en.wikipedia.org/wiki/Graph_theory\#Graph} is a graph without multi-edges and loops.
\item \textbf{Multigraph}\Href{https://en.wikipedia.org/wiki/Multigraph} is a graph with multi-edges.
\item \textbf{Pseudograph}\Href{https://en.wikipedia.org/wiki/Pseudograph} is a multigraph with loops.
% \item \textbf{Hypergraph}\Href{https://en.wikipedia.org/wiki/Hypergraph} is a generalization of a graph in which \\ an edge can join any number of vertices.
\item \textbf{Null graph}\Href{https://en.wikipedia.org/wiki/Null_graph} is a \enquote{graph} without vertices.
\item \textbf{Trivial (singleton) graph} is a graph consisting of a single vertex.
\item \textbf{Empty (edgeless) graph}\Href{https://en.wikipedia.org/wiki/Edgeless_graph} is a graph without edges.
\end{minipage}
\item \textbf{Complete graph}\Href{https://en.wikipedia.org/wiki/Complete_graph} $K_n$ is a simple graph in which every pair of distinct vertices is connected by an edge.
\item \textbf{Weighted graph}\Href{https://en.wikipedia.org/wiki/Weighted_graph} $G = \Tuple{V, E, w}$ is a graph in which each edge has an associated numerical value (the \emph{weight}) represented by the \textbf{weight function} $w: E \to \mathrm{Num}$.
\item \textbf{Subgraph}\Href{https://en.wikipedia.org/wiki/Glossary_of_graph_theory\#subgraph} of a graph $G = \Pair{V,E}$ is another graph $G' = \Pair{V',E'}$ such that $V' \subseteq V$, $E' \subseteq E$. Designated as $G' \subseteq G$.
\item \textbf{Spanning (partial) subgraph}\Href{https://en.wikipedia.org/wiki/Glossary_of_graph_theory\#spanning} is a subgraph that includes all vertices of a graph.
\item \textbf{Induces subgraph}\Href{https://en.wikipedia.org/wiki/Induced_subgraph} of a graph $G = \Pair{V,E}$ is another graph $G'$ formed from a subset~$S$ of the vertices of the graph and \emph{all} the edges (from the original graph) connecting pairs of vertices in that subset.
Formally, $G' = G[S] = \Pair{V',E'}$, where $S \subseteq V$, $V' = V \intersection S$, $E' = \Set{e \in E \given \exists v \in S: e \mathrel{I} v}$.
\begin{minipage}{\linewidth}
\setlength{\intextsep}{0pt}%
% \setlength{\columnsep}{0pt}%
\begin{wrapfigure}{r}{0pt}
\NiceMatrixOptions{
code-for-first-row = \color{gray},
code-for-first-col = \color{gray},
}
\setlength{\tabcolsep}{2pt}
\begin{tabular}{@{} cc @{}}
\tikz[baseline]{
\path
(0,0) node (a) [dot,mylabel={left=1pt:a}] {}
(.8,.6) node (b) [dot,mylabel={above right:b}] {}
(1.2,-.1) node (c) [dot,mylabel={above right:c}] {}
(.5,-.5) node (d) [dot,mylabel={left=1pt:d}] {}
;
\draw[inner sep=2pt]
(a) edge node[sloped,above]{$e_1$} (b)
(b) edge node[sloped,above]{$e_2$} (c)
(c) edge node[sloped,below]{$e_3$} (d)
(b) edge node[sloped,above]{$e_4$} (d)
(c) edge[out=0,in=-90,loop,>=To] node[right]{$e_5$} (c)
;
}
&
\tikz[baseline]{
\path
(0,0) node (a) [dot,mylabel={left=1pt:a}] {}
(.8,.6) node (b) [dot,mylabel={above right:b}] {}
(1.2,-.1) node (c) [dot,mylabel={above right:c}] {}
(.5,-.5) node (d) [dot,mylabel={left=1pt:d}] {}
;
\draw[->,>={Stealth[]}, inner sep=2pt]
(a) edge node[sloped,above]{$e_1$} (b)
(b) edge node[sloped,above]{$e_2$} (c)
(c) edge node[sloped,below]{$e_3$} (d)
(b) edge node[sloped,above]{$e_4$} (d)
(c) edge[out=0,in=-90,loop,>=To] node[right]{$e_5$} (c)
;
} \\
%
\multicolumn{2}{c}{\textbf{Adjacency matrix:}} \\
%
\(\begin{bNiceMatrix}[
light-syntax,
small,
first-row, first-col,
]
{} a b c d ;
a 0 1 0 0 ;
b 1 0 1 1 ;
c 0 1 1 1 ;
d 0 1 1 0 ;
\end{bNiceMatrix}\)
&
\begin{NiceMatrixBlock}[auto-columns-width]
\(\begin{bNiceMatrix}[
light-syntax,
small, r,
first-row, first-col,
]
{} a b c d ;
a 0 1 0 0 ;
b -1 0 1 1 ;
c 0 -1 1 1 ;
d 0 -1 -1 0 ;
\end{bNiceMatrix}\)
\end{NiceMatrixBlock} \\
%
\multicolumn{2}{c}{\textbf{Incidence matrix:}} \\
%
\(\begin{bNiceMatrix}[
light-syntax,
small,
first-row, first-col,
]
{} e_1 e_2 e_3 e_4 e_5 ;
a 0 0 0 0 0 ;
b 1 1 0 1 0 ;
c 0 1 1 0 2 ;
d 0 0 1 1 0 ;
\end{bNiceMatrix}\)
&
\begin{NiceMatrixBlock}[auto-columns-width]
\(\begin{bNiceMatrix}[
light-syntax,
small, r,
first-row, first-col,
]
{} e_1 e_2 e_3 e_4 e_5 ;
a -1 0 0 0 0 ;
b 1 -1 0 -1 0 ;
c 0 1 -1 0 2 ;
d 0 0 1 1 0 ;
\end{bNiceMatrix}\)
\end{NiceMatrixBlock} \\
\end{tabular}
\end{wrapfigure}
\item \textbf{Adjacency}\Href{https://en.wikipedia.org/wiki/Adjacent_(graph_theory)} is the relation between two vertices connected with an edge.
\item \textbf{Adjacency matrix}\Href{https://en.wikipedia.org/wiki/Adjacency_matrix} is a square matrix $A_{V \times V}$ of an adjacency relation.
\begin{terms}
\item For simple graphs, adjacency matrix is binary, \ie $A_{ij} \in \Set{0,1}$.
\item For directed graphs, $A_{ij} \in \Set{0,1,-1}$.
\item For multigraphs, adjacency matrix contains edge multiplicities, \ie $A_{ij} \in \NaturalZero$.
\end{terms}
\item \textbf{Incidence}\Href{https://en.wikipedia.org/wiki/Incidence_(geometry)} is a relation between an edge and its endpoints.
\item \textbf{Incidence matrix}\Href{https://en.wikipedia.org/wiki/Incidence_matrix} is a Boolean matrix $B_{V \times E}$ of an incidence relation.
\end{minipage}
\item \textbf{Degree}\Href{https://en.wikipedia.org/wiki/Degree_(graph_theory)} $\degree{v}$ the number of edges incident to $v$ (loops are counted twice).
\begin{terms}
\item $\minDegree{G} = \min\limits_{v \in V} \degree{v}$ is the \textbf{minimum degree}.
\item $\maxDegree{G} = \max\limits_{v \in V} \degree{v}$ is the \textbf{maximum degree}.
% TODO: in-degree and out-degree
\item \textsc{Handshaking lemma}. $\displaystyle \sum_{v \in V} \degree{v} = 2 \card{E}$.
\end{terms}
\item A graph is called \textbf{$r$-regular}\Href{https://en.wikipedia.org/wiki/Regular_graph} if all its vertices have the same degree: $\forall v \in V : \degree{v} = r$.
\item \textbf{Complement graph}\Href{https://en.wikipedia.org/wiki/Complement_graph} of a graph $G$ is a graph~$H$ on the same vertices such that two distinct vertices of~$H$ are adjacent iff they are non-adjacent in~$G$.
\item \textbf{Intersection graph}\Href{https://en.wikipedia.org/wiki/Intersection_graph} of a family of sets $F = \Set{S_i}$ is a graph $G = \Omega(F) = \Pair{V,E}$ such that each vertex $v_i \in V$ denotes the set~$S_i$, \ie $V = F$, and the two vertices $v_i$ and~$v_j$ are adjacent whenever the corresponding sets $S_i$ and~$S_j$ have a non-empty intersection, \ie $E = \Set{ \Pair{v_i,v_j} \given i \neq j, S_i \intersection S_j \neq \emptyset }$.
\item \textbf{Line graph}\Href{https://en.wikipedia.org/wiki/Line_graph} of a graph $G = \Pair{V,E}$ is another graph $L(G) = \Omega(E)$ that represents the adjacencies between edges of~$G$. Each vertex of~$L(G)$ represents an edge of~$G$, and two vertices of~$L(G)$ are adjacent iff the corresponding edges share a common endpoint in~$G$ (\ie edges are \enquote{adjacent}/\enquote{incident}).
\begin{minipage}{\linewidth}
\setlength{\intextsep}{0pt}%
% \setlength{\columnsep}{0pt}%
\begin{wrapfigure}{r}{0pt}
\setlength{\tabcolsep}{4pt}%
\NiceMatrixOptions{
notes/style = \arabic{#1},
notes/code-before = \footnotesize \color{gray} \RaggedRight,
}
\begin{NiceTabular}{ cccl }
% Note: "If a command \tabularnote{...} is exactly at the end of a cell (with no space at all after), the label of the note is composed in an overlapping position (towards the right)."
\toprule \RowStyle{\bfseries}
Term & V\tabularnote{Can vertices be repeated?}& E\tabularnote{Can edges be repeated?}& \enquote{Closed} term \\
\midrule
Walk & $+$ & $+$ & Closed walk \\
Trail & $+$ & $-$ & Circuit \\
Path & $-$ & $-$ & Cycle \\
& $-$ & $+$ & (\emph{impossible}) \\
\bottomrule
\end{NiceTabular}
\end{wrapfigure}
\item \textbf{Walk}\Href{https://en.wikipedia.org/wiki/Path_(graph_theory)\#Walk,_trail,_and_path} is an alternating sequence of vertices and edges: $l = v_{1} e_{1} v_{2} \dots e_{n-1} v_{n}$.
\begin{terms}
\item \textbf{Trail} is a walk with distinct edges.
\item \textbf{Path} is a walk with distinct vertices (and therefore distinct edges).
\item A walk is \textbf{closed} if it starts and ends at the same vertex. Otherwise, it is \textbf{open}.
\item \textbf{Circuit} is a closed trail.
\item \textbf{Cycle} is a closed path.
\end{terms}
\end{minipage}
\item \textbf{Length} of a path (walk, trail) $l = u \rightsquigarrow v$ is the number of edges in it: $\card{l} = \card{E(l)}$.
\item \textbf{Girth}\Href{https://en.wikipedia.org/wiki/Girth_(graph_theory)} is the length of the shortest cycle in the graph.
\begin{minipage}{\linewidth}
\setlength{\intextsep}{0pt}%
\setlength{\columnsep}{0pt}%
\begin{wrapfigure}{r}{0pt}
\colorlet{mygreen}{green!60!black}%
\setlength{\tabcolsep}{8pt}%
\begin{tabular}{@{} cc @{}}
\tikz[baseline, on grid]{
\node[dot] (a) {};
% Center
\node[fit=(a), draw=blue, fill=blue, fill opacity=0.1, inner xsep=4pt, inner ysep=4pt, yshift=2pt] (center) {};
\node[text=blue] at (0,.5) {Center};
% Centroid
\node[fit=(a), draw=mygreen, fill=green, fill opacity=0.1, inner xsep=8pt, inner ysep=4pt, yshift=-2pt] (centroid) {};
\node[text=mygreen] at (0,-.5) {Centroid};
} &
\tikz[baseline, on grid]{
\node[dot] (a) {};
\node[dot] (b) [right=.5 of a] {};
\node[dot] (c) [right=.5 of b] {};
\node[dot] (d) [position=140:.5 from a] {};
\node[dot] (e) [position=-140:.5 from a] {};
\draw (a) -- (b) -- (c);
\draw (a) edge (d) edge (e);
% Center
\node[fit=(a)(b), draw=blue, fill=blue, fill opacity=0.1, inner xsep=4pt, inner ysep=4pt, yshift=2pt] (center) {};
\node[text=blue] at (.25,.5) {Center};
% Centroid
\node[fit=(a), draw=mygreen, fill=green, fill opacity=0.1, inner xsep=6pt, inner ysep=4pt, xshift=-1pt, yshift=-2pt] (centroid) {};
\node[text=mygreen] at (.3,-.5) {Centroid};
} \\
\tikz[baseline, on grid]{
\node[dot] (a) {};
\node[dot] (b) [right=.5 of a] {};
\node[dot] (c) [right=.5 of b] {};
\node[dot] (d) [right=.5 of c] {};
\node[dot] (e) [position=40:.5 from d] {};
\node[dot] (f) [position=-40:.5 from d] {};
\draw (a) -- (b) -- (c) -- (d);
\draw (d) edge (e) edge (f);
% Center
\node[fit=(c), draw=blue, fill=blue, fill opacity=0.1, inner xsep=4pt, inner ysep=4pt, yshift=2pt] (center) {};
\node[text=blue] at (1,.5) {Center};
% Centroid
\node[fit=(c)(d), draw=mygreen, fill=green, fill opacity=0.1, inner xsep=6pt, inner ysep=4pt, xshift=-1pt, yshift=-2pt] (centroid) {};
\node[text=mygreen] at (1,-.5) {Centroid};
} &
\tikz[baseline, on grid]{
\node[dot] (a) {};
\node[dot] (b) [right=.5 of a] {};
\draw (a) -- (b);
% Center
\node[fit=(a)(b), draw=blue, fill=blue, fill opacity=0.1, inner xsep=4pt, inner ysep=4pt, yshift=2pt] (center) {};
\node[text=blue] at (.25,.5) {Center};
% Centroid
\node[fit=(a)(b), draw=mygreen, fill=green, fill opacity=0.1, inner xsep=8pt, inner ysep=4pt, yshift=-2pt] (centroid) {};
\node[text=mygreen] at (.25,-.5) {Centroid};
} \\
\end{tabular}
\end{wrapfigure}
\item \textbf{Distance}\Href{https://en.wikipedia.org/wiki/Distance_(graph_theory)} $\dist{u,v}$ between two vertices is the length of the shortest path $u \rightsquigarrow v$.
\end{minipage}
\begin{terms}
\item $\eccentricity{v} = \max\limits_{u \in V} \dist{v,u}$ is the \textbf{eccentricity} of the vertex $v$.
\item $\graphRadius{G} = \min\limits_{v \in V} \eccentricity{v}$ is the \textbf{radius} of the graph $G$.
\item $\graphDiameter{G} = \max\limits_{v \in V} \eccentricity{v}$ is the \textbf{diameter} of the graph $G$.
\item $\graphCenter{G} = \Set{v \given \eccentricity{v} = \graphRadius{G}}$ is the \textbf{center} of the graph $G$.
\end{terms}
\item \textbf{Clique}\Href{https://en.wikipedia.org/wiki/Clique_(graph_theory)} $Q \subseteq V$ is a set of vertices inducing a complete subgraph.
\item \textbf{Stable set}\Href{https://en.wikipedia.org/wiki/Independent_set_(graph_theory)} $S \subseteq V$ is a set of independent (pairwise non-adjacent) vertices.
\medskip
\begin{tikzpicture}[
baseline,
on grid,
stable/.style={
dot,
minimum size=11pt,
fill=mygreen,
fill opacity=0.2,
% label={center:\scriptsize\faCat}
label={center:\scriptsize\faBiohazard}
},
notstable/.style={stable,fill=myred},
]
\def\Radius{0.5}
\def\HGap{2.5cm}
\def\LabelYShift{-4pt}
\begin{scope}
\node[notstable] (v1) at (0:\Radius) {};
\node[notstable] (v2) at (60:\Radius) {};
\node[dot] (v3) at (120:\Radius) {};
\node[dot] (v4) at (180:\Radius) {};
\node[notstable] (v5) at (240:\Radius) {};
\node[dot] (v6) at (300:\Radius) {};
\node[dot] (v7) [left=\Radius of v3] {};
\draw[-] (v1) -- (v2) -- (v3) -- (v4) -- (v5) -- (v6) -- (v1) (v3) -- (v7);
\node[below,align=center] at (0,-\Radius) [yshift=\LabelYShift] {\textcolor{myred}{\textbf{not stable set}}};
\end{scope}
\begin{scope}[xshift=\HGap]
\node[stable] (v1) at (0:\Radius) {};
\node[dot] (v2) at (60:\Radius) {};
\node[dot] (v3) at (120:\Radius) {};
\node[stable] (v4) at (180:\Radius) {};
\node[dot] (v5) at (240:\Radius) {};
\node[dot] (v6) at (300:\Radius) {};
\node[dot] (v7) [left=\Radius of v3] {};
\draw[-] (v1) -- (v2) -- (v3) -- (v4) -- (v5) -- (v6) -- (v1) (v3) -- (v7);
\node[below,align=center] at (0,-\Radius) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{stable set}} \\ \textcolor{myred}{not maximal} \\ \textcolor{myred}{not maximum}};
\end{scope}
\begin{scope}[xshift=\HGap*2]
\node[stable] (v1) at (0:\Radius) {};
\node[dot] (v2) at (60:\Radius) {};
\node[stable] (v3) at (120:\Radius) {};
\node[dot] (v4) at (180:\Radius) {};
\node[stable] (v5) at (240:\Radius) {};
\node[dot] (v6) at (300:\Radius) {};
\node[dot] (v7) [left=\Radius of v3] {};
\draw[-] (v1) -- (v2) -- (v3) -- (v4) -- (v5) -- (v6) -- (v1) (v3) -- (v7);
\node[below,align=center] at (0,-\Radius) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{stable set}} \\ \textcolor{mygreen}{maximal} \\ \textcolor{myred}{not maximum}};
\end{scope}
\begin{scope}[xshift=\HGap*3]
\node[dot] (v1) at (0:\Radius) {};
\node[stable] (v2) at (60:\Radius) {};
\node[dot] (v3) at (120:\Radius) {};
\node[stable] (v4) at (180:\Radius) {};
\node[dot] (v5) at (240:\Radius) {};
\node[stable] (v6) at (300:\Radius) {};
\node[stable] (v7) [left=\Radius of v3] {};
\draw[-] (v1) -- (v2) -- (v3) -- (v4) -- (v5) -- (v6) -- (v1) (v3) -- (v7);
\node[below,align=center] at (0,-\Radius) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{stable set}} \\ \textcolor{mygreen}{maximal} \\ \textcolor{mygreen}{maximum}};
\end{scope}
\end{tikzpicture}
\item \textbf{Matching}\Href{https://en.wikipedia.org/wiki/Matching_(graph_theory)} $M \subseteq E$ is a set of independent (pairwise non-adjacent) edges.
\medskip
\begin{tikzpicture}[
baseline,
on grid,
matching/.style={mygreen,draw opacity=0.7,line width=3pt},
notmatching/.style={matching,myred},
]
\def\Side{0.6}
\def\HGap{2.5cm}
\def\LabelX{1.5*\Side}
\def\LabelY{0}
\def\LabelYShift{-4pt}
\begin{scope}
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (2*\Side,0) {};
\node[dot] (v4) at (3*\Side,0) {};
\node[dot] (v5) at (0.5*\Side,\Side) {};
\node[dot] (v6) at (1.5*\Side,\Side) {};
\draw (v1) -- (v2);
\draw[notmatching] (v1) -- (v5);
\draw[notmatching] (v2) -- (v3);
\draw[notmatching] (v2) -- (v6);
\draw (v3) -- (v4);
\draw[notmatching] (v3) -- (v6);
\draw (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{myred}{\textbf{not matching}}};
\end{scope}
\begin{scope}[xshift=1*\HGap]
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (2*\Side,0) {};
\node[dot] (v4) at (3*\Side,0) {};
\node[dot] (v5) at (0.5*\Side,\Side) {};
\node[dot] (v6) at (1.5*\Side,\Side) {};
\draw[matching] (v1) -- (v2);
\draw (v1) -- (v5);
\draw (v2) -- (v3);
\draw (v2) -- (v6);
\draw (v3) -- (v4);
\draw (v3) -- (v6);
\draw (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{matching}} \\ \textcolor{myred}{not maximal} \\ \textcolor{myred}{not maximum}};
\end{scope}
\begin{scope}[xshift=2*\HGap]
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (2*\Side,0) {};
\node[dot] (v4) at (3*\Side,0) {};
\node[dot] (v5) at (0.5*\Side,\Side) {};
\node[dot] (v6) at (1.5*\Side,\Side) {};
\draw (v1) -- (v2);
\draw (v1) -- (v5);
\draw[matching] (v2) -- (v3);
\draw (v2) -- (v6);
\draw (v3) -- (v4);
\draw (v3) -- (v6);
\draw[matching] (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{matching}} \\ \textcolor{mygreen}{maximal} \\ \textcolor{myred}{not maximum}};
\end{scope}
\begin{scope}[xshift=3*\HGap]
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (2*\Side,0) {};
\node[dot] (v4) at (3*\Side,0) {};
\node[dot] (v5) at (0.5*\Side,\Side) {};
\node[dot] (v6) at (1.5*\Side,\Side) {};
\draw (v1) -- (v2);
\draw[matching] (v1) -- (v5);
\draw (v2) -- (v3);
\draw[matching] (v2) -- (v6);
\draw[matching] (v3) -- (v4);
\draw (v3) -- (v6);
\draw (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{matching}} \\ \textcolor{mygreen}{maximal} \\ \textcolor{mygreen}{maximum}};
\end{scope}
\end{tikzpicture}
\item \textbf{Perfect matching}\Href{https://en.wikipedia.org/wiki/Perfect_matching} is a matching that covers all vertices in the graph.
\begin{terms}
\item A perfect matching (if it exists) is always a minimum edge cover (\emph{but not vice-versa!}).
\end{terms}
\item \textbf{Vertex cover}\Href{https://en.wikipedia.org/wiki/Vertex_cover} $R \subseteq V$ is a set of vertices \enquote{covering} all edges.
\medskip
\begin{tikzpicture}[
baseline,
on grid,
cover/.style={
dot,
minimum size=11pt,
fill=mygreen,
fill opacity=0.2,
label={center:\scriptsize\faEye[regular]}
},
notcover/.style={cover,fill=myred},
notcovered/.style={myred,draw opacity=0.5,line width=2pt},
]
\def\Side{0.8}
\def\HGap{2.5cm}
\def\LabelX{\Side}
\def\LabelY{0}
\def\LabelYShift{-6pt}
\begin{scope}
\node[dot] (v1) at (0,0) {};
\node[notcover] (v2) at (\Side,0) {};
\node[dot] (v3) at (2*\Side,0) {};
\node[notcover] (v4) at (0,\Side) {};
\node[dot] (v5) at (\Side,\Side) {};
\node[notcover] (v6) at (2*\Side,\Side) {};
\draw (v1) -- (v4);
\draw[notcovered] (v1) -- (v5);
\draw (v2) -- (v5);
\draw[notcovered] (v3) -- (v5);
\draw (v4) -- (v5);
\draw (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{myred}{\textbf{not vertex cover}}};
\end{scope}
\begin{scope}[xshift=1*\HGap]
\node[cover] (v1) at (0,0) {};
\node[cover] (v2) at (\Side,0) {};
\node[dot] (v3) at (2*\Side,0) {};
\node[dot] (v4) at (0,\Side) {};
\node[cover] (v5) at (\Side,\Side) {};
\node[cover] (v6) at (2*\Side,\Side) {};
\draw (v1) -- (v4);
\draw (v1) -- (v5);
\draw (v2) -- (v5);
\draw (v3) -- (v5);
\draw (v4) -- (v5);
\draw (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{vertex cover}} \\ \textcolor{myred}{not minimal} \\ \textcolor{myred}{not minimum}};
\end{scope}
\begin{scope}[xshift=2*\HGap]
\node[cover] (v1) at (0,0) {};
\node[cover] (v2) at (\Side,0) {};
\node[cover] (v3) at (2*\Side,0) {};
\node[cover] (v4) at (0,\Side) {};
\node[dot] (v5) at (\Side,\Side) {};
\node[cover] (v6) at (2*\Side,\Side) {};
\draw (v1) -- (v4);
\draw (v1) -- (v5);
\draw (v2) -- (v5);
\draw (v3) -- (v5);
\draw (v4) -- (v5);
\draw (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{vertex cover}} \\ \textcolor{mygreen}{minimal} \\ \textcolor{myred}{not minimum}};
\end{scope}
\begin{scope}[xshift=3*\HGap]
\node[cover] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (2*\Side,0) {};
\node[dot] (v4) at (0,\Side) {};
\node[cover] (v5) at (\Side,\Side) {};
\node[dot] (v6) at (2*\Side,\Side) {};
\draw (v1) -- (v4);
\draw (v1) -- (v5);
\draw (v2) -- (v5);
\draw (v3) -- (v5);
\draw (v4) -- (v5);
\draw (v5) -- (v6);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{vertex cover}} \\ \textcolor{mygreen}{minimal} \\ \textcolor{mygreen}{minimum}};
\end{scope}
\end{tikzpicture}
\item \textbf{Edge cover}\Href{https://en.wikipedia.org/wiki/Edge_cover} $F \subseteq E$ is a set of edges \enquote{covering} all vertices.
\medskip
\begin{tikzpicture}[
baseline,
on grid,
cover/.style={mygreen,draw opacity=0.7,line width=3pt},
notcover/.style={cover,myred},
]
\def\Side{0.6}
\def\HGap{2.5cm}
\def\LabelX{0.5*\Side}
\def\LabelY{0}
\def\LabelYShift{-4pt}
\begin{scope}
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (0,\Side) {};
\node[dot] (v4) at (\Side,\Side) {};
\node[dot] (v5) at (2*\Side,\Side) {};
\node[dot] (v6) at (150:\Side) {};
\draw (v1) -- (v2);
\draw[notcover] (v1) -- (v3);
\draw (v1) -- (v6);
\draw[notcover] (v2) -- (v4);
\draw (v3) -- (v4);
\draw (v3) -- (v6);
\draw (v4) -- (v5);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{myred}{\textbf{not edge cover}}};
\end{scope}
\begin{scope}[xshift=1*\HGap]
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (0,\Side) {};
\node[dot] (v4) at (\Side,\Side) {};
\node[dot] (v5) at (2*\Side,\Side) {};
\node[dot] (v6) at (150:\Side) {};
\draw[cover] (v1) -- (v2);
\draw (v1) -- (v3);
\draw (v1) -- (v6);
\draw[cover] (v2) -- (v4);
\draw (v3) -- (v4);
\draw[cover] (v3) -- (v6);
\draw[cover] (v4) -- (v5);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{edge cover}} \\ \textcolor{myred}{not minimal} \\ \textcolor{myred}{not minimum}};
\end{scope}
\begin{scope}[xshift=2*\HGap]
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (0,\Side) {};
\node[dot] (v4) at (\Side,\Side) {};
\node[dot] (v5) at (2*\Side,\Side) {};
\node[dot] (v6) at (150:\Side) {};
\draw (v1) -- (v2);
\draw[cover] (v1) -- (v3);
\draw (v1) -- (v6);
\draw[cover] (v2) -- (v4);
\draw (v3) -- (v4);
\draw[cover] (v3) -- (v6);
\draw[cover] (v4) -- (v5);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{edge cover}} \\ \textcolor{mygreen}{minimal} \\ \textcolor{myred}{not minimum}};
\end{scope}
\begin{scope}[xshift=3*\HGap]
\node[dot] (v1) at (0,0) {};
\node[dot] (v2) at (\Side,0) {};
\node[dot] (v3) at (0,\Side) {};
\node[dot] (v4) at (\Side,\Side) {};
\node[dot] (v5) at (2*\Side,\Side) {};
\node[dot] (v6) at (150:\Side) {};
\draw[cover] (v1) -- (v2);
\draw (v1) -- (v3);
\draw (v1) -- (v6);
\draw (v2) -- (v4);
\draw (v3) -- (v4);
\draw[cover] (v3) -- (v6);
\draw[cover] (v4) -- (v5);
\node[below,align=center] at (\LabelX,\LabelY) [yshift=\LabelYShift] {\textcolor{mygreen}{\textbf{edge cover}} \\ \textcolor{mygreen}{minimal} \\ \textcolor{mygreen}{minimum}};
\end{scope}
\end{tikzpicture}
\newpage
% TODO: section
\item \textbf{Cut vertex} (\textbf{articulation point})\Href{https://mathworld.wolfram.com/ArticulationVertex.html} is a vertex whose removal increases the number of connected components.
\item \textbf{Bridge}\Href{https://en.wikipedia.org/wiki/Bridge_(graph_theory)} is an edge whose removal increases the number of connected components.
\item \textbf{Biconnected graph}\Href{https://en.wikipedia.org/wiki/Biconnected_graph} is a connected \enquote{nonseparable} graph, which means that the removal of any vertex does not make the graph disconnected. Alternatively, this is a graph without \emph{cut vertices}.
\item \textbf{Biconnectivity} can be defined as a relation on edges $R \subseteq E^2$:
\begin{terms}
\item Two edges are called \emph{biconnected} if there exist two \emph{vertex-disjoint} paths between the ends of these edges.
\item Trivially, this relation is an equivalence relation.
\item Equivalence classes of this relation are called \textbf{biconnected components}\Href{https://en.wikipedia.org/wiki/Biconnected_component}, also known as \textbf{blocks}.
\end{terms}
\item \textbf{Edge biconnectivity} can be defined as a relation on vertices $R \subseteq V^2$:
\begin{terms}
\item Two vertices are called \emph{edge-biconnected} if there exist two \emph{edge-disjoint} paths between them.
\item Trivially, this relation is an equivalence relation.
\item Equivalence classes of this relation are called \textbf{edge-biconnected components} (or \emph{2-edge-connected components}).
\end{terms}
\item \textbf{Vertex connectivity}\Href{https://en.wikipedia.org/wiki/Vertex_connectivity} $\vertexConnectivity{G}$ is the minimum number of vertices that has to be removed in order to make the graph disconnected or trivial (singleton).
Equivalently, it is the largest~$k$ for which the graph~$G$ is $k$-vertex-connected.
\item \textbf{$k$-vertex-connected graph}\Href{https://en.wikipedia.org/wiki/K-vertex-connected_graph} is a graph that remains connected after less than $k$ vertices are removed, \ie $\vertexConnectivity{G} \geq k$.
\begin{terms}
\item Corollary of Menger's theorem: graph $G = \Pair{V,E}$ is $k$-vertex-connected if, for every pair of vertices $u,v \in V$, it is possible to find $k$ \emph{vertex-independent} (\emph{internally vertex-disjoint}) paths between $u$ and~$v$.
\item $k$-vertex-connected graphs are also called simply \emph{$k$-connected}.
\item 1-connected graphs are called \emph{connected}, 2-connected are \emph{biconnected}, 3-connected are \emph{triconnected}, \textit{etc}.
\item Note the \enquote{exceptions}:
\begin{terms}
\item Singleton graph $K_1$ has $\vertexConnectivity{K_1} = 0$, so it is \textbf{not} \emph{1-connected}, but still considered \emph{connected}.
\item Graph $K_2$ has $\vertexConnectivity{K_2} = 1$, so it is \textbf{not} \emph{2-connected}, but considered \emph{biconnected}, so it can be a block.
% TODO: what about K_3? Is it considered triconnected?
\end{terms}
\end{terms}
\item \textbf{Edge connectivity}\Href{https://en.wikipedia.org/wiki/Edge_connectivity} $\edgeConnectivity{G}$ is the minimum number of edges that has to be removed in order to make the graph disconnected or trivial (singleton).
Equivalently, it is the largest~$k$ for which the graph~$G$ is $k$-edge-connected.
\item \textbf{$k$-edge-connected graph}\Href{https://en.wikipedia.org/wiki/K-edge-connected_graph} is a graph that remains connected after less than $k$ edges are removed, \ie $\edgeConnectivity{G} \geq k$.
\begin{terms}
\item Corollary of Menger's theorem: graph $G = \Pair{V,E}$ is $k$-edge-connected if, for every pair of vertices $u,v \in V$, it is possible to find $k$ \emph{edge-disjoint} paths between $u$ and~$v$.
\item 2-edge-connected are called \emph{edge-biconnected}, 3-edge-connected are \emph{edge-triconnected}, \textit{etc}.
\item Note the \enquote{exception}:
\begin{terms}
\item Singleton graph $K_1$ has $\edgeConnectivity{K_1} = 0$, so it is \textbf{not} \emph{2-edge-connected}, but considered \emph{edge-biconnected}, so it can be a \emph{2-edge-connected component}.
\end{terms}
\end{terms}
\begin{minipage}{\linewidth}
\setlength{\intextsep}{0pt}%
% \setlength{\columnsep}{0pt}%
\begin{wrapfigure}{r}{0pt}
\tikz[]{
\coordinate (origin);
\node[dot] (a1) [position=36:.5 from origin] {};
\node[dot] (a2) [position=-36:.5 from origin] {};
\node[dot] (a3) [position=108:.5 from origin] {};
\node[dot] (a4) [position=-108:.5 from origin] {};
\node[dot] (a5) [position=180:.5 from origin] {};
\node[dot] (x1) [right=.8 of a1] {};
\node[dot] (x2) [right=.8 of a2] {};
\node[dot] (x3) [right=.5 of x1] {};
\node[dot] (x4) [right=.5 of x2] {};
\draw (a1) edge (a3) edge (a4) edge (a5)
-- (a2) edge (a4) edge (a5)
-- (a3) edge (a5)
-- (a4)
-- (a5)
-- cycle;
\draw (x1) edge (x3) edge (x4)
-- (x2) edge (x4)
-- (x3)
-- (x4)
-- cycle;
\draw (a1) edge (x1);
\draw (a2) edge (x1) edge (x2);
\node[below] at (current bounding box.south) {$\vertexConnectivity{G} = 2$, $\edgeConnectivity{G} = 3$, \\ $\minDegree{G} = 3$, $\maxDegree{G} = 6$};
}
\end{wrapfigure}
\vspace{2pt}
\item \textsc{Whitney's theorem}. For any graph $G$, $\vertexConnectivity{G} \leq \edgeConnectivity{G} \leq \minDegree{G}$.
\end{minipage}
% \begin{tabular}{ccc}
% \thead{Graph} & \thead{Vertex} & \thead{Edge} \\
% \begin{tikzpicture}
% \node[dot, label=below:$v_1$] {};
% \end{tikzpicture}
% \end{tabular}
\newpage
% TODO: section
\item \textbf{Tree}\Href{https://en.wikipedia.org/wiki/Tree_(graph_theory)} is a connected undirected acyclic graph.
\item \textbf{Forest}\Href{https://en.wikipedia.org/wiki/Tree_(graph_theory)\#Forest} is an undirected acyclic graph, \ie a disjoint union of trees.
\item An \textbf{unrooted tree} (\textbf{free tree}) is a tree without any designated \emph{root}.
\item A \textbf{rooted tree} is a tree in which one vertex has been designated the \emph{root}.
\begin{terms}
\item In a rooted tree, the \textbf{parent} of a vertex $v$ is the vertex connected to $v$ on the path to the root.
\item A \textbf{child} of a vertex $v$ is a vertex of which $v$ is the parent.
\item A \textbf{sibling} to a vertex $v$ is any other vertex on the tree which has the same parent as $v$.
% \item An \textbf{ascendant} of a vertex $v$ is any vertex which is either the parent of $v$ or is (recursively) the ascendant of the parent of $v$.
% \item A \textbf{descendant} of a vertex $v$ is any vertex which is either the child of $v$ or is (recursively) the descendant of any of the children of $v$.
\item A \textbf{leaf} is a vertex with no children. Equivalently, \textbf{leaf} is a \emph{pendant vertex}, \ie $\degree{v} = 1$.
\item An \textbf{internal vertex} is a vertex that is not a leaf.
\item A \textbf{$k$-ary tree} is a rooted tree in which each vertex has at most $k$ children. \emph{2-ary trees} are called \textbf{binary trees}.
\end{terms}
\item A \textbf{labeled tree}\Href{https://en.wikipedia.org/wiki/Labeled_tree} is a tree in which each vertex is given a unique \emph{label}, \eg $1, 2, \dotsc, n$.
\item \textsc{Cayley's formula}\Href{https://en.wikipedia.org/wiki/Cayley's_formula}. Number of labeled trees on $n$ vertices is $n^{n-2}$.
% Group for Prufer code definition
\begingroup
\colorlet{color-min}{red}
\colorlet{color-parent}{blue}
\colorlet{color-removed}{lightgray}
\colorlet{color-last}{green!70!black}
\item \textbf{Pr\"{u}fer code}\Href{https://en.wikipedia.org/wiki/Prufer_sequence} is a unique sequence of labels $\Set{1,\dotsc,n}$ of length $(n-2)$ associated with the labeled tree on $n$ vertices.
\begin{terms}
\item \textbf{\textsc{Encoding}} (iterative algorithm for converting tree $T$ labeled with $\Set{1,\dotsc,n}$ into a Pr\"{u}fer sequence $K$):
\begin{terms}
\item On each iteration, remove the leaf with \textcolor{color-min}{\emph{the smallest label}}, and extend $K$ with \textcolor{color-parent}{\emph{a single neighbour}} of this leaf.
\item After $(n-2)$ iterations, the tree will be left with \textcolor{color-last}{\emph{two adjacent}} vertices \--- there is no need to encode them, because there is only one unique tree on 2 vertices, which requires 0 bits of information to encode.
\end{terms}
% Group for Prufer code pictures
\begingroup
\def\Dist{.5}
\def\LabelY{-0.9}
\tikzstyle{prufer}=[
dot-removed/.style={dot,color-removed},
dot-parent/.style={dot,color-parent},
dot-min/.style={dot,color-min},
dot-last/.style={dot,color-last},
edge-removed/.style={color-removed,dashed},
edge-min/.style={color-min,very thick},
edge-last/.style={color-last,very thick},
]
\tikz[baseline,prufer]{
\node[dot] (2) [label={2}] {};
\node[dot] (3) [label={3}, position=30:{\Dist} from 2] {};
\node[dot] (7) [label={7}, position=-60:{\Dist} from 2] {};
\node[dot] (6) [label={6}, position=-60:{\Dist} from 3] {};
\node[dot] (5) [label={5}, position=-120:{\Dist} from 2] {};
\node[dot] (1) [label={1}, position=180:{\Dist} from 5] {};
\node[dot] (4) [label={4}, position=120:{\Dist} from 5] {};
\draw (1) -- (5);
\draw (4) -- (5);
\draw (5) -- (2);
\draw (2) -- (7);
\draw (2) -- (3);
\draw (3) -- (6);
\node at (0,\LabelY) {$K = \emptyset$};
}%
\hfill%
\tikz[baseline,prufer]{
\node[dot] (2) [label={2}] {};
\node[dot] (3) [label={3}, position=30:{\Dist} from 2] {};
\node[dot] (7) [label={7}, position=-60:{\Dist} from 2] {};
\node[dot] (6) [label={6}, position=-60:{\Dist} from 3] {};
\node[dot-parent] (5) [label={[text=color-parent]5}, position=-120:{\Dist} from 2] {};
\node[dot-min] (1) [label={[text=color-min]1}, position=180:{\Dist} from 5] {};
\node[dot] (4) [label={4}, position=120:{\Dist} from 5] {};
\draw[edge-min] (1) -- (5);
\draw (4) -- (5);
\draw (5) -- (2);
\draw (2) -- (7);
\draw (2) -- (3);
\draw (3) -- (6);
\node at (0,\LabelY) {$K = \mathcolor{blue}{5}$};
}%
\hfill%
\tikz[baseline,prufer]{
\node[dot] (2) [label={2}] {};
\node[dot] (3) [label={3}, position=30:{\Dist} from 2] {};
\node[dot] (7) [label={7}, position=-60:{\Dist} from 2] {};
\node[dot] (6) [label={6}, position=-60:{\Dist} from 3] {};
\node[dot-parent] (5) [label={[text=color-parent]5}, position=-120:{\Dist} from 2] {};
\node[dot-removed] (1) [label={[text=color-removed]1}, position=180:{\Dist} from 5] {};
\node[dot-min] (4) [label={[text=color-min]4}, position=120:{\Dist} from 5] {};
\draw[edge-removed] (1) -- (5);
\draw[edge-min] (4) -- (5);