id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id
title
category
status
canonical_id
aliases
duplicate_of
source_trust_level
confidence_score
verification_status
tags
raw_sources
last_reinforced
github_commit
tech_stack
wiki-2026-0508-graph-theory
Graph Theory
10_Wiki/Topics
verified
self
none
A
0.9
applied
2026-05-10
pending
language
framework
python
networkx
Graph Theory
매 한 줄
"매 vertex + edge 의 abstraction 으로 매 거의 모든 관계를 model" . 매 Euler (1736 Königsberg) 부터 매 modern Graph Neural Network (2026 GraphSAGE, GAT, Graph Transformer) 까지 — 매 search engine PageRank, social network, dependency graph, GNN, knowledge graph 의 foundation.
매 핵심
매 representations
Adjacency matrix : O(V²) space, O(1) edge query — 매 dense graph.
Adjacency list : O(V+E) space — 매 sparse 일반.
Edge list : 매 streaming / disk-based.
CSR (Compressed Sparse Row) : 매 cache-friendly, GNN framework 의 표준.
매 핵심 algorithm
BFS O(V+E) — 매 unweighted shortest path, level order.
DFS O(V+E) — 매 cycle detection, topo sort, SCC.
Dijkstra O((V+E) log V) — 매 non-negative weighted shortest path.
Bellman-Ford O(VE) — 매 negative weight allowed.
Floyd-Warshall O(V³) — 매 all-pairs.
Union-Find ~ O(α (V)) — 매 connectivity, Kruskal MST.
Topological sort — 매 DAG ordering.
PageRank — 매 power iteration on stochastic matrix.
매 응용
Routing / map — 매 OSRM, Valhalla, Google Maps.
Dependency resolution — npm, cargo, Bazel.
GNN — 매 fraud detection, drug discovery, recommendation (Pinterest PinSage).
Knowledge graph — 매 RAG / LLM grounding.
💻 패턴
Adjacency list (Python)
BFS shortest path
Dijkstra (heap)
Topological sort (Kahn)
Union-Find (path compression + rank)
NetworkX (Python prototyping)
GNN (PyTorch Geometric)
매 결정 기준
상황
Approach
Unweighted shortest
BFS
Non-negative weighted
Dijkstra
Negative weight
Bellman-Ford / Johnson
All-pairs, dense, V<500
Floyd-Warshall
MST
Kruskal (DSU) / Prim (heap)
DAG scheduling
Topological sort
Cycle / SCC
DFS + Tarjan / Kosaraju
Massive web graph
Pregel-style (GraphX, Giraph)
Learning on graph
GNN (PyG, DGL)
기본값 : prototype 은 NetworkX, production 은 graph-tool / igraph / 직접 CSR.
🔗 Graph
🤖 LLM 활용
언제 : 매 problem 을 graph 로 model 가능한지 reasoning, 매 algorithm 선택.
언제 X : 매 V, E 가 매우 작은 brute-force 충분 case — 매 over-engineering.
❌ 안티패턴
Adjacency matrix on sparse : 매 V=10⁶ 에 V² 메모리 폭발.
Recursive DFS on deep graph (Python) : 매 stack overflow — iterative.
Dijkstra with negative edges : 매 wrong answer — Bellman-Ford.
Re-running BFS from each node for diameter : 매 BFS× V — multi-source / approx 사용.
Forgetting visited set : 매 BFS/DFS 무한 loop.
🧪 검증 / 중복
Verified (CLRS Introduction to Algorithms 4th ed., Sedgewick Algorithms 4ed, NetworkX docs, PyG 2.5).
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — graph algorithms + GNN 응용 정리