Prove every DAG has at least one source and one sink
Analyze the prove every dag has at least one source and one sink.
Examples
Input: "proof_case_1"
Output: true
Input: "proof_case_2"
Output: true
Hints
Recall that a DAG (Directed Acyclic Graph) is a directed graph with no directed cycles. Start by considering the properties of such graphs and how they relate to sources and sinks.
Consider the concept of in-degree and out-degree in a DAG. Think about what it means for a vertex to have an in-degree of 0 (source) or an out-degree of 0 (sink).
Use proof by contradiction: Assume that a DAG has no sources or sinks, and show that this leads to a contradiction with the definition of a DAG (i.e., the existence of a directed cycle).
Prove every DAG has at least one source and one sink
Analyze the prove every dag has at least one source and one sink.