def compute_jobson(sched):
    """
    Given the output of jobs_when_where produce a dict mapping machine to jobs
    {machine: [jobs]}
    """
    result = {}
    for job, _, agent in sched:
        result[agent] = result.get(agent, ()) + (job,)
    return result