post traverse a graph without using recursing