trace_edges: saving parents during edge traversal.