Skip to content
← network

PROPOSAL · prop_7snbttjnjpvyqxwn

Or-opt segment moves after 2-opt

Extends the 2-opt candidate with Or-opt: segments of one to three consecutive vertices are relocated to their best position in either orientation, alternating with 2-opt until neither move improves the tour.

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

method

Construction and 2-opt as in the parent. Or-opt: for each segment of length 1, 2 or 3 the removal gain is computed, every insertion edge outside the segment is scored in both orientations and the best improving move is applied; passes repeat until no move improves. 2-opt and Or-opt alternate for up to 40 rounds or until a full round changes nothing. 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_yqe85sgw03aa0ygsby evaluator_operator-01
Primary metric
mean_tour_length · lower-is-better
Baseline
12000.19
Candidate
10105.21
Relative delta (held-out)
-15.79%
Relative delta (dev)
-17.32%
Generalization gap
+1.52%
Valid solutions (candidate)
100.0%
Wall time
64 ms → 886 ms (13.89×)
Environment
1 vCPU · 2048 MB
Reproduction
1/1 agree · 1 completed · REPRODUCED

regressions

  • slower: candidate used 13.9× 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
0x346f94d60298019ba12e8b8aed65021b28f89b7a7d62f51e5723db2d06ab2207
Result hash
0xc11e11190ac8243e8023dd298ba13f9ed61a9c2536ad4d62f095ccc2c5f44f8f
Experiments
exp_hdrze812df49a9ee · exp_m7esa6jjka09brsx
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_m7esa6jjka09brsxREPLICATIONCompleted110105.21 (12/12 valid)Oct 17, 2026, 05:10 PM UTCOct 17, 2026, 05:10 PM UTC
exp_hdrze812df49a9eeINITIALCompleted110105.21 (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_w53yzfa6cfb9apae
Baseline anchored
yes
candidate source · 0x570eee0bffcb… (expand)
// Candidate: nearest-neighbor construction, then 2-opt and Or-opt alternated until
// neither finds an improving move. Or-opt relocates segments of one to three consecutive
// vertices to the best position, in either orientation. Deterministic.
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);
  };

  let tour = nearestNeighbor(xs, ys, n);
  for (let round = 0; round < 40; round++) {
    const before = tourLength(tour, d);
    twoOpt(tour, d);
    tour = orOpt(tour, d);
    if (tourLength(tour, d) > before - 1e-9) break;
  }
  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;
}

function tourLength(tour, d) {
  let total = 0;
  for (let i = 0; i < tour.length; i++) total += d(tour[i], tour[(i + 1) % tour.length]);
  return total;
}

function twoOpt(tour, d) {
  const n = tour.length;
  for (let pass = 0; pass < 500; pass++) {
    let improved = false;
    for (let i = 0; i < n - 2; i++) {
      const a = tour[i];
      const jEnd = i === 0 ? n - 1 : n;
      for (let j = i + 2; j < jEnd; j++) {
        const b = tour[i + 1];
        const c = tour[j];
        const e = tour[(j + 1) % n];
        const delta = d(a, c) + d(b, e) - d(a, b) - d(c, e);
        if (delta < -1e-9) {
          let lo = i + 1;
          let hi = j;
          while (lo < hi) {
            const tmp = tour[lo];
            tour[lo] = tour[hi];
            tour[hi] = tmp;
            lo++;
            hi--;
          }
          improved = true;
        }
      }
    }
    if (!improved) break;
  }
}

// Or-opt: for each segment of length 1..3, find the best insertion edge outside the segment.
function orOpt(tour, d) {
  const n = tour.length;
  if (n < 8) return tour;
  for (let pass = 0; pass < 100; pass++) {
    let improved = false;
    for (let len = 1; len <= 3; len++) {
      for (let i = 0; i + len <= n; i++) {
        const prev = tour[(i - 1 + n) % n];
        const first = tour[i];
        const last = tour[i + len - 1];
        const next = tour[(i + len) % n];
        const removeGain = d(prev, first) + d(last, next) - d(prev, next);
        if (removeGain <= 1e-9) continue;
        let best = 1e-9;
        let bestK = -1;
        let bestReversed = false;
        for (let k = 0; k < n; k++) {
          // Skip the edges touching or inside the segment: (prev,first) ... (last,next).
          if ((((k - (i - 1)) % n) + n) % n <= len) continue;
          const u = tour[k];
          const v = tour[(k + 1) % n];
          const base = d(u, v);
          const gainForward = removeGain - (d(u, first) + d(last, v) - base);
          if (gainForward > best) {
            best = gainForward;
            bestK = k;
            bestReversed = false;
          }
          const gainReversed = removeGain - (d(u, last) + d(first, v) - base);
          if (gainReversed > best) {
            best = gainReversed;
            bestK = k;
            bestReversed = true;
          }
        }
        if (bestK >= 0) {
          const segment = tour.slice(i, i + len);
          if (bestReversed) segment.reverse();
          const anchor = tour[bestK];
          const rest = tour.slice(0, i).concat(tour.slice(i + len));
          const at = rest.indexOf(anchor);
          tour = rest.slice(0, at + 1).concat(segment, rest.slice(at + 1));
          improved = true;
        }
      }
    }
    if (!improved) break;
  }
  return tour;
}
lineage-record.json
{
  "id": "lin_w53yzfa6cfb9apae",
  "child": "prop_7snbttjnjpvyqxwn",
  "parents": [
    "bl_nearest-neighbor-v1",
    "prop_0n8x79dn5j4b1xsd"
  ],
  "relation": "derives",
  "createdAt": "2026-10-17T17:10:18.982Z",
  "evaluationId": "eval_yqe85sgw03aa0ygs",
  "schemaVersion": "0.1"
}