Skip to content

utils

is_dag

is_dag(graph: dict[str, set[str]]) -> bool

Determine if a graph is a directed acyclic graph (DAG).

Parameters:

Name Type Description Default
graph dict[str, set[str]]

The graph to check.

required

Returns:

Type Description
bool

Whether the graph is a DAG.