bugfix consider self-loop
refactor test; at least one edge outgo