cascade.graph.filter_edges

cascade.graph.filter_edges(graph, edge_attr='weight', cutoff=None, n_top=None)[source]

Filter graph by an edge attribute

Parameters:
  • graph (TypeVar(SimpleGraph, Graph, DiGraph)) – Graph to be filtered

  • edge_attr (str) – Edge attribute used to filter the graph

  • cutoff (float | None) – Cutoff value for the edge attribute

  • n_top (int | None) – Number of top edges to be kept

Return type:

TypeVar(SimpleGraph, Graph, DiGraph)

Returns:

Filtered graph

Note

Exactly one of cutoff and n_top should be specified.