SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2508.18742 · ICLR · 2025

Constraint Matters: Multi-Modal Representation for Reducing Mixed-Integer Linear programming

Yixuan Li, Zhiyuan Liu, Xiongwei Han, Jiajun Li, Tao Zhong, Ran Hou, Yu Ding, Shisi Guan, Jiahui Duan, Vincent Chau, Weiwei Wu, Wanyuan Wang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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; 4 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2508.18742.json · badge: /api/ran/2508.18742.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
Liwow/Constraint_Matters canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
EnergyWeightNorm Ran
ran, honoured the contract we drafted
Liwow/Constraint_Matters/model_train.py
code served (permissive licence) · get_code("93c1d81687817cc4")
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)

# The function EnergyWeightNorm takes a single parameter 'task' which is a string
# It returns different numerical values based on the task string
# Valid task values are: 'IP', 'WA', 'CA', 'case118', 'IS', 'MVC', 'MMCN2'

# We'll test with one of the valid task strings
ARGS = {
    'task': 'IP'
}
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
get_gp_best_objective Ran
ran, honoured the contract we drafted
Liwow/Constraint_Matters/gp_tools.py
code served (permissive licence) · get_code("74a1b5ec31152218")
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 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 os
import tempfile
import shutil

# Create a temporary directory with test log files
temp_dir = tempfile.mkdtemp()

# Create test log files with "Best objective" patterns
log_file_1 = os.path.join(temp_dir, "log_1.txt")
with open(log_file_1, 'w') as f:
    f.write("Starting optimization...\n")
    f.write("Iteration 1: Best objective 42.5\n")
    f.write("Iteration 2: Best objective 41.3\n")

log_file_2 = os.path.join(temp_dir, "log_2.txt")
with open(log_file_2, 'w') as f:
    f.write("Starting optimization...\n")
    f.write("Iteration 1: Best objective 3.14e-2\n")

log_file_3 = os.path.join(temp_dir, "log_3.txt")
with open(log_file_3, 'w') as f:
    f.write("Starting optimization...\n")
    f.write("Best objective 1.23e+1\n")

# File with no matching pattern (should be skipped)
log_file_4 = os.path.join(temp_dir, "log_4.txt")
with open(log_file_4, 'w') as f:
    f.write("No objective here\n")

ARGS = {
    'log_folder': temp_dir
}
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 list, ndim 1, dtype family float — 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
get_label_by_kmeans Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Liwow/Constraint_Matters/utils.py
code served (permissive licence) · get_code("c6d856dec4a03e0d")
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
from sklearn.cluster import KMeans

# Create sample 1D values for clustering
values = [1.2, 1.5, 10.3, 10.8, 1.1, 10.5]

# Define arguments for get_label_by_kmeans
ARGS = {
    "values": values,
    "n_type": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
get_pair Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Liwow/Constraint_Matters/utils.py
code served (permissive licence) · get_code("611af454b0343eff")
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 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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function signature and body:
# get_pair(critical_list, labels, critical_num)
# - critical_list: used with len() and indexing [i], checked against labels length
# - labels: used with len() and indexing [i], checked for truthiness
# - critical_num: passed to normalize_to_range() which expects a numeric list

# Build appropriate test data
critical_list = [True, False, True, False]
labels = [True, False, False, True]
critical_num = [1.0, 2.5, 0.5, 3.0]

ARGS = {
    "critical_list": critical_list,
    "labels": labels,
    "critical_num": critical_num,
}
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 list, ndim 1, dtype family float — 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
is_consecutive_x_vars Ran
ran, violated the contract we drafted
Liwow/Constraint_Matters/model_test_SCIP.py
code served (permissive licence) · get_code("26ddb201d6328fec")
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 bool, ndim 0, dtype family float, 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

# Construct valid arguments for is_consecutive_x_vars
# The function takes var_names (a list of strings) as input
# It checks if the names follow the pattern 'x<number>' where numbers are consecutive and < 20

# Test case 1: Valid consecutive x variables
var_names_valid = ['x0', 'x1', 'x2']

ARGS = {
    'var_names': var_names_valid
}
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 bool, ndim 0, dtype family float, 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
lr_lambda Ran
ran, honoured the contract we drafted
Liwow/Constraint_Matters/model_train.py
code served (permissive licence) · get_code("8a835e50ad8eb43b")
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)

def lr_lambda(epoch):
    return 1 if epoch < 185 else 0.95 ** ((epoch + 1) // 5)

ARGS = {
    "epoch": 100
}
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
position_get_ordered_flt Ran
ran; our contract draft was wrong, not the code
Liwow/Constraint_Matters/helper.py
code served (permissive licence) · get_code("b1d4d6b616addfd4")
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 2, dtype family float, shape (2, 24) 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 variable_features tensor
# The function expects shape (lens, feature_dim) where it accesses [:, 1]
# lens is the number of samples, feature dimension should be at least 2
variable_features = torch.randn(2, 4)

ARGS = {
    "variable_features": variable_features
}
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 2, dtype family float, shape (2, 24) — shape (2, 24) 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
split_sample_by_blocks Ran
ran; our contract draft was wrong, not the code
Liwow/Constraint_Matters/utils.py
code served (permissive licence) · get_code("c944612a00b4ca44")
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 random
import re

# Construct valid arguments for split_sample_by_blocks
sample_files = [
    "file_1.txt",
    "file_2.txt",
    "file_3.txt",
    "file_4.txt",
    "file_5.txt",
    "file_6.txt",
    "file_7.txt",
    "file_8.txt",
]

train_rate = 0.7

block_size = 3

ARGS = {
    "sample_files": sample_files,
    "train_rate": train_rate,
    "block_size": block_size,
}
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 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
test_hyperparam Ran
ran, honoured the contract we drafted
Liwow/Constraint_Matters/model_test_SCIP.py
code served (permissive licence) · get_code("e102f269252a0188")
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, 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 torch

torch.manual_seed(0)

ARGS = {
    'task': 'IP'
}
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 tuple, ndim 1, dtype family int — a tuple 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

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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-24.

Repositories linked to this paper

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

Abstract

Model reduction, which aims to learn a simpler model of the original mixed integer linear programming (MILP), can solve large-scale MILP problems much faster. Most existing model reduction methods are based on variable reduction, which predicts a solution value for a subset of variables. From a dual perspective, constraint reduction that transforms a subset of inequality constraints into equalities can also reduce the complexity of MILP, but has been largely ignored. Therefore, this paper proposes a novel constraint-based model reduction approach for MILPs. Constraint-based MILP reduction has two challenges: 1) which inequality constraints are critical such that reducing them can accelerate MILP solving while preserving feasibility, and 2) how to predict these critical constraints efficiently. To identify critical constraints, we label the tight-constraints at the optimal solution as potential critical constraints and design an information theory-guided heuristic rule to select a subset of critical tight-constraints. Theoretical analyses indicate that our heuristic mechanism effectively identify the constraints most instrumental in reducing the solution space and uncertainty. To learn the critical tight-constraints, we propose a multi-modal representation that integrates information from both instance-level and abstract-level MILP formulations. The experimental results show that, compared to the state-of-the-art MILP solvers, our method improves the quality of the solution by over 50% and reduces the computation time by 17.47%. Our source code is publicly available at https://github.com/Liwow/Constraint_Matters.

For agents

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

get_harvested_code_for_paper("2508.18742")
get_code_for_paper("2508.18742")
have("2508.18742")

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

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

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

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

Connect an agent — have() is free.