SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.07041 · 2024

Ant Colony Sampling with GFlowNets for Combinatorial Optimization

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2403.07041.json · badge: /api/ran/2403.07041.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
ai4co/gfacs canonical (classifier label)
classifier basis: census
10 ran · 0 no recorded run
FunctionStatusWhere it lives
cal_fitness Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ai4co/gfacs/bpp/aco.py
code served (permissive licence) · get_code("e4bad5bb67d2cd61")
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 ndarray, ndim 1, dtype family float, shape (3,) 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
import numba

# Analyze the function:
# - s: np.ndarray, shape (n, m) - 2D array of integers
# - demand: np.ndarray - 1D array indexed by s values
# - n_bins: np.ndarray - 1D array, length n (number of rows in s)

# The function iterates through s[i, j] and indexes demand[s[i, j]]
# So demand needs to be at least as long as max value in s
# n_bins is indexed by row i, so needs length equal to number of rows in s

# Create small distinct dimensions
n = 3  # number of rows (solutions)
m = 5  # number of columns (items per solution)
max_item_id = 4  # maximum value that can appear in s

# s: shape (3, 5) - each row is a solution with item indices
s = np.array([
    [0, 1, 2, 0, 3],
    [0, 2, 1, 1, 0],
    [0, 3, 2, 0, 1]
], dtype=np.int64)

# demand: 1D array where demand[i] is the demand for item i
# Need at least max_item_id+1 elements (for indices 0 to max_item_id)
demand = np.array([0.0, 1.5, 2.0, 3.5, 2.5], dtype=np.float64)

# n_bins: 1D array with length n (one entry per solution/row)
n_bins = np.array([2.0, 3.0, 1.5], dtype=np.float64)

ARGS = {
    "s": s,
    "demand": demand,
    "n_bins": n_bins
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (3,) — shape (3,) 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)
ai4co/gfacs/cvrp_nls/lkh.py
code served (permissive licence) · get_code("f4b9a37d67290bfd")
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

# Create a simple depot (starting point) - 2D coordinates
depot = np.array([0.0, 0.0])

# Create locations for 4 nodes (must be 2D coordinates to match depot dimensionality)
loc = np.array([
    [1.0, 0.0],
    [1.0, 1.0],
    [0.0, 1.0],
    [-1.0, 0.0]
])

# Create a valid tour visiting all nodes exactly once
# Tour must contain nodes numbered 1 to len(loc) in some order
tour = np.array([1, 2, 3, 4])

ARGS = {
    "depot": depot,
    "loc": loc,
    "tour": tour
}
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
check_extension Ran
ran; our contract draft was wrong, not the code
ai4co/gfacs/cvrp_nls/lkh.py
code served (permissive licence) · get_code("01df1926cf07ac89")
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

def check_extension(filename):
    if os.path.splitext(filename)[1] != '.pkl':
        return filename + '.pkl'
    return filename

ARGS = {
    'filename': 'myfile.txt'
}
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
count_last_zero Ran
ran, honoured the contract we drafted
ai4co/gfacs/bpp/aco.py
code served (permissive licence) · get_code("01aaf3a4a24be900")
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 ndarray, ndim 1, dtype family float, shape (2,) 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
import numba

# Create a simple 2D numpy array with some zeros
# Shape: (2, 4) - 2 rows, 4 columns
x = np.array([
    [1, 2, 0, 0],
    [5, 0, 0, 3]
], dtype=np.float64)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
gen_instance Ran
ran, honoured the contract we drafted
ai4co/gfacs/bpp/utils.py
code served (permissive licence) · get_code("e7e1d6908c528c19")
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)

ARGS = {
    "n": 5,
    "device": torch.device("cpu")
}
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
gen_pyg_data Ran
ran; our contract draft was wrong, not the code
ai4co/gfacs/bpp/utils.py
code served (permissive licence) · get_code("906dfc9d505aae42")
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 Data. 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
from torch_geometric.data import Data

torch.manual_seed(0)

# Create a small demands tensor
# The function uses demands.size(0) to get n, and indexes it with edge_index
# demands should be 1D tensor with values that sum to <= 1 when pairs are checked
demands = torch.tensor([0.3, 0.4, 0.2, 0.1], device='cpu')

ARGS = {
    'demands': demands,
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Data — a Data 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
get_subroutes Ran
ran; our contract draft was wrong, not the code
ai4co/gfacs/cvrp_nls/aco.py
code served (permissive licence) · get_code("46bfbacd7712b160")
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. 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

torch.manual_seed(0)

# Create a route tensor with zeros at various positions
# The function looks for indices where route == 0, then creates subroutes between them
route = torch.tensor([0, 1, 2, 3, 0, 4, 5, 0, 6, 0], dtype=torch.long)

ARGS = {
    "route": route,
    "end_with_zero": True,
}
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 list — a list 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
load_dataset Ran
ran; our contract draft was wrong, not the code
ai4co/gfacs/cvrp_nls/lkh.py
code served (permissive licence) · get_code("69062811f34d8ff6")
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 os
import pickle
import tempfile

# Create a temporary pickle file for testing
temp_dir = tempfile.mkdtemp()
test_data = {"sample": "data", "values": [1, 2, 3]}
test_file_path = os.path.join(temp_dir, "test_dataset.pkl")

with open(test_file_path, 'wb') as f:
    pickle.dump(test_data, f)

# Remove the .pkl extension for the argument to test the check_extension logic
test_filename = os.path.join(temp_dir, "test_dataset")

ARGS = {
    "filename": test_filename
}
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
load_val_dataset Ran
ran; our contract draft was wrong, not the code
ai4co/gfacs/bpp/utils.py
code served (permissive licence) · get_code("f26fe6db8c14c408")
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 os
from unittest.mock import patch, MagicMock

torch.manual_seed(0)

# Create a minimal mock dataset
mock_dataset = {
    'train': torch.randn(2, 4),
    'val': torch.randn(2, 4),
}

# Mock torch.load to return our dataset without requiring file I/O
original_torch_load = torch.load

def mock_torch_load(path, map_location=None):
    return mock_dataset

# Patch torch.load before defining ARGS
with patch('torch.load', side_effect=mock_torch_load):
    pass

# Define ARGS with the parameters the function expects
ARGS = {
    'problem_size': 20,
    'device': 'cpu'
}

# Apply the patch globally so it works when the function is called
torch.load = mock_torch_load
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 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
merge_subroutes Ran
ran, honoured the contract we drafted
ai4co/gfacs/cvrp_nls/aco.py
code served (permissive licence) · get_code("10cea2b2066d40da")
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 int, shape (9,) 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)

# Construct subroutes: list of routes (can be lists or tensors)
# Each route should have length > 2 to pass the len(r) > 2 check
subroute1 = [1, 2, 3, 0]  # list of length 4
subroute2 = torch.tensor([4, 5, 6], dtype=torch.long)  # tensor of length 3
subroute3 = [7, 8, 9, 10, 11]  # list of length 5

subroutes = [subroute1, subroute2, subroute3]

# Total length needed: (4-1) + (3-1) + (5-1) = 3 + 2 + 4 = 9
length = 9

# Device: CPU only
device = 'cpu'

ARGS = {
    'subroutes': subroutes,
    'length': length,
    'device': device
}
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 int, shape (9,) — shape (9,) 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

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 7 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
check_extension 7 other papers
4 dated earlier, 2 later, 1 same year, order not determinable
1803.08475 (2018-03)
Attention, Learn to Solve Routing Problems!
2205.13225 (2022-05)
DevFormer: A Symmetric Transformer for Context-Aware Device Placement
2305.19587 (2023-05)
Towards Omni-generalizable Neural Methods for Vehicle Routing Problems
and 4 more not named here
load_dataset 4 other papers
2 dated earlier, 2 later
1803.08475 (2018-03)
Attention, Learn to Solve Routing Problems!
2205.13225 (2022-05)
DevFormer: A Symmetric Transformer for Context-Aware Device Placement
2410.21066 (2024-10)
Learning to Handle Complex Constraints for Vehicle Routing Problems
and 1 more not named here
calc_vrp_cost 1 other paper
1 later
2410.21066 (2024-10)
Learning to Handle Complex Constraints for Vehicle Routing Problems

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

We present the Generative Flow Ant Colony Sampler (GFACS), a novel meta-heuristic method that hierarchically combines amortized inference and parallel stochastic search. Our method first leverages Generative Flow Networks (GFlowNets) to amortize a \emph{multi-modal} prior distribution over combinatorial solution space that encompasses both high-reward and diversified solutions. This prior is iteratively updated via parallel stochastic search in the spirit of Ant Colony Optimization (ACO), leading to the posterior distribution that generates near-optimal solutions. Extensive experiments across seven combinatorial optimization problems demonstrate GFACS's promising performances.

For agents

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

get_harvested_code_for_paper("2403.07041")
get_code_for_paper("2403.07041")
have("2403.07041")

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

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

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

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

Connect an agent — have() is free.