Tasks/Operations Research/Combinatorial Optimization

Drive coloring conflicts to zero at a fixed color budget

Minimize conflicts at a fixed color budget on hard DIMACS graphs

johnson1991_leighton_graph_coloring Operations Research Combinatorial Optimization
instruction.mdthis is what the agent is given

You inherit a TabuCol graph-coloring baseline. For every graph you are given a fixed color budget target_k. Assign each vertex a color in {0, 1, ..., target_k-1} so as to minimize the number of monochromatic edges (edges whose two endpoints share a color). You may not use any color >= target_k.

target_k is set to each graph's best-known chromatic number, so a conflict-free (proper) target_k-coloring provably exists — but finding one sits at the coloring frontier and is very hard: a reference local search plateaus well above zero. Your job is to get the conflict count as low as possible — ideally all the way to 0.

This datapoint is method-scored, not answer-scored: your code is re-run by a separate verifier on sealed hidden graphs. The visible graphs are only for development.

Hard Constraints

  • You may only edit code under /app/methods/main/; you may add sibling .py modules.
  • Keep the entrypoint signature solve(data) -> {"colorings": [...]}.
  • Standard library + numpy only — no internet, no other third-party packages. The verifier sandbox ships the SAME numpy and nothing else, so import numpy is fine but any other third-party import (networkx, scipy, a solver package, …) makes the submission score 0.
  • Per-instance 45s hard cap. The grader solves each graph in isolation and kills any graph that runs longer than 45 seconds, scoring that graph 0 (the others are unaffected). Self-pace so every graph returns within 45s.
  • Return one coloring per instance, in the same order as data["instances"]. Each coloring must have length n_vertices; every color must be an integer in [0, target_k). A color >= target_k or < 0, a wrong length, a non-integer, or a graph that exceeds 45s scores 0 for that graph (per-instance fail-closed), not for the whole submission.

What You Have

  • /app/data/visible.json: visible graphs with anonymized names pub0, pub1, … . Each is {name, n_vertices, n_edges, edges, target_k} with 0-indexed undirected edges.
  • /app/methods/main/solver.py and gc_lib.py: the editable baseline (a single TabuCol run) and helpers, including reference_tabucol. This directory is what gets graded. Matching the baseline gains you nothing; the task is to beat it.
  • /app/selfcheck.py: a free local dry-run (python /app/selfcheck.py) that mirrors the grader — runs your solver on each visible graph under the SAME 45s per-instance cap, validates the coloring, prints each graph's runtime + raw conflict count, and tells you exactly which graphs were KILLED for exceeding 45s. A proxy only — the hidden set is a different, sealed batch.

What You Submit

Edit /app/methods/main/solver.py, keeping this interface:

def solve(data):
    # data: {"instances": [{"name","n_vertices","n_edges","edges","target_k"}, ...], ...}
    # returns: {"colorings": [[color_for_vertex_0, ...], ...]}   # colors in [0, target_k)
    ...

You may add helper modules next to solver.py. There is no submit step; Harbor grades whatever remains under /app/methods/main/ at the end of the run.

How It Is Judged

After your run, the verifier copies your methods/main/ into a clean, no-network sandbox and re-runs solve on sealed hidden graphs drawn from the same generators as the visible set (n from 250 to 1000), one graph at a time under the 45s per-instance cap. For each graph it checks the color range and counts conflicting edges — fewer is better. A crash, out-of-range color, wrong shape, or a graph over 45s forfeits that graph, so a constant or hard-coded answer cannot score.

The hidden graphs have randomly permuted vertex labels and anonymized names. Do not rely on graph names, vertex-index patterns, downloaded public instances, or a precomputed coloring table: a published best-known coloring is keyed to upstream labels and does not apply here. The task is to build a robust conflict-minimization method that transfers from the visible to the hidden graphs.

Metric

total monochromatic edges over the 7 sealed graphs · lower is better

Edges whose two endpoints share a color, at each graph's fixed target_k; scored per graph, then averaged.

anchorvisible setheld-outreward
reference TabuCol at the 45s cap1291670.00
proper coloring, no conflicts01.00
normalisation
c >= F0
0 <= c < F(F - c) / F

Per graph: c its conflicts, F its reference-TabuCol conflicts. The 7 scores are averaged. Over 45s, invalid, or crashed scores 0.

Rollouts

141 minwall clock
$32.36spend
51.1Mtokens
22versions, 19 kept
10 20 30 40 50 60 $0 $7.5 $15 $22 cumulative spend on the run pub0+pub2+pub4 conflicts, lower is better v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21
keptrevertedno scoreturning point
  1. v0Inherited baseline: one reference TabuCol run per graph572 min · $0.36
  2. v1NumPy-vectorized TabuCol, 96-vertex candidate sample, 40s budget436 min · $0.74
  3. v2Standalone PartialCol plus 24-way fail-first completion repair4210 min · $1.14
  4. v3Fast TabuCol, cover transfer, PartialCol, repair, final TabuCol2816 min · $1.81
  5. v4Fixed 45k/180k/45k cycles over deterministic seeds, then polish3523 min · $2.68
  6. v5Label-agnostic k-clique certificate pinned bijectively to the k colorsSearch for a full k-clique and pin it to k distinct colors, so part of the coloring is fixed and provably correct before search.2432 min · $3.74
  7. v6Portfolio: anchored hybrid only with a certificate, else one long TabuCol2239 min · $4.88
  8. v7Complete-color tabu tenure coefficient cut from 0.60 to 0.40pub2 probe = 1840 min · $5.15
  9. v8Regime-adaptive tenure: 0.60 anchored or high color ratio, 0.80 otherwise2043 min · $5.69
  10. v9Fallback tenure alpha swept 1.0/1.2/1.5, interior 1.2 selected1746 min · $6.19
  11. v10Conflicting-vertex sample 96 to 192 on non-anchored graphs only1649 min · $6.91
  12. v11Random tabu-tenure addend widened from U[0,10) to U[0,20)pub2 probe = 1451 min · $7.34
  13. v12Random tabu-tenure addend narrowed from U[0,10) to U[0,5)pub2 probe = 1052 min · $7.61
  14. v13Anchored PartialCol tenure coefficient raised from 0.60 to 1.001265 min · $10.26
  15. v14Anytime anchored portfolio: 7s PartialCol hybrid, then long TabuCol1274 min · $12.48
  16. v15Size-scaled fallback neighborhood: sample 96 for n>=750, 192 below1278 min · $13.38
  17. v16Guarded 0.8s clique branch-and-bound at greedy clique 80% of kall-visible = 5185 min · $15.07
  18. v17High-color-ratio certificates keep the unanchored fallback1286 min · $15.45
  19. v18Large-graph sample 128 instead of 96 for n>=750Judge a change on randomly relabeled copies, not original labels, because the hidden graphs are permuted. Kept despite +1 here.1290 min · $16.60
  20. v19Low-k anchored graphs (k^2 < n) keep the full PartialCol hybridall-visible = 5094 min · $17.79
  21. v20Safety hardening: clique deadline per layer, non-tabu move fallbacks1298 min · $18.80
  22. v21Steady-state GPX plus 20k-move tabu for large low-color-ratio graphsAdd a population with crossover and short tabu localization, for the large graphs where one long trajectory stalls.12122 min · $26.10

v0-v12 took 52 minutes and $7.61. The rest went on relabel robustness and GPX controls, which the tuning total, flat at 12 from v13, cannot show.

On the hidden set

held-out metricreward
reference TabuCol at the 45s cap1670.00
proper coloring, no conflicts01.00
this run780.5133