---
library: "bootstrap"
slug: "DAG"
name: "DAG"
ref: "DAG#0c8a"
hash: "sema:DAG#mh:SHA-256:0c8ae9f4ab979af72ccf01ea840861e6e8473459598901236faf05294d5cb22b"
type: "Data Structures"
layer: "Infrastructure"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/DAG"
---

# DAG

Directed acyclic dependency graph

Infrastructure · Data Structures

## Mechanism

A directed acyclic graph [Topology](https://semahash.org/vocabularies/bootstrap/patterns/Topology.md) that allows branching ([Parallelize](https://semahash.org/vocabularies/bootstrap/patterns/Parallelize.md)) and merging, but forbids cycles. It models complex dependency chains where tasks can run concurrently but must respect precedence.

## Invariants

- Acyclic: no path leads from a node back to itself.
- Edges are directed.
- Rooted: exactly one node has no predecessor, named by `root_id`.
- Nodes with no directed path between them may run concurrently.

## Failure modes

- Cycle on insert: an added edge closes a loop, which the acyclicity invariant forbids and which must be detected at insertion rather than at traversal.
- False precedence: an edge asserts a dependency that does not exist, serialising work that could have run concurrently.

## Where this came from

—

## Builds on

- [Topology](https://semahash.org/vocabularies/bootstrap/patterns/Topology.md) (references)
- [Parallelize](https://semahash.org/vocabularies/bootstrap/patterns/Parallelize.md) (references)

## Used by

- [GraphOfThought](https://semahash.org/vocabularies/bootstrap/patterns/GraphOfThought.md) (composes_with)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: DAG#0c8a
- Hash: sema:DAG#mh:SHA-256:0c8ae9f4ab979af72ccf01ea840861e6e8473459598901236faf05294d5cb22b

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/DAG
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/DAG.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
