def get_ij_from_index(r, m, n):
    """
    The inverse of get_y_indicator_variable_index(): given the indiator
    variable index, return the (i ,j) pair for y_{ij} to which it
    corresponds. So when we get a solution from MiniSat+, the variable
    index given to this function gets converted to (i,j) our y_{ij}, meaning
    that if that indiator variable is 1, SSE i in tableau a is matched with
    SSE j in tableau b.

    Parameters:
        index r of indicator variable x_{r} 
        m - order of tableau a (0 <= i,k < m)
        n - order of tableau b (0 <= j,l < n)

    Return value:
        i, j   - indices for y indicator variable corresponding to
                 MiniSat+ variable y_r
    """
    i = r / n
    j = r % n
    return (i,j)