ENH: traverse only --first-parent portion of the graph. See comments in the code