def METHOD_NAME(g_nx, src):
    edges = nx.bfs_edges(g_nx, src)
    layers_nx = [set([src])]
    edges_nx = []
    frontier = set()
    edge_frontier = set()
    for u, v in edges:
        if u in layers_nx[-1]:
            frontier.add(v)
            edge_frontier.add(g.edge_ids(int(u), int(v)))
        else:
            layers_nx.append(frontier)
            edges_nx.append(edge_frontier)
            frontier = set([v])
            edge_frontier = set([g.edge_ids(u, v)])
    # avoids empty successors
    if len(frontier) > 0 and len(edge_frontier) > 0:
        layers_nx.append(frontier)
        edges_nx.append(edge_frontier)
    return layers_nx, edges_nx