remove_labeled_edges#
- graph_tool.generation.remove_labeled_edges(g, label)[git][source]#
Remove every edge
esuch thatlabel[e] > 0.- Parameters:
- g
Graph Graph to be modified.
- label
EdgePropertyMap Scalar edge property map. The edges with positive values are removed.
- g
See also
label_parallel_edgesLabel parallel edges.
label_self_loopsLabel self-loops.
Notes
This algorithm runs in time \(O(N + E)\) where \(N\) is the number of vertices and \(E\) is the number of edges in the graph.
Parallel implementation.
If enabled during compilation, this algorithm will run in parallel using OpenMP. See the parallel algorithms section for information about how to control several aspects of parallelization.
Examples
>>> g = gt.collection.data["polblogs"].copy() >>> print(g.num_edges()) 19090 >>> label = gt.label_parallel_edges(g) >>> gt.remove_labeled_edges(g, label) >>> print(g.num_edges()) 19025