The Iterator should yield the depth away from the current node along with the reference in a tuple, ordered from the shortest depth to the furthest. Nodes with multiple outputs should not be returned twice so we should keep track of the indices and check for repeats each iteration