[Math] Does a directed edge on graph going both ways contribute 2 to out-degree and in-degree

graph theory

I understand that a directed edge going one way contributes 1 to the in-degree and 1 to the out-degree. But does a directed edge going both ways like in my image contribute 2 to both the in-degree and out-degree? In my mind each vertex is both an initial degree and a terminal degree? But on the other hand, wouldn't this contradict the Handshaking theorem where the number of degrees must be double the amount of edges in the graph? Going by that, 4 degrees (2 in-degrees and 2 out-degrees) does not double the 1 edge.

enter image description here

Best Answer

An edge in a digraph that is directed both ways is just visual shorthand for two edges, one directed one way and the other, the other way. If the vertices are $u$ and $v$, the edge $u\to v$ contributes $1$ to the out-degree of $u$ and $1$ to the in-degree of $v$, while the edge $u\leftarrow v$ contributes $1$ to the in-degree of $u$ and $1$ to the out-degree of $v$. When you see $u\longleftrightarrow v$, you’re really seeing both of those one-way edges, so this contributes $1$ each to the in-degree of $u$, the out-degree of $u$, the in-degree of $v$, and the out-degree of $v$.