Victor Bouzas
03/14/2025, 10:07 AMThierry Jean
03/14/2025, 12:04 PMDriver.list_available_variables()
I think they are topologically sorted. Note that the order is not deterministic though.
If you have DAG
A -> B
A -> C
You might get [A, B, C]
or [A, C, B]
Victor Bouzas
03/14/2025, 3:20 PMC -> B -> A
It returns A, B, CElijah Ben Izzy
03/14/2025, 4:54 PMElijah Ben Izzy
03/14/2025, 4:55 PMStefan Krawczyk
03/15/2025, 11:24 PMElijah Ben Izzy
03/16/2025, 12:18 AMfrom hamilton.execution.graph_functions import topologically_sort_nodes
dr = driver.Builder()....build()
graph = dr.graph
nodes_sorted = [HamiltonNode.from_node(n) for n in topologically_sort_nodes(list(graph.nodes.values()))]
Elijah Ben Izzy
03/16/2025, 12:21 AMVictor Bouzas
03/17/2025, 11:07 AM