SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.16012 · 2026

Towards Efficient Constraint Handling in Neural Solvers for Routing Problems

Jie Zhang, Yining Ma, Zhiguang Cao, Wen Song, Jieyi Bi, Cathy Wu, Jianan Zhou, Yaoxin Wu

arXiv · PDF · Open in the Atlas

Code that ran

19 of 25 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 5 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 13 failures of our instrument; 6 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2602.16012.json · badge: /api/ran/2602.16012.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jieyibi/CaR-constraint canonical (classifier label)
classifier basis: census
19 ran · 6 no recorded run
FunctionStatusWhere it lives
Euc_distance Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/baselines/OR-Tools_baseline.py
code served (permissive licence) · get_code("b614c1ddea8c410f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function takes two positions (tuples/lists with at least 2 elements)
# and computes Euclidean distance between them
position_1 = (0, 0)
position_2 = (3, 4)

ARGS = {
    "position_1": position_1,
    "position_2": position_2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_vrp_cost Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jieyibi/CaR-constraint/baselines/HGS_pyvrp_baseline.py
code served (permissive licence) · get_code("8db9a91b0002e752")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Define the arguments for calc_vrp_cost
depot = np.array([0.0, 0.0])  # depot at origin, 2D coordinates

loc = np.array([
    [1.0, 1.0],
    [2.0, 2.0],
    [3.0, 1.0],
    [2.0, 0.5]
])  # 4 customer locations, 2D coordinates

tour = np.array([1, 2, 3, 4])  # visit nodes 1-4 (1-indexed, corresponding to loc rows)

problem = 'CVRP'  # Capacitated Vehicle Routing Problem

ARGS = {
    'depot': depot,
    'loc': loc,
    'tour': tour,
    'problem': problem
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_vrp_cost Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jieyibi/CaR-constraint/baselines/LKH_baseline.py
code served (permissive licence) · get_code("83dadb20cccdae82")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct valid arguments for calc_vrp_cost

# Create a small depot location (2D coordinates)
depot = np.array([0.0, 0.0])

# Create 5 location nodes (2D coordinates)
loc = np.array([
    [1.0, 0.0],
    [1.0, 1.0],
    [0.0, 1.0],
    [-1.0, 0.0],
    [-1.0, -1.0]
])

# Create a valid tour visiting all nodes 1-5 (node 0 is depot, added implicitly)
# The tour must contain indices 1 through len(loc) in some order
tour = np.array([1, 2, 3, 4, 5])

# Problem type - using a valid problem type that's implemented
problem = 'CVRP'

ARGS = {
    'depot': depot,
    'loc': loc,
    'tour': tour,
    'problem': problem
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_distance Ran
ran, honoured the contract we drafted
jieyibi/CaR-constraint/baselines/greedy_parallel.py
code served (permissive licence) · get_code("a2d50d249f007e4e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function calculate_distance takes two points (p1, p2) and computes
# the Euclidean distance between them using np.linalg.norm.
# Both parameters should be array-like objects (lists, tuples, or numpy arrays).

p1 = [1.0, 2.0, 3.0]
p2 = [4.0, 5.0, 6.0]

ARGS = {
    "p1": p1,
    "p2": p2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_data_model Ran
ran on a synthesized input
jieyibi/CaR-constraint/baselines/OR-Tools_baseline.py
code served (permissive licence) · get_code("939dcf5fde45950d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

SCALE = 100000

ARGS = {
    'depot': (0.0, 0.0),
    'loc': [(1.0, 2.0), (3.0, 4.0), (5.0, 6.0)],
    'demand': [10, 20, 30],
    'capacity': 100,
    'route_limit': 500,
    'service_time': [5],
    'tw_start': [0, 10, 20, 30],
    'tw_end': [100, 50, 60, 70],
    'draft': [5, 10, 15],
    'grid_size': 1,
    'problem': 'CVRP'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
estimate_batch_size Ran
ran, honoured the contract we drafted
jieyibi/CaR-constraint/analysis/grid_search.py
code served (permissive licence) · get_code("90ca1feb298895ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# estimate_batch_size(s, p)
# - multiplies s * p to get sp
# - divides 10000 by sp
# - both s and p are used in arithmetic, so they should be numeric (int or float)

s = 5
p = 8

ARGS = {
    "s": s,
    "p": p,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
fast_multi_head_attention Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/models/SINGLEModel.py
code served (permissive licence) · get_code("57f3aff50aa7f611")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 15) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors with distinct dimension sizes for interpretability
batch_size = 2
head_num = 3
n = 4  # query sequence length
key_dim = 5
input_s = 6  # key/value sequence length

# q: (batch_s, head_num, n, key_dim)
q = torch.randn(batch_size, head_num, n, key_dim)

# k: (batch_s, head_num, input_s, key_dim)
k = torch.randn(batch_size, head_num, input_s, key_dim)

# v: (batch_s, head_num, input_s, key_dim)
v = torch.randn(batch_size, head_num, input_s, key_dim)

# rank3_ninf_mask: (batch_s, n, input_s) with -inf for masked positions
rank3_ninf_mask = torch.zeros(batch_size, n, input_s)
# Mask out some positions with -inf
rank3_ninf_mask[0, 0, 3:] = float('-inf')
rank3_ninf_mask[1, 2:, 4:] = float('-inf')

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "rank3_ninf_mask": rank3_ninf_mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 15) — shape (2, 4, 15) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_opt_sol_path Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/utils.py
code served (permissive licence) · get_code("dad6cf482598ad57")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import sys

ARGS = {
    'dir': '/tmp/test_opt_solutions',
    'problem': 'CVRP',
    'size': 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_time_horizon Ran
ran, honoured the contract we drafted
jieyibi/CaR-constraint/baselines/OR-Tools_baseline.py
code served (permissive licence) · get_code("d0bd680f5f2b3b80")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    'problem': 'TSPTW',
    'problem_size': 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
greedy_tsptw_instance Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/baselines/greedy_parallel.py
code served (permissive licence) · get_code("dc03804de3dda999")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small TSP instance with time windows
num_nodes = 5

# node_xy: coordinates for each node (5 nodes, 2D coordinates)
node_xy = np.array([
    [0.0, 0.0],    # depot
    [1.0, 2.0],
    [3.0, 1.0],
    [2.0, 4.0],
    [4.0, 3.0]
])

# service_time: service duration at each node
service_time = np.array([0.0, 1.0, 1.0, 1.0, 1.0])

# tw_start: time window start for each node
tw_start = np.array([0.0, 1.0, 2.0, 3.0, 4.0])

# tw_end: time window end for each node
tw_end = np.array([100.0, 10.0, 12.0, 14.0, 16.0])

instance = (node_xy, service_time, tw_start, tw_end)

ARGS = {
    "instance": instance,
    "heuristics": "length"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
hamming_distance Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jieyibi/CaR-constraint/analysis/similarity.py
code served (permissive licence) · get_code("6c620551834a7442")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# route1 and route2 should be sequences (lists, tuples, or similar) that can be indexed
# The function compares elements at each position, so they need to support indexing and length
route1 = [0, 1, 2, 3, 4]
route2 = [0, 1, 5, 3, 4]

ARGS = {
    'route1': route1,
    'route2': route2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
hamming_distance_vectorized Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/analysis/diversity.py
code served (permissive licence) · get_code("00cc8946a1c331bf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (1,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor of binary solutions
# Shape: (solution_size=2, solution_length=4)
# Each row is a binary solution
solutions = torch.tensor([
    [1, 0, 1, 0],
    [1, 1, 0, 0]
], dtype=torch.float32)

ARGS = {
    "solutions": solutions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (1,) — shape (1,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
jaccard_distance_vectorized Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/analysis/diversity.py
code served (permissive licence) · get_code("0e79c3e2c2672651")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (1,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor of solutions
# Shape: (solution_size=2, solution_length=4)
# Each row represents a solution with values that will be used to create one-hot encoding
solutions = torch.tensor([
    [0, 1, 2, 1],
    [1, 2, 3, 0]
], dtype=torch.long)

ARGS = {
    "solutions": solutions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (1,) — shape (1,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
levenshtein_distance Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jieyibi/CaR-constraint/analysis/similarity.py
code served (permissive licence) · get_code("d345ac1930735cb8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function levenshtein_distance takes two routes and computes edit distance
# Routes are sequences that can be compared element-by-element
# They should be indexable and support len()

# Create two sample routes as lists of integers
route1 = [1, 2, 3, 4, 5]
route2 = [1, 2, 4, 5, 6]

ARGS = {
    "route1": route1,
    "route2": route2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_data Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/baselines/greedy_parallel.py
code served (permissive licence) · get_code("faf4e1c4deeb8f60")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
filepath = os.path.join(temp_dir, "test_data.pkl")

# Create some sample data and pickle it
sample_data = {
    "key1": [1, 2, 3, 4],
    "key2": "test_string",
    "key3": {"nested": "dict"}
}

with open(filepath, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    "filepath": filepath
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
multi_head_attention Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/models/SINGLEModel.py
code served (permissive licence) · get_code("657ae188fd7e1f14")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 15) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Define dimensions - use distinct sizes for different meanings
batch_size = 2
head_num = 3
n = 4  # query sequence length
key_dim = 5  # dimension per head
input_s = 6  # key/value sequence length

# Create query, key, value tensors
# q shape: (batch_size, head_num, n, key_dim)
q = torch.randn(batch_size, head_num, n, key_dim)

# k shape: (batch_size, head_num, input_s, key_dim)
k = torch.randn(batch_size, head_num, input_s, key_dim)

# v shape: (batch_size, head_num, input_s, key_dim)
v = torch.randn(batch_size, head_num, input_s, key_dim)

# rank2_ninf_mask: shape (batch_size, input_s)
# Used as rank2_ninf_mask[:, None, None, :].expand(batch_s, head_num, n, input_s)
rank2_ninf_mask = torch.full((batch_size, input_s), float('-inf'))

# rank3_ninf_mask: shape (batch_size, n, input_s)
# Used as rank3_ninf_mask[:, None, :, :].expand(batch_s, head_num, n, input_s)
rank3_ninf_mask = torch.full((batch_size, n, input_s), float('-inf'))

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "rank2_ninf_mask": rank2_ninf_mask,
    "rank3_ninf_mask": rank3_ninf_mask,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 15) — shape (2, 4, 15) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
positional_jaccard_distance Ran
ran, honoured the contract we drafted
jieyibi/CaR-constraint/analysis/diversity.py
code served (permissive licence) · get_code("308ec540b94dd9ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (6,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor of solutions (permutations or discrete assignments)
# Shape: (solution_size, solution_length)
# Each row represents one solution
solutions = torch.tensor([
    [0, 1, 2, 3],
    [0, 1, 3, 2],
    [1, 0, 2, 3],
    [0, 2, 1, 3]
], dtype=torch.long)

ARGS = {
    "solutions": solutions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (6,) — shape (6,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_hgs_vrplib Ran
ran, honoured the contract we drafted
jieyibi/CaR-constraint/baselines/HGS_pyvrp_baseline.py
code served (permissive licence) · get_code("110b4de489553a90")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tempfile
import os

# Create a temporary file with valid VRPLIB route format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
filename = temp_file.name

# Write sample route data
# The function expects:
# - Lines starting with "Route"
# - Format: "Route <number>: <space-separated node ids>"
# - The tour should have nodes 0 to n (where n is the max node id)
# - Total nodes in tour (excluding Route markers) should equal n

n = 5
routes_content = """Route 1: 1 2 3
Route 2: 4 5
"""

temp_file.write(routes_content)
temp_file.close()

ARGS = {
    'filename': filename,
    'n': n
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
reshape_by_heads Ran
ran; our contract draft was wrong, not the code
jieyibi/CaR-constraint/models/SINGLEModel.py
pointer only (licence: MIT); the stored copy get_code serves, from yihang0410/RADAR, is pointer only (licence: NONE) · get_code("459fe521069329c6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yihang0410/RADAR, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

check_mem Not yet run
unverified (harvested, no recorded run)
jieyibi/CaR-constraint/utils.py
code served (permissive licence) · get_code("f17c01b663993e4e")
How it ran

no invocation recorded.

get_env Not yet run
unverified (harvested, no recorded run)
jieyibi/CaR-constraint/utils.py
code served (permissive licence) · get_code("f85cae57b28101a3")
How it ran

no invocation recorded.

get_hgs_cvrp_executable Not yet run
unverified (harvested, no recorded run)
jieyibi/CaR-constraint/baselines/HGS_baseline.py
code served (permissive licence) · get_code("add84ba016364520")
How it ran

no invocation recorded.

get_hgs_vrptw_executable Not yet run
unverified (harvested, no recorded run)
jieyibi/CaR-constraint/baselines/HGS_baseline.py
code served (permissive licence) · get_code("53d638ee9f6282f9")
How it ran

no invocation recorded.

get_lkh_executable Not yet run
unverified (harvested, no recorded run)
jieyibi/CaR-constraint/baselines/LKH_baseline.py
code served (permissive licence) · get_code("d3630ff1f12d5a6e")
How it ran

no invocation recorded.

plot_cvrp_trajectory000 Not yet run
unverified (harvested, no recorded run)
jieyibi/CaR-constraint/analysis/similarity.py
code served (permissive licence) · get_code("b2c62640d0b5e307")
How it ran

no invocation recorded.

Also present in other papers' code

Of 25 samples lifted from this paper's linked repositories, 25 carry a function identity and 0 do not. Of the 25 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 23 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
reshape_by_heads 28 other papers
24 dated earlier, 3 later, 1 undated · 15 only as an assembly brick
2010.16011 (2020-10)
POMO: Policy Optimization with Multiple Optima for Reinforcement Learning
2106.11113 (2021-06)
Matrix Encoding Networks for Neural Combinatorial Optimization
2203.15386 (2022-03)
Pareto Set Learning for Neural Multi-objective Combinatorial Optimization
and 25 more not named here
check_mem 1 other paper
1 dated earlier
2310.10071 (2023-10)
ZoomTrack: Target-aware Non-uniform Resizing for Efficient Visual Tracking

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Neural solvers have achieved impressive progress in addressing simple routing problems, particularly excelling in computational efficiency. However, their advantages under complex constraints remain nascent, for which current constraint-handling schemes via feasibility masking or implicit feasibility awareness can be inefficient or inapplicable for hard constraints. In this paper, we present Construct-and-Refine (CaR), the first general and efficient constraint-handling framework for neural routing solvers based on explicit learning-based feasibility refinement. Unlike prior construction-search hybrids that target reducing optimality gaps through heavy improvements yet still struggle with hard constraints, CaR achieves efficient constraint handling by designing a joint training framework that guides the construction module to generate diverse and high-quality solutions well-suited for a lightweight improvement process, e.g., 10 steps versus 5k steps in prior work. Moreover, CaR presents the first use of construction-improvement-shared representation, enabling potential knowledge sharing across paradigms by unifying the encoder, especially in more complex constrained scenarios. We evaluate CaR on typical hard routing constraints to showcase its broader applicability. Results demonstrate that CaR achieves superior feasibility, solution quality, and efficiency compared to both classical and neural state-of-the-art solvers. Our code, pre-trained models, and datasets are available at: https://github.com/jieyibi/CaR-constraint. Vehicle Routing Problems (VRPs) often involve complex real-world constraints (Wu et al., 2023). Classic VRP solvers, such as LKH-3 (Helsgaun, 2017) and OR-Tools (Furnon & Perron, 2024), have relied on heuristics carefully designed by human experts to handle these constraints and approximate near-optimal solutions. Recently, Neural Combinatorial Optimization (NCO) methods (Bengio et al., 2021) have offered a different path: they automate solver design with deep learning and exploit GPUbatched inference for high efficiency while ensuring solution quality (Kwon et al., 2020). However, recent work has primarily targeted simple variants, leaving their potential on hard-constrained VRPs underexplored. In those more complex settings, where hand-crafted heuristics often leave certain research gaps, reinforcement learning (RL)-based methods may offer a promising alternative by learning to navigate constraints directly from data. This makes effective constraint handling a key challenge in advancing the broader applicability of NCO to real-world VRPs. Most RL-based NCO solvers handle constraints via two schemes: feasibility masking and implicit feasibility awareness. Feasibility masking enforces constraints by excluding invalid actions in the Markov Decision Process (MDP). While effective for simple MDPs, it becomes intractable in complex cases where computing mask itself is NP-hard, e.g., with complex local search operators in neural improvement solvers (Ma et al., 2023), or with interdependent constraints in neural construction Work done during the author's internship at MIT.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2602.16012")
get_code_for_paper("2602.16012")
have("2602.16012")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2602.16012.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2602.16012.svg)](https://syntology.ai/paper/2602.16012)

Connect an agent — have() is free.