Graphs & Trees: Intro
% Code for the di-graph for the relation GreaterThan on S on the previous slide:
\documentclass[border=1pt]{standalone}
% The graphics library we use: TikZ
\usepackage{tikz}
% Allow more arrow feature customization:
\usetikzlibrary{arrows.meta}
% Set the styles of the vertices and the edges in the digraph:
\tikzset{vertex/.style={draw, very thick, circle, minimum size=1cm},
edge/.style={very thick, -Triangle}}
% '-Triangle' means that the arrowhead has a shape of a triangle (there are many other arrowhead styles in TikZ - check them out! https://tikz.dev/tikz-arrows#sec-16.5)
\begin{document}
% Finally, here is our digraph:
\begin{tikzpicture}
\node[vertex] (v3) at (0,-2) {3};
\node[vertex] (v2) at (2,0) {2};
\node[vertex] (v4) at (2,-2) {4};
\node[vertex] (v1) at (0,0) {1};
\draw[edge] (v2) -- (v1);
\draw[edge] (v3) -- (v2);
\draw[edge] (v3) -- (v1);
\draw[edge] (v4) -- (v3);
\draw[edge] (v4) -- (v2);
\draw[edge] (v4) -- (v1);
\end{tikzpicture}
\end{document}