STEP: 1523 / Test: 35/35 PASS / Lean 4: 6 theorem zero sorry / Type: STEP 1486 離散数学 2nd tool (47 defer 全体 14 番目)
❶ Adjacency list → 7-verdict classification: self-loop → SELF ★ / no edges → ZERO / tree → TRUE / cyclic → BOTH / disconnected acyclic → NEITHER。
❷ directed/undirected 両対応、 3-color DFS で directed cycle 検出、 parent-tracking DFS で undirected cycle 検出。
❸ 姉妹 verdict tool 17 揃った。
| Condition | Verdict | Reason |
|---|---|---|
| self-loop present | SELF ★ | self_loop_detected |
| 0 edges (isolated) | ZERO | no_edges_isolated |
| connected + acyclic (tree/DAG) | TRUE | connected_acyclic |
| connected + cyclic | BOTH | connected_cyclic |
| disconnected + cyclic | BOTH | disconnected_cyclic |
| disconnected + acyclic | NEITHER | disconnected_acyclic |
| invalid input | NEITHER | invalid_input |
// Triangle → BOTH (connected cyclic)
graphVerdict({ numVertices: 3, edges: [[0,1], [1,2], [2,0]] });
// Path graph → TRUE (tree)
graphVerdict({ numVertices: 3, edges: [[0,1], [1,2]] });
// Directed DAG
graphVerdict({ numVertices: 3, edges: [[0,1], [1,2], [0,2]], directed: true });
// { verdict: 'TRUE', reason: 'connected_acyclic' }
// Self-loop
graphVerdict({ numVertices: 2, edges: [[0,0], [0,1]] });
// { verdict: 'SELF', reason: 'self_loop_detected' }
graph_self_loop_gives_self : self-loop → SELF graph_no_edges_gives_zero : 0 edges → ZERO graph_connected_cyclic_gives_both : connected + cyclic → BOTH graph_tree_gives_true : connected + acyclic → TRUE graph_disconnected_cyclic_gives_both : disconnected + cyclic → BOTH graph_disconnected_acyclic_gives_neither : disconnected + acyclic → NEITHER
❶ BFS/DFS 標準実装のみ、 weighted graph / flow / matching 未 embed。
❂ 「世界初」 なし = Euler 1736 (Königsberg) 既知 D-FUMT₈ mapping。
❸ 累計 defer 35 → 34。