from _typeshed import Incomplete

from networkx.classes.graph import Graph, _Node

def descendants(G: Graph[_Node], source: _Node) -> set[_Node]: ...
def ancestors(G: Graph[_Node], source: _Node) -> set[_Node]: ...
def is_directed_acyclic_graph(G): ...
def topological_sort(G) -> None: ...
def lexicographical_topological_sort(G, key: Incomplete | None = None): ...
def all_topological_sorts(G) -> None: ...
def is_aperiodic(G): ...
def transitive_closure(G, reflexive: bool = False): ...
def transitive_reduction(G): ...
def antichains(G, topo_order: Incomplete | None = None) -> None: ...
def dag_longest_path(G, weight: str = "weight", default_weight: int = 1, topo_order: Incomplete | None = None): ...
def dag_longest_path_length(G, weight: str = "weight", default_weight: int = 1): ...
def dag_to_branching(G): ...
