30 lines
764 B
Julia
Raw Normal View History

"""
get_properties(graph::DAG)
Return the graph's [`GraphProperties`](@ref).
"""
function get_properties(graph::DAG)
2023-08-25 10:48:22 +02:00
# make sure the graph is fully generated
apply_all!(graph)
if (graph.properties.computeEffort == 0.0)
graph.properties = GraphProperties(graph)
2023-08-25 10:48:22 +02:00
end
return graph.properties
end
"""
get_exit_node(graph::DAG)
Return the graph's exit node. This assumes the graph only has a single exit node. If the graph has multiple exit nodes, the one encountered first will be returned.
"""
function get_exit_node(graph::DAG)
2023-08-25 10:48:22 +02:00
for node in graph.nodes
if (is_exit_node(node))
return node
end
end
@assert false "The given graph has no exit node! It is either empty or not acyclic!"
end