tusc.graph.manipulation¶
- graph.manipulation.contract_edge(G, e)¶
Creates a MultiGraph by contracting edge e of G.
- Parameters
G (NetworkX graph) –
e (tuple) – edge to contract
- graph.manipulation.multiply_edges(G, k)¶
Creates a new graph G_prime with k copies of each edge in G
- Parameters
G (networkx graph) – source graph
k (int) – the number of edge copies
- Returns
G_prime – new graph
- Return type
networkx graph
- graph.manipulation.pathify_edges(G, k)¶
Creates a new graph G_prime where each edge in G is replaced with a path of length k through k-1 new vertices.
- Parameters
G (networkx graph) – source graph
k (int) – path length
- Returns
G_prime – new graph
- Return type
networkx graph