I need some examples of MathJax codes of directed labelled (with loops or multiple edges) graphs to use in MathOverflow Questions so that I could easily change them to my graphs.

Here is my try to write such a graph, but I do not know how I can merge these lines to one graph:

$1 \overset{x}{\longrightarrow} 2 \overset{x}{\longrightarrow} 3 \overset{x}{\longrightarrow} 4 \overset{x}{\longrightarrow} 1$

$4 \overset{y}{\longrightarrow} 5 \overset{x}{\longleftarrow} 6 \overset{x}{\longleftarrow} 7 \overset{y}{\longleftarrow} 2 \overset{x}{\longleftarrow} 1 \overset{x}{\longleftarrow} 4$

$2 \overset{y}{\longrightarrow} 8 \overset{y}{\longrightarrow} 9 \overset{x}{\longrightarrow} 10 \overset{y}{\longleftarrow} 11 \overset{y}{\longleftarrow} 3 \overset{x}{\longleftarrow} 2$

$3 \overset{x}{\longrightarrow} 4 \overset{y}{\longrightarrow} 5 \overset{x}{\longleftarrow} 6 \overset{y}{\longrightarrow} 14 \overset{x}{\longleftarrow} 13 \overset{y}{\longrightarrow} 12 \overset{x}{\longrightarrow} 11 \overset{y}{\longleftarrow} 3$