def _edge_expected_weight(edge_weight_distribution):
    """Helper function that computes the expected weight of an edge from
    the given distribution
    """
    edge_exists_in_n_permutations = sum(edge_weight_distribution)
    if not edge_exists_in_n_permutations:
        return 1
    sum_weight_counts = 0
    for weight_index, n_permutations in enumerate(edge_weight_distribution):
        sum_weight_counts += (weight_index + 1) * n_permutations

    return sum_weight_counts / float(edge_exists_in_n_permutations)