126
126
while var_graph.get_nodes():
127
127
#get a list of nodes with no edges
128
128
indep_vars = filter(lambda var: not var_graph.get_edges(var), var_graph.get_nodes())
130
130
#add the indep vars to the end of the list
131
131
sorted_vars.extend(sorted(indep_vars))
132
132
#remove each edge-less node from the graph