Node Counting Algorithm

Run

(canvas)