Separation of distinct numbered Blue ball

Solution 1:

For 5 nodes, it easier to visualize on an allowed neighbors graph and count the Hamiltonian paths. Due to symmetry you just need to consider 3 nodes as the starting point.

enter image description here