nsdlib.algorithms.reconstruction.utils module

nsdlib.algorithms.reconstruction.utils.compute_neighbors_probability(node: int | str, G: Graph) float[source]

Compute probability of infection for a given node.

@param node: Node @param G: Graph

@return: Probability of infection for a given node

nsdlib.algorithms.reconstruction.utils.init_extended_network(G: Graph, IG: Graph) Graph[source]

Initialize extended network.

@param G: Network @param IG: Infected network

@return: Extended network

nsdlib.algorithms.reconstruction.utils.remove_invalid_nodes(EG: Graph, threshold: float) Graph[source]

Remove nodes with infection probability lower than threshold.

@param EG: Extended network @param threshold: Infection probability threshold

@return: Extended network with removed nodes that have infection probability lower than threshold