def update_graph(self, dep_id=None, success=True):
<EOL>jobs = self.graph.pop(dep_id, [])<EOL>if dep_id is None or self.hwm and any( [ load==self.hwm-<NUM_LIT:1> for load in self.loads ]):<EOL><INDENT>jobs = self.depending.keys()<EOL><DEDENT>for msg_id in sorted(jobs, key=lambda msg_id: self.depending[msg_id].timestamp):<EOL><INDENT>job = self.depending[msg_id]<EOL>if job.after.unreachable(self.all_completed, self.all_failed)or job.follow.unreachable(self.all_completed, self.all_failed):<EOL><INDENT>self.fail_unreachable(msg_id)<EOL><DEDENT>elif job.after.check(self.all_completed, self.all_failed): <EOL><INDENT>if self.maybe_run(job):<EOL><INDENT>self.depending.pop(msg_id)<EOL>for mid in job.dependents:<EOL><INDENT>if mid in self.graph:<EOL><INDENT>self.graph[mid].remove(msg_id)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>
dep_id just finished. Update our dependency
        graph and submit any jobs that just became runable.

        Called with dep_id=None to update entire graph for hwm, but without finishing
        a task.