Division - Fraction: \frac{}{}
Greater or equal: \geq
Smaller or equal: \leq
Comment on Algorithm algorithm2e package
\usepackage[ruled, linesnumbered]{algorithm2e}
\tcp*{There is a cycle}
Unweighted Graph Example with tikz
\usepackage{tikz}
\begin{figure}[H]
\centering
\begin{tikzpicture}
[scale=.8,auto=left,every node/.style={circle,fill=blue!20}]
\node (s) at (1,5) {s};
\node (n3) at (4,8) {3};
\node (n4) at (8,9) {4};
\node (t) at (11,8) {t};
\node (n2) at (9,6) {2};
\node (n1) at (5,5) {1};
\foreach \from/\to in {s/n3,n3/n4,n2/n4,n2/t, n1/n3, n1/n4, s/n1}
\draw (\from) -- (\to);
\end{tikzpicture}
\caption{Example Flight Network Graph}
\label{fig:graph}
\end{figure}
Weighted Graph Example with tikz
\begin{figure}[H]
\centering
\begin{tikzpicture}
[scale=.8,auto=left,every node/.style={circle,fill=blue!20}]
\node (a) at (1,5) {a};
\node (b) at (1,9) {b};
\node (c) at (5,9) {c};
\node (d) at (5,5) {d};
\foreach \from/\to/\lbl in {a/b/1, b/c/4, c/d/3, b/d/3, a/d/5, a/c/2}
\draw (\from) -- node[midway,fill=none] {\lbl} (\to);
\end{tikzpicture}
\caption{Graph A}
\label{fig:graph}
\end{figure}
\begin{align}
f(n) &= \frac{(n-1)n(n+1)}{2}\\
&= \frac{(n^3-n))}{2}\\
&= \frac{1}{2}n^3 - \frac{1}{2}n \label{eq:3}
\end{align}
\usepackage{mathtools}
\[
f(x)=
\begin{dcases}
\frac{x^2-x}{x},& \text{if } x\geq 1\\
0, & \text{otherwise}
\end{dcases}
\]