import math


def IC_DSIMP(kw, nw, mu, p_):
    """function to compute the information content of a multigraph graph pattern as proposed in DSIMP

    Args:
        kw (int): number of edges found in multigraph pattern
        nw (int): total number of feasible vertex-pair
        mu (float): expected number of edges in a multigraph pattern, i.e., sum of expected edges between all feasible vertex-pair
        p_ (float): minimum prabability of success among all geometric distribution between all feasible vertex pairs

    Returns:
        float: The information content (as per definition in DSIMP) of a multigraph pattern
    """
    ic = 0.0
    if kw + nw > 0.0 and mu + nw > 0.0:
        ic = p_ * ( kw - mu ) + p_ * ( mu + nw ) * math.log ((mu + nw) / (kw + nw))
    # eps = kw/nw
    # ps = 1.0/(eps+1.0)
    # ic = KL_g(ps, p_)
    return ic