def calcDynamicP0(G, node):
    """
    Dynamically calculate an initial probability of a node notifying her friends for a node in G according to the weight of her in the base network G
    It is calculated by the following formula:
    P_{node, 0} = 1- frac{4}{N_f}
    """
    weight = sum([G[node][x]['w'] for x in G[node]]) / 4.0
    return (1.0 - 1.0/weight) if weight != 0.0 else 0.9