def prim_mst_edges(G, weight = 'weight', data = True):

    if G.is_directed():
        raise nx.NetworkXError(
            "Mimimum spanning tree not defined for directed graphs.")

    nodes = G.nodes()

    while nodes:
        u = nodes.pop(0)
        frontier = []
        visited = [u]
        for u, v in G.edges(u):
            heappush(frontier, (G[u][v].get(weight, 1), u, v))

        while frontier:
            W, u, v = heappop(frontier)
            if v in visited:
                continue
            visited.append(v)
            nodes.remove(v)
            for v, w  in G.edges(v):
                if not w in visited:
                    heappush(frontier, (G[v][w].get(weight, 1), v, w))
            if data:
                yield u, v, G[u][v]
            else:
                yield u, v
L{athena.MappingResource} isn't directly renderable.
dataset/ETHPy150Open gkno/gkno_launcher/src/networkx/algorithms/mst.py/prim_mst_edges--crossover with--dataset/ETHPy150Open twisted/nevow/nevow/test/test_athena.py/MappingResourceTests.test_renderMapping