def bfs():
    lv = {src: 0}
    q = deque([src])
    while q:
        u = q.popleft()
        for (v, e) in self.edges[u].items():
            if ((e['capacity'] == 0) or (v in lv)):
                continue
            lv[v] = (lv[u] + 1)
            q.append(v)
    return lv
def bfs():
    lv = {src: 0}
    q = deque([src])
    while q:
        u = q.popleft()
        for (v, e) in self.edges[u].items():
            if ((e['capacity'] == 0) or (v in lv)):
                continue
            lv[v] = (lv[u] + 1)
            q.append(v)
    return lv