Graph Properties / Features

  1. The degree of a vertex in an undirected graph is the number of edges that are attached to this vertex.

    Note that a loop contributes $2$ to the degree of a vertex because the edge both begins and ends at the same vertex.
    Vertex 1 has degree 2, while vertices 2 and 3 have degree 1.

    Vertex $1$ has the degree of $2$ (since two edges are connected to it), while each of vertices $2$ and $3$ has the degree of $1$. Miriam Briskman, CC BY-NC 4.0.

    \documentclass[border=1pt]{standalone}
    \usepackage{tikz}
    
    \tikzset{
    vertex/.style={draw, circle, very thick, minimum size=1cm},
    edge/.style={very thick}
    }
    
    \begin{document}
    
    \begin{tikzpicture}
    
    \node[vertex] (v1) at (0,0) {$1$};
    \node[vertex] (v2) at (3,0) {$2$};
    \node[vertex] (v3) at (1.5,2) {$3$};
    
    \draw[edge] (v1) -- (v2);
    \draw[edge] (v1) -- (v3);
    
    \end{tikzpicture}
    
    \end{document}

    We denote the degree of a vertex $v$ as $\text{deg}(v)$
    $\text{deg}(v)$
    .