Bifalgorithm post · Brisk · Chapter 1
What is a directed acyclic graph, or DAG?
What is a directed acyclic graph, or DAG? (Brisk · Chapter 1) — "DAG (directed, acyclic graph). One common use of graphs is to represent flows of dependencies,…
Ideas in this flowchart
- Directed Acyclic Graph (DAG)
- A DAG must be both directed and acyclic.
- Directed means that one task can require another task without the reverse requirement.
- Dependencies form one-way prerequisite relationships between tasks.
- Mutual dependencies would create an infinite loop.
- Acyclic means that the graph contains no cycles.
- A cycle may pass through multiple vertices.
- Any dependency cycle could make the project impossible to complete.
- DAGs represent flows of dependencies.
- College courses can be represented through prerequisite dependencies.
- Project workflows represent tasks as vertices and their dependencies as edges.
- A brownie-making workflow is an example of a dependency graph.
- Eggs must be cracked before mixing, the oven must be preheated before baking, and the pan must be greased before pouring.
- An arrow from baking back to greasing the pan would create a dependency cycle.
- The resulting cycle would leave the tasks stuck and prevent the brownies from being completed.
