docs: def _iterbfs(self, start, end=None, forward=True):
          """
          The forward parameter specifies whether it is a forward or backward
          traversal.  Returns a list of tuples where the first value is the hop
          value the second value is the node id.
          """
          queue, visited = deque([(start, 0)]), set([start])
  
          # the direction of the bfs depends on the edges that are sampled
          if forward:
              get_edges = self.out_edges
              get_next = self.tail
          else:
              get_edges = self.inc_edges
              get_next = self.head
  
          while queue:
              curr_node, curr_step = queue.popleft()
              yield (curr_node, curr_step)
              if curr_node == end:
                  break
              for edge in get_edges(curr_node):
                  tail = get_next(edge)
                  if tail not in visited:
                      visited.add(tail)
                      queue.append((tail, curr_step + 1))