Lines Matching defs:dag
130 def toposort(dag, sort_fn):
131 """Topologically sorts the given dag.
134 - dag: a dict mapping from a node to its incoming nodes.
142 def get_next_batch(dag):
144 no_prev_nodes = set(node for node, prev in dag.items() if not prev)
148 dag = {
150 for node, prev in dag.items()
153 assert not dag, "found cyclic dependency"
156 for batch in get_next_batch(dag):
172 dag = {}
182 dag[cur] = uniqued_prev
184 sorted_caps = toposort(dag, lambda x: name_to_value[x])