def jobs_to_delete(expected_jobs, actual_jobs):
    """
    Decides on jobs that need to be deleted.
    Compares lists of (service, instance) expected jobs to a list of (service, instance, tag) actual jobs
    and decides which should be removed. The tag in the actual jobs is ignored, that is to say only the
    (service, instance) in the actual job is looked for in the expected jobs. If it is only the tag that has
    changed, then it shouldn't be removed.

    :param expected_jobs: a list of (service, instance) tuples
    :param actual_jobs: a list of (service, instance, config) tuples
    :returns: a list of (service, instance, config) tuples to be removed
    """

    not_expected = [job for job in actual_jobs if (job[0], job[1]) not in expected_jobs]
    return not_expected