remove_labeled_edges

remove_labeled_edges#

graph_tool.generation.remove_labeled_edges(g, label)[git][source]#

Remove every edge e such that label[e] > 0.

Parameters:
gGraph

Graph to be modified.

labelEdgePropertyMap

Scalar edge property map. The edges with positive values are removed.

See also

label_parallel_edges

Label parallel edges.

label_self_loops

Label 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