SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.05100 · ICLR · 2025

MaxCutPool: differentiable feature-aware Maxcut for pooling in graph neural networks

Carlo Abate, Maria Filippo, Bianchi

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 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/2409.05100.json · badge: /api/ran/2409.05100.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
ngmlgroup/maxcutpool canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
eval_cut Ran
ran, honoured the contract we drafted
ngmlgroup/maxcutpool/source/layers/ndp.py
code served (permissive licence) · get_code("7b287b5a769fdd0f")
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 2, dtype family float, shape (1, 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - total_volume: scalar (used in division)
# - L: matrix (used in L.dot(z), so needs dot method - numpy array or torch tensor)
# - z: vector/matrix (used in z.T.dot(...), so needs T attribute and dot method)

# The computation is: cut = z.T.dot(L.dot(z)) / (2 * total_volume)
# This suggests z is a column vector and L is a square matrix (Laplacian-like)

# Using numpy arrays since they have .T and .dot() methods
z = np.array([[1.0], [2.0], [3.0], [4.0]])  # 4x1 column vector
L = np.array([
    [4.0, -1.0, 0.0, -1.0],
    [-1.0, 4.0, -1.0, 0.0],
    [0.0, -1.0, 4.0, -1.0],
    [-1.0, 0.0, -1.0, 4.0]
])  # 4x4 symmetric matrix (Laplacian-like)
total_volume = 10.0  # scalar

ARGS = {
    "total_volume": total_volume,
    "L": L,
    "z": z
}
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 ndarray, ndim 2, dtype family float, shape (1, 1) — shape (1, 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
ndp Ran
ran; our contract draft was wrong, not the code
ngmlgroup/maxcutpool/source/layers/ndp.py
code served (permissive licence) · get_code("21612b0356b35694")
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 torch
import torch.nn as nn
import numpy as np
from torch_geometric.data import Data
from torch_geometric.utils import get_laplacian, to_scipy_sparse_matrix, from_scipy_sparse_matrix
import scipy.sparse as sp

torch.manual_seed(0)

# Create a small graph data object
num_nodes = 5
num_edges = 6

# Create edge index for a small connected graph
edge_index = torch.tensor([
    [0, 1, 1, 2, 2, 3],
    [1, 0, 2, 1, 3, 2]
], dtype=torch.long)

# Create node features
x = torch.randn(num_nodes, 4)

# Create edge weights
edge_weight = torch.ones(edge_index.shape[1])

# Create a PyG Data object
data = Data(x=x, edge_index=edge_index, edge_weight=edge_weight, num_nodes=num_nodes)

# Define the arguments dictionary
ARGS = {
    'data': data,
    'sparsify': True,
    'sparse_thresh': 0.01,
    'return_all': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch, torch_geometric — 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
reset_node_numbers Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ngmlgroup/maxcutpool/source/layers/maxcutpool/utils.py
code served (permissive licence) · get_code("178ea8d8fee146d5")
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 torch
import torch.nn as nn
from torch_geometric.utils import remove_isolated_nodes

torch.manual_seed(0)

# Create a small edge_index tensor with some isolated nodes
# edge_index shape: (2, num_edges)
# Using values that reference nodes 0-4, leaving node 5 isolated
edge_index = torch.tensor([
    [0, 1, 2, 3],
    [1, 2, 3, 4]
], dtype=torch.long)

# Create edge attributes - one attribute per edge
# edge_attr shape: (num_edges, attr_dim)
edge_attr = torch.randn(4, 3)

ARGS = {
    "edge_index": edge_index,
    "edge_attr": edge_attr,
}
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 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
sum_pool Ran
ran; our contract draft was wrong, not the code
ngmlgroup/maxcutpool/source/layers/sum_pool.py
code served (permissive licence) · get_code("6160d5df6f7b6877")
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 DataBatch. 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
from torch_geometric.transforms import Compose

torch.manual_seed(0)

# Construct a small graph Data object
# 6 nodes with 4-dimensional features
x = torch.randn(6, 4)

# Edge index: edges between nodes
# 5 edges represented as [source_nodes, target_nodes]
edge_index = torch.tensor([
    [0, 1, 2, 3, 4],
    [1, 2, 3, 4, 5]
], dtype=torch.long)

# Edge attributes: 4-dimensional features for each edge
edge_attr = torch.randn(5, 3)

# Node positions: 2D positions for 6 nodes
pos = torch.randn(6, 2)

# Batch assignment: which graph each node belongs to (2 graphs)
batch = torch.tensor([0, 0, 0, 1, 1, 1], dtype=torch.long)

# Create Data object with all attributes
data = Data(
    x=x,
    edge_index=edge_index,
    edge_attr=edge_attr,
    pos=pos,
    batch=batch
)

# Cluster vector: assigns each of 6 nodes to a cluster
# This groups nodes into fewer clusters
cluster = torch.tensor([0, 0, 1, 1, 2, 2], dtype=torch.long)

# Transform function (optional): identity transform
def transform_fn(data):
    return data

ARGS = {
    "cluster": cluster,
    "data": data,
    "transform": transform_fn
}
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 DataBatch — a DataBatch 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
sum_pool_neighbor_x Ran
ran; our contract draft was wrong, not the code
ngmlgroup/maxcutpool/source/layers/sum_pool.py
code served (permissive licence) · get_code("9a51386e12a367b6")
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 graph with 3 nodes and 2 edges
num_nodes = 3
num_features = 4

# Node features: shape [num_nodes, num_features]
x = torch.randn(num_nodes, num_features)

# Edge index: shape [2, num_edges]
# Two edges: 0->1 and 1->2
edge_index = torch.tensor([[0, 1], [1, 2]], dtype=torch.long).t().contiguous()

# Create a Data object
data = Data(x=x, edge_index=edge_index, num_nodes=num_nodes)

ARGS = {
    'data': data,
    'flow': 'source_to_target'
}
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
sum_pool_x Ran
ran; our contract draft was wrong, not the code
ngmlgroup/maxcutpool/source/layers/sum_pool.py
code served (permissive licence) · get_code("da4b9b45c0e51020")
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 torch
import torch.nn as nn
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for testing
# cluster: assigns each node to a cluster (values 0 to num_clusters-1)
cluster = torch.tensor([0, 0, 1, 1], dtype=torch.long)

# x: node feature matrix (num_nodes, num_features)
x = torch.randn(4, 3)

# batch: assigns each node to a batch example (values 0 to batch_size-1)
batch = torch.tensor([0, 0, 1, 1], dtype=torch.long)

# size: optional maximum number of clusters per example (can be None)
size = None

ARGS = {
    "cluster": cluster,
    "x": x,
    "batch": batch,
    "size": size,
}
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 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
topk Ran
ran; our contract draft was wrong, not the code
ngmlgroup/maxcutpool/source/layers/maxcutpool/utils.py
code served (permissive licence) · get_code("646276fb3a7e3cef")
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 (4,) 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
from torch import Tensor

torch.manual_seed(0)

# Create sample tensors
# x: Node scores - shape (num_nodes,)
x = torch.randn(8)

# batch: Batch assignments for each node - shape (num_nodes,)
# assigns nodes 0-3 to graph 0, nodes 4-7 to graph 1
batch = torch.tensor([0, 0, 0, 0, 1, 1, 1, 1], dtype=torch.long)

# ratio: keep 50% of nodes per graph (float case)
ratio = 0.5

# min_score: optional minimum score threshold
min_score = None

# tol: tolerance for numerical stability
tol = 1e-7

ARGS = {
    'x': x,
    'ratio': ratio,
    'batch': batch,
    'min_score': min_score,
    'tol': tol,
}
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 Tensor, ndim 1, dtype family int, shape (4,) — shape (4,) 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 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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 propose a novel approach to compute the MAXCUT in attributed graphs, i.e., graphs with features associated with nodes and edges. Our approach works well on any kind of graph topology and can find solutions that jointly optimize the MAXCUT along with other objectives. Based on the obtained MAXCUT partition, we implement a hierarchical graph pooling layer for Graph Neural Networks, which is sparse, trainable end-to-end, and particularly suitable for downstream tasks on heterophilic graphs.

For agents

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

get_harvested_code_for_paper("2409.05100")
get_code_for_paper("2409.05100")
have("2409.05100")

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

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

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

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

Connect an agent — have() is free.