def _create_complete_graph ( node_ids ) : g = nx . Graph ( ) g . add_nodes_from ( node_ids ) for ( i , j ) in combinations ( node_ids , 2 ) : g . add_edge ( i , j ) return g
implement clustered edges in python networkx
Create a complete graph from the list of node ids .
def _create_complete_graph(node_ids):
    """Create a complete graph from the list of node ids.

    Args:
        node_ids: a list of node ids

    Returns:
        An undirected graph (as a networkx.Graph)
    """
    g = nx.Graph()
    g.add_nodes_from(node_ids)
    for (i, j) in combinations(node_ids, 2):
        g.add_edge(i, j)
    return g