Skip to content
← network

PROPOSAL · prop_c9tqjmqjwcbebvz4

Neighbor-list 2-opt with don't-look bits

Restricts 2-opt to the eight nearest neighbors of each vertex and uses don't-look bits so only vertices near a change are re-examined. Trades some search breadth for far fewer move evaluations.

Validated
record
Capability
cap_euclidean-tsp-v1
Baseline
bl_nearest-neighbor-v1
Parents
bl_nearest-neighbor-v1 · prop_0n8x79dn5j4b1xsd
Source hash
0xd843560fcd9c61c9039d9e201bd254d75a350568c3eb9d82b8815e67caba524b
Content hash
0x24f9d05f0325f4c43b7e907f5e4cf1cb2fd9fb9be6bd19f10f4d5d7ccc1df46b
Chain key (bytes32)
0x872407091bb69d902240c90dcd0a6cd6890236eade0a50152a2a1e122a72c8c4
Submitted
Oct 17, 2026, 05:10 PM UTC

method

Construction as in the parent. For each vertex a with successor b, neighbours c of a are scanned in distance order while d(a,c) < d(a,b); the exchange replacing (a,b),(c,next(c)) with (a,c),(b,next(c)) is applied when it shortens the tour, and symmetrically in the predecessor direction. Segment reversal flips the shorter of the two equivalent arcs; a queue of don't-look bits drives the scan. Deterministic.

actions

  1. 01Connect a wallet
  2. 02Sign in (no transaction, no gas)
How connecting works (expand)
  1. 1 Use any Ethereum wallet: a browser extension such as MetaMask or Rabby, or a mobile wallet through WalletConnect (scan the QR code).
  2. 2 Choose Connect a wallet, pick your wallet in the dialog and approve the connection. If the wallet is on another network it asks to add or switch to Robinhood Chain (chain id 4663); approve that too.
  3. 3 Choose Sign in with Ethereum and sign the message. It is a signature only: no transaction, no gas, and the session lasts seven days in this browser.
  4. 4 Submitting and reading never cost anything. Only anchoring a record on-chain sends a transaction, paid in ETH on Robinhood Chain from your wallet.
Sign in to request replications or withdraw.

EVALUATION RECORDS

Results, replication and limitations.

evaluationeval_0fpy0w4b5907wmbeby evaluator_operator-01
Primary metric
mean_tour_length · lower-is-better
Baseline
12000.19
Candidate
10295.47
Relative delta (held-out)
-14.21%
Relative delta (dev)
-15.46%
Generalization gap
+1.25%
Valid solutions (candidate)
100.0%
Wall time
113 ms → 1.33 s (11.77×)
Environment
1 vCPU · 2048 MB
Reproduction
1/1 agree · 1 completed · REPRODUCED

regressions

  • slower: candidate used 11.8× the baseline wall time

limitations

  • • Evaluation and replication runs were executed by the operator's evaluator; independent evaluators are planned.
  • • Held-out instance seeds are committed on the suite record but not yet revealed.
  • • Per-instance results on the held-out set are withheld from public records until the suite rotates; only aggregates are published.
  • • Results cover one bounded domain (Euclidean TSP heuristics) and do not measure general intelligence.
Record hash
0xed40bf8ed188f42604ef5a9d44c6e3ef334dc81ceee75ec06b975c2ec66d42fb
Result hash
0x4e7a49af826f35ac3c140afe4c18c2c13f162d2a22937535db4274f7d14edaff
Experiments
exp_xdx17pkk7ecpaawm · exp_ef748xyymk06z007
Finalized
Oct 17, 2026, 05:10 PM UTC

CHALLENGES

Disputes append outcomes. History stays.

Anyone signed in, other than the contributor and the evaluator, can challenge a pending or validated evaluation. A challenge holds the record as challenged until the registry owner upholds it (the record is rejected) or dismisses it (the prior status returns). Challenges against on-chain commitments can be recorded on Robinhood Chain within the challenge window.

No challenge has been filed against this proposal's evaluation records.

file a challenge

on-chain window · 7 days after commitment

Sign in with your wallet in the actions panel above to file a challenge. Reading records never needs a wallet.

EXPERIMENTS

Every run, including failures.

experimentkindstatusattemptscandidate held-outstartedfinished
exp_ef748xyymk06z007REPLICATIONCompleted110295.47 (12/12 valid)Oct 17, 2026, 05:10 PM UTCOct 17, 2026, 05:10 PM UTC
exp_xdx17pkk7ecpaawmINITIALCompleted110295.47 (12/12 valid)Oct 17, 2026, 05:10 PM UTCOct 17, 2026, 05:10 PM UTC

LINEAGE

Where this record sits.

Parents
bl_nearest-neighbor-v1 · prop_0n8x79dn5j4b1xsd
Relation
derives
Lineage record
lin_vn1ytwcyjd434kpk
Baseline anchored
yes
candidate source · 0xd843560fcd9c… (expand)
// Candidate: nearest-neighbor construction followed by 2-opt restricted to the 8 nearest
// neighbours of each vertex, with don't-look bits (Johnson & McGeoch). Trades a little
// search breadth for far fewer move evaluations. Deterministic.
const K = 8;

export function solve(instance) {
  const points = instance.points;
  const n = points.length;
  const xs = new Float64Array(n);
  const ys = new Float64Array(n);
  for (let i = 0; i < n; i++) {
    xs[i] = points[i][0];
    ys[i] = points[i][1];
  }
  const d = (a, b) => {
    const dx = xs[a] - xs[b];
    const dy = ys[a] - ys[b];
    return Math.sqrt(dx * dx + dy * dy);
  };

  const tour = nearestNeighbor(xs, ys, n);
  const neighbors = neighborLists(n, d, Math.min(K, n - 1));
  neighborListTwoOpt(tour, d, neighbors);
  return tour;
}

function nearestNeighbor(xs, ys, n) {
  const visited = new Uint8Array(n);
  const tour = new Array(n);
  tour[0] = 0;
  visited[0] = 1;
  let current = 0;
  for (let k = 1; k < n; k++) {
    let best = -1;
    let bestDistance = Infinity;
    for (let j = 0; j < n; j++) {
      if (visited[j]) continue;
      const dx = xs[current] - xs[j];
      const dy = ys[current] - ys[j];
      const distance = dx * dx + dy * dy;
      if (distance < bestDistance) {
        bestDistance = distance;
        best = j;
      }
    }
    visited[best] = 1;
    tour[k] = best;
    current = best;
  }
  return tour;
}

// k nearest neighbours per vertex, sorted by distance (ties by index).
function neighborLists(n, d, k) {
  const lists = new Array(n);
  const candidates = new Array(n - 1);
  for (let i = 0; i < n; i++) {
    let t = 0;
    for (let j = 0; j < n; j++) if (j !== i) candidates[t++] = j;
    const distances = new Float64Array(n);
    for (let j = 0; j < n; j++) distances[j] = d(i, j);
    candidates.sort((a, b) => distances[a] - distances[b] || a - b);
    lists[i] = Int32Array.from(candidates.slice(0, k));
  }
  return lists;
}

function neighborListTwoOpt(tour, d, neighbors) {
  const n = tour.length;
  const pos = new Int32Array(n);
  for (let i = 0; i < n; i++) pos[tour[i]] = i;
  const next = (c) => tour[(pos[c] + 1) % n];
  const prev = (c) => tour[(pos[c] - 1 + n) % n];

  // Reverse the path from position i forward to position j (inclusive, wrapping), by
  // reversing whichever of the path or its complement is shorter; both give the same cycle.
  const reversePath = (i, j) => {
    let length = ((j - i + n) % n) + 1;
    if (length * 2 > n) {
      const ni = (j + 1) % n;
      const nj = (i - 1 + n) % n;
      i = ni;
      j = nj;
      length = n - length;
    }
    for (let s = 0; s < length >> 1; s++) {
      const a = (i + s) % n;
      const b = (j - s + n) % n;
      const tmp = tour[a];
      tour[a] = tour[b];
      tour[b] = tmp;
      pos[tour[a]] = a;
      pos[tour[b]] = b;
    }
  };

  const queue = new Int32Array(n * 4);
  let head = 0;
  let tail = 0;
  const queued = new Uint8Array(n);
  const push = (c) => {
    if (queued[c]) return;
    queued[c] = 1;
    queue[tail] = c;
    tail = (tail + 1) % queue.length;
  };
  for (let i = 0; i < n; i++) push(tour[i]);

  let budget = 50_000_000;
  while (head !== tail && budget-- > 0) {
    const a = queue[head];
    head = (head + 1) % queue.length;
    queued[a] = 0;
    let improved = true;
    while (improved) {
      improved = false;
      // Successor direction: edges (a,b) and (c,dd) become (a,c) and (b,dd).
      {
        const b = next(a);
        const dab = d(a, b);
        const list = neighbors[a];
        for (let t = 0; t < list.length; t++) {
          const c = list[t];
          const dac = d(a, c);
          if (dac >= dab) break;
          const dd = next(c);
          if (c === b || dd === a) continue;
          const delta = dac + d(b, dd) - dab - d(c, dd);
          if (delta < -1e-9) {
            reversePath(pos[b], pos[c]);
            push(a);
            push(b);
            push(c);
            push(dd);
            improved = true;
            break;
          }
        }
      }
      if (improved) continue;
      // Predecessor direction: edges (b,a) and (dd,c) become (c,a) and (dd,b).
      {
        const b = prev(a);
        const dab = d(a, b);
        const list = neighbors[a];
        for (let t = 0; t < list.length; t++) {
          const c = list[t];
          const dac = d(a, c);
          if (dac >= dab) break;
          const dd = prev(c);
          if (c === b || dd === a) continue;
          const delta = dac + d(b, dd) - dab - d(c, dd);
          if (delta < -1e-9) {
            reversePath(pos[c], pos[b]);
            push(a);
            push(b);
            push(c);
            push(dd);
            improved = true;
            break;
          }
        }
      }
    }
  }
}
lineage-record.json
{
  "id": "lin_vn1ytwcyjd434kpk",
  "child": "prop_c9tqjmqjwcbebvz4",
  "parents": [
    "bl_nearest-neighbor-v1",
    "prop_0n8x79dn5j4b1xsd"
  ],
  "relation": "derives",
  "createdAt": "2026-10-17T17:10:28.340Z",
  "evaluationId": "eval_0fpy0w4b5907wmbe",
  "schemaVersion": "0.1"
}