\(\newcommand{\Set}[1]{\{#1\}}\) \(\newcommand{\Setdef}[2]{\{{#1}\mid{#2}\}}\) \(\newcommand{\PSet}[1]{\mathcal{P}(#1)}\) \(\newcommand{\Card}[1]{{\vert{#1}\vert}}\) \(\newcommand{\Tuple}[1]{(#1)}\) \(\newcommand{\Implies}{\Rightarrow}\) \(\newcommand{\Reals}{\mathbb{R}}\) \(\newcommand{\Seq}[1]{(#1)}\) \(\newcommand{\Length}[1]{{\vert{#1}\vert}}\) \(\newcommand{\Arr}[1]{[#1]}\) \(\newcommand{\Floor}[1]{{\lfloor{#1}\rfloor}}\) \(\newcommand{\Ceil}[1]{{\lceil{#1}\rceil}}\) \(\newcommand{\Path}[1]{(#1)}\) \(\newcommand{\IRange}[2]{[#1\,..\,#2]}\) \(%\newcommand{\Lg}{\lg}\) \(\newcommand{\Lg}{\log_2}\) \(\newcommand{\BigOh}{O}\) \(%\newcommand{\BigOh}{\mathcal{O}}\) \(\newcommand{\Oh}[1]{\BigOh(#1)}\)
\(%\) \(% Graphs\) \(%\) \(\newcommand{\Verts}{V}\) \(\newcommand{\Vtx}{v}\) \(\newcommand{\VtxA}{v_1}\) \(\newcommand{\VtxB}{v_2}\) \(\newcommand{\VertsA}{V_\textup{A}}\) \(\newcommand{\VertsB}{V_\textup{B}}\) \(\newcommand{\Edges}{E}\) \(\newcommand{\Edge}{e}\) \(\newcommand{\NofV}{\Card{V}}\) \(\newcommand{\NofE}{\Card{E}}\) \(\newcommand{\Graph}{G}\) \(\newcommand{\SCC}{C}\) \(\newcommand{\GraphSCC}{G^\text{SCC}}\) \(\newcommand{\VertsSCC}{V^\text{SCC}}\) \(\newcommand{\EdgesSCC}{E^\text{SCC}}\) \(\newcommand{\GraphT}{G^\text{T}}\) \(%\newcommand{\VertsT}{V^\textup{T}}\) \(\newcommand{\EdgesT}{E^\text{T}}\) \(% Search attributes etc\) \(\newcommand{\GColor}[1]{{#1}.\textup{color}}\) \(\newcommand{\GWhite}{\textsf{white}}\) \(\newcommand{\GGray}{\textsf{gray}}\) \(\newcommand{\GBlack}{\textsf{black}}\) \(\newcommand{\GDist}[1]{{#1}.\textup{dist}}\) \(\newcommand{\GPred}[1]{{#1}.\textup{pred}}\) \(\newcommand{\GNil}{\textsf{nil}}\) \(\newcommand{\GTime}{\textit{time}}\) \(\newcommand{\GStart}[1]{{#1}.\textup{start}}\) \(\newcommand{\GFinish}[1]{{#1}.\textup{finish}}\) \(\newcommand{\GraphP}{G_{\textup{pred}}}\) \(\newcommand{\EdgesP}{E_{\textup{pred}}}\)
\(\newcommand{\PseudoCode}[1]{{\color{finnishBlue}\textsf{#1}}}\) \(\newcommand{\Def}{\mathrel{:=}}\) \(\newcommand{\Eq}{\mathrel{=}}\) \(\newcommand{\Asgn}{\mathrel{\leftarrow}}\) \(%\newcommand{\Asgn}{\mathrel{:=}}\) \(\newcommand{\ALengthOf}[1]{{#1}.\textit{length}}\) \(%\) \(% Pseudo code style definitions\) \(%\) \(% Pseudocode style\) \(\lstdefinelanguage{AbbPseudoCode}{\) \(morekeywords={while,if,then,else,continue,%\) \(for,to,let,def,parallel,spawn,sync,return},\) \(%otherkeywords={=>,<-,<\%,<:,>:,\#,@},\) \(sensitive=true,\) \(literate={~}{\texttildelow}{1} {^}{{\char"005E}}{1} {-}{-}{1} {\ \ }{{\hspace{2mm}}}1,\) \(morecomment=[l]{//},\) \(morecomment=[n]{/*}{*/},\) \(morestring=[b]",\) \(morestring=[b]',\) \(morestring=[b]"""\) \(}\) \(\newcommand\AbbPseudoStylePlain{\lstset{\) \(numbers=left,\) \(numberstyle=\tiny,\) \(numbersep=1pt,\) \(stepnumber=1,\) \(language=AbbPseudoCode,\) \(aboveskip=0pt,\) \(belowskip=0pt,\) \(showspaces=false,\) \(basicstyle=\sf\footnotesize,\) \(%basicstyle=\sf\scriptsize,\) \(%numberstyle=\footnotesize,\) \(commentstyle=\color{AbbCommentColor},%\footnotesize,\) \(otherkeywords={self}, % Add keywords here\) \(keywordstyle=\color{AbbKeywordColor}\bf,%\sf\footnotesize\) \(emph={MyClass,__init__}, % Custom highlighting\) \(emphstyle=\color{AbbEmphColor}, %\ttb\footnotesize % Custom highlighting style\) \(stringstyle=\color{AbbStringColor},\) \(showstringspaces=false,\) \(keepspaces=true,\) \(columns=fullflexible,\) \(}}\) \(%\) \(% Include pseudocode from a file\) \(%\) \(\newcommand\AbbPseudoCodeExt[1]{\AbbCodeExt[mathescape]{\AbbPseudoStylePlain}{#1}}\) \(\newcommand\AbbPseudoCodeExtAttach[2]{\AbbCodeExtAttach[mathescape]{\AbbPseudoStylePlain}{#1}{#2}}\)