nsdlib.common.nx_utils module

nsdlib.common.nx_utils.create_snapshot_IG(G, delete_ratio=None) Tuple[Graph, list][source]

Create a snapshot of the network by removing a random number of nodes.

Parameters:
  • G – The network

  • ratio_to_remove – The ratio of nodes to remove. If None, remove 10%

of the nodes.

nsdlib.common.nx_utils.create_subgraphs_based_on_outbreaks(G: Graph, outbreaks: Dict[int, list]) List[Graph][source]

Create subgraphs based on outbreaks.

nsdlib.common.nx_utils.exclude_nodes(G: Graph, nodes: List[any]) Graph[source]

Remove nodes from a graph.