ダブルクリックで英日反転
Applied Sciences · Engineering
Tech Trees and DAGs — Dependencies Demystified
A game's craft tree is, in CS terms, precisely a DAG (Directed Acyclic Graph). The same structure underpins npm install, make, and CI job ordering — anything where order of operations must respect dependencies.
What a Tech Tree Really Is
- A chart of arrows: "unlock/craft B only after you have A".
- Examples: Dr. STONE sulfa-drug chain, Minecraft recipes, Civilization tech tree.
- Pattern: raw materials → intermediates → final product, joined by directed arrows.
DAG in Three Words
- Graph: nodes (items) connected by edges (relationships).
- Directed: arrows have a one-way direction ("A is input for B").
- Acyclic: no cycle exists — circular deps ("C needs D needs C") make ordering impossible.
Topological Sort
- Flattens a DAG into a single ordered list that satisfies all dependencies.
- Algorithms: Kahn's (queue nodes with in-degree 0 first) or reverse-DFS.
- Used by make, npm install, CI pipelines, and task schedulers.
Visualisation & Libraries
- Mermaid: text-based, ideal for docs/READMEs — use `flowchart LR`.
- React Flow: interactive draggable nodes, embeds in web apps.
- D3 / d3-dag: fully custom layouts; maximum control, maximum effort.
→ Every dependency graph — game crafting chart or CI pipeline — is a DAG; topological sort gives you the correct build order for free.
Applied Sciences · Engineering
テックツリーとDAG — 依存関係の正体
ゲームの「クラフトツリー」はCS(コンピュータサイエンス)用語で正確にDAG(有向非循環グラフ)と呼ばれる構造。npm installやmake、CIジョブの順序付けも全て同じ仕組みで動いている。
テックツリーとは何か
- 「Bを作るにはAが先に必要」を矢印でつないだ図。
- 例:Dr.STONEの硫黄→硫酸→サルファ剤、Minecraftのレシピ、Civilizationのテックツリー。
- 共通パターン:素材 → 中間生成物 → 最終成果物を有向の矢印でつなぐ。
DAGを3語で理解する
- グラフ(Graph):ノード(点)をエッジ(線)でつないだ構造。
- 有向(Directed):矢印に向きがある(「AはBの材料」)。
- 非循環(Acyclic):ループなし。「CはDが必要、DはCが必要」の循環依存は順序決定不能になる。
トポロジカルソート(位相的整列)
- DAGのノードを「依存関係を満たす順」に一列に並べる操作。
- アルゴリズム:カーンのアルゴリズム(入次数0のノードからキュー)またはDFS(深さ優先探索)の逆順。
- make・npm install・CIパイプライン・タスクスケジューラが内部で使用している。
描画ライブラリの選び方
- Mermaid(マーメイド):テキスト記法。ドキュメント・README向け。`flowchart LR`でDAGを表現。
- React Flow:Webアプリ組み込み向け。ノードをドラッグできるインタラクティブ表示。
- D3 / d3-dag:完全カスタム。自由度最大・実装コスト最大。
→ 依存関係のグラフは必ずDAG。トポロジカルソートを使えばビルドやインストールの正しい実行順序が自動で決まる。
Applied Sciences · Engineering
Tech Trees and DAGs — Dependencies Demystified
A game's craft tree is, in CS terms, precisely a DAG (Directed Acyclic Graph). The same structure underpins npm install, make, and CI job ordering — anything where order of operations must respect dependencies.
What a Tech Tree Really Is
- A chart of arrows: "unlock/craft B only after you have A".
- Examples: Dr. STONE sulfa-drug chain, Minecraft recipes, Civilization tech tree.
- Pattern: raw materials → intermediates → final product, joined by directed arrows.
DAG in Three Words
- Graph: nodes (items) connected by edges (relationships).
- Directed: arrows have a one-way direction ("A is input for B").
- Acyclic: no cycle exists — circular deps ("C needs D needs C") make ordering impossible.
Topological Sort
- Flattens a DAG into a single ordered list that satisfies all dependencies.
- Algorithms: Kahn's (queue nodes with in-degree 0 first) or reverse-DFS.
- Used by make, npm install, CI pipelines, and task schedulers.
Visualisation & Libraries
- Mermaid: text-based, ideal for docs/READMEs — use `flowchart LR`.
- React Flow: interactive draggable nodes, embeds in web apps.
- D3 / d3-dag: fully custom layouts; maximum control, maximum effort.
→ Every dependency graph — game crafting chart or CI pipeline — is a DAG; topological sort gives you the correct build order for free.
Applied Sciences · Engineering
テックツリーとDAG — 依存関係の正体
ゲームの「クラフトツリー」はCS(コンピュータサイエンス)用語で正確にDAG(有向非循環グラフ)と呼ばれる構造。npm installやmake、CIジョブの順序付けも全て同じ仕組みで動いている。
テックツリーとは何か
- 「Bを作るにはAが先に必要」を矢印でつないだ図。
- 例:Dr.STONEの硫黄→硫酸→サルファ剤、Minecraftのレシピ、Civilizationのテックツリー。
- 共通パターン:素材 → 中間生成物 → 最終成果物を有向の矢印でつなぐ。
DAGを3語で理解する
- グラフ(Graph):ノード(点)をエッジ(線)でつないだ構造。
- 有向(Directed):矢印に向きがある(「AはBの材料」)。
- 非循環(Acyclic):ループなし。「CはDが必要、DはCが必要」の循環依存は順序決定不能になる。
トポロジカルソート(位相的整列)
- DAGのノードを「依存関係を満たす順」に一列に並べる操作。
- アルゴリズム:カーンのアルゴリズム(入次数0のノードからキュー)またはDFS(深さ優先探索)の逆順。
- make・npm install・CIパイプライン・タスクスケジューラが内部で使用している。
描画ライブラリの選び方
- Mermaid(マーメイド):テキスト記法。ドキュメント・README向け。`flowchart LR`でDAGを表現。
- React Flow:Webアプリ組み込み向け。ノードをドラッグできるインタラクティブ表示。
- D3 / d3-dag:完全カスタム。自由度最大・実装コスト最大。
→ 依存関係のグラフは必ずDAG。トポロジカルソートを使えばビルドやインストールの正しい実行順序が自動で決まる。
Related notes
- Agentic Commerce — ACP and Visibility into Being 'Bought by AI'
- AI Search Evaluation: The 12 Metrics — Gateway
- AI Search Evaluation ①Citation Rate — How Many URLs Are Pulled In Per Answer
- AI Search Evaluation ②Source Diversity — How Unskewed the Cited Sources Are
- AI Search Evaluation ③Accuracy Score — How Often It Answers Factual Questions Correctly
- AI Search Evaluation ④Answer Length — How Many Characters It Returns to the User on Average