def get_max_edges(block_r, block_s, block_ns):
    """
    Calculates the maximum number of edges that could possibly exist between two
    blocks

    Parameters
    ----------
    block_r, block_s: int
        Blocks to get the maximum number of edges between
    block_ns: 1D array
        Array counting the number of nodes in each block

    Returns
    -------
    M_rs: int
        The number of possible edges between block_r and block_s
    """
    if block_r == block_s:
        M_rs = block_ns[block_r]*(block_ns[block_r]-1)/2
    else:
        M_rs = block_ns[block_r]*block_ns[block_s]
    return M_rs