  We present a family of graphical representations for the O($N$) spin model,
where $N \ge 1$ represents the spin dimension, and $N=1,2,3$ corresponds to the
Ising, XY and Heisenberg models, respectively. With an integer parameter $0 \le
\ell \le N/2$, each configuration is the coupling of $\ell$ copies of subgraphs
consisting of directed flows and $N -2\ell$ copies of subgraphs constructed by
undirected loops, which we call the XY and Ising subgraphs, respectively. On
each lattice site, the XY subgraphs satisfy the Kirchhoff flow-conservation law
and the Ising subgraphs obey the Eulerian bond condition. Then, we formulate
worm-type algorithms and simulate the O($N$) model on the simple-cubic lattice
for $N$ from 2 to 6 at all possible $\ell$. It is observed that the worm
algorithm has much higher efficiency than the Metropolis method, and, for a
given $N$, the efficiency is an increasing function of $\ell$. Beside Monte
Carlo simulations, we expect that these graphical representations would provide
a convenient basis for the study of the O($N$) spin model by other
state-of-the-art methods like the tensor network renormalization.
