def get_executable_functions(coupling_matrix, sequence):
    """Method to determine which of the functions in the process graph are executable based on data dependencies from
    the MDG.

    :param coupling_matrix: coupling matrix of the MDG
    :type coupling_matrix: array.py
    :param sequence: sequence of functions to be analyzed
    :type sequence: list
    :return: executable functions and updated coupling matrix with removed rows and columns
    :rtype: tuple
    """
    assert len(coupling_matrix) == len(sequence
        ), 'Coupling matrix size and sequence length should match.'
    if not sequence:
        return [], []
    upper_columns_empty = True
    functions = [sequence[0]]
    updated_coupling_matrix = coupling_matrix[1:, 1:]
    col = 1
    while upper_columns_empty and col < len(coupling_matrix):
        if sum(coupling_matrix[:col, (col)]) == 0:
            functions.append(sequence[col])
            updated_coupling_matrix = updated_coupling_matrix[1:, 1:]
        else:
            upper_columns_empty = False
        col += 1
    return functions, updated_coupling_matrix
