ocaml: phase 5.1 bipartite.ml baseline (7-node bipartite, 4 in color 0)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 26s

BFS-based 2-coloring of an undirected graph:

  edges (undirected):
    0-1  0-3  1-2  1-4  2-5  3-4  3-6  5-6

  Partition: {0, 2, 4, 6} vs {1, 3, 5} (no odd cycles)

Returns count of color-0 vertices (4) on success, -1 on odd-cycle
detection.

Tests Queue-based BFS with a source-loop wrapper for disconnected
graphs, `1 - color.(u)` toggle, color-equality conflict check
on already-colored neighbors.

164 baseline programs total.
This commit is contained in:
2026-05-10 23:08:16 +00:00
parent 32f6c4ee0c
commit d1a4616ac4
3 changed files with 49 additions and 0 deletions

View File

@@ -407,6 +407,15 @@ _Newest first._
binary search tree (`type 'a tree = Leaf | Node of 'a * 'a tree *
'a tree`) with insert + in-order traversal. Tests parametric ADT,
recursive match, List.append, List.fold_left.
- 2026-05-10 Phase 5.1 — bipartite.ml baseline (BFS 2-coloring on
7-node cycle-rich graph → bipartite with 4 vertices in color 0).
Edges: 0-1, 0-3, 1-2, 1-4, 2-5, 3-4, 3-6, 5-6. This forms a
bipartite graph with partition {0,2,4,6} vs {1,3,5}. Returns
count of color-0 vertices (4) on success, -1 on odd-cycle
detection. Tests Queue-based BFS with module-level state in a
loop over all sources (handles disconnected graphs), `1 - color.(u)`
binary toggle, color-equality conflict check. 164 baseline
programs total.
- 2026-05-10 Phase 5.1 — egg_drop.ml baseline (worst-case trials
for 2 eggs, 36 floors = 8). Classic O(e·f²) DP: dp[e][f] = 1 +
min over k of max(dp[e-1][k-1], dp[e][f-k]). Closed form via