SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.09036 · 2026

Decision-Focused Learning in Network Interdiction Games

Luca Hartmann

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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; 5 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2608.09036.json · badge: /api/ran/2608.09036.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
lucahart/DFL-for-Shortest-Path-Network-Interdiction canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
feature_cost_mapping Ran
ran, honoured the contract we drafted
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/toy_example/main_funcs.py
code served (permissive licence) · get_code("b9b59c5c9f4ff6ce")
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, 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
import numpy as np

torch.manual_seed(0)

# Test with torch tensor
w_tensor = torch.randn(2, 4, 1)

# Test with numpy array
w_numpy = np.random.randn(2, 4, 1)

# Test with scalar
w_scalar = 5

ARGS = {
    "w": w_tensor
}
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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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
meanstd_anchor Ran
ran; our contract draft was wrong, not the code
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/dflintdpy/predictors/hybrid_spop_loss.py
code served (permissive licence) · get_code("7304276e53214480")
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 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

torch.manual_seed(0)

# Create two small tensors with shape (batch=2, dim=4)
# ctilde and ctrue are compared element-wise for mean and std
ctilde = torch.randn(2, 4)
ctrue = torch.randn(2, 4)

# eps is a small float to avoid division by zero
eps = 1e-08

ARGS = {
    "ctilde": ctilde,
    "ctrue": ctrue,
    "eps": eps,
}
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 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
mse_anchor Ran
ran; our contract draft was wrong, not the code
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/dflintdpy/predictors/hybrid_spop_loss.py
code served (permissive licence) · get_code("0a832639ae3d8f93")
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 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create two small tensors for predicted and true costs
# batch_size=2, cost_dim=4
ctilde = torch.randn(2, 4)
ctrue = torch.randn(2, 4)

ARGS = {
    "ctilde": ctilde,
    "ctrue": ctrue,
}
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 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
optimizer Ran
ran, honoured the contract we drafted
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/toy_example/main_funcs.py
code served (permissive licence) · get_code("5f6fe5b849200fad")
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, 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
import numpy as np

torch.manual_seed(0)

# Test case 1: torch tensor input
c_torch = torch.tensor([
    [1.0, 2.0, 5.0, 6.0],
    [3.0, 4.0, 2.0, 1.0]
])

# Test case 2: numpy array input
c_numpy = np.array([
    [1.0, 2.0, 5.0, 6.0],
    [3.0, 4.0, 2.0, 1.0]
])

# Test case 3: list input
c_list = [1.0, 2.0, 5.0, 6.0]

# Use torch tensor as the primary test case
ARGS = {
    "c": c_torch
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
plot_dfl_init_vs_cvx_vs_spo Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/toy_example/plotting.py
code served (permissive licence) · get_code("9263789c7f6a4c95")
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 Figure. 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
import matplotlib
matplotlib.use('Agg')  # Non-interactive backend
import matplotlib.pyplot as plt

torch.manual_seed(0)

# Create small test data
batch_size = 2
cost_dim = 4

# w_values: weight parameter (batch_size, 1)
w_values = torch.randn(batch_size, 1)

# c_true: true costs (batch_size, cost_dim)
c_true = torch.randn(batch_size, cost_dim)

# c_pred_init, c_pred_cvx, c_pred_spo: predicted costs (batch_size, cost_dim)
c_pred_init = torch.randn(batch_size, cost_dim)
c_pred_cvx = torch.randn(batch_size, cost_dim)
c_pred_spo = torch.randn(batch_size, cost_dim)

# y_true, y_pred_init, y_pred_cvx, y_pred_spo: solution vectors (batch_size, cost_dim)
# These should be binary-like for solution matching
y_true = torch.randint(0, 2, (batch_size, cost_dim), dtype=torch.float32)
y_pred_init = torch.randint(0, 2, (batch_size, cost_dim), dtype=torch.float32)
y_pred_cvx = torch.randint(0, 2, (batch_size, cost_dim), dtype=torch.float32)
y_pred_spo = torch.randint(0, 2, (batch_size, cost_dim), dtype=torch.float32)

# data_train: optional training data as (w_train, _) tuple
w_train = torch.randn(3, 1)
data_train = (w_train, None)

ARGS = {
    'w_values': w_values,
    'c_true': c_true,
    'c_pred_init': c_pred_init,
    'c_pred_cvx': c_pred_cvx,
    'c_pred_spo': c_pred_spo,
    'y_true': y_true,
    'y_pred_init': y_pred_init,
    'y_pred_cvx': y_pred_cvx,
    'y_pred_spo': y_pred_spo,
    'save_path': None,
    'show': False,
    'data_train': data_train,
    'intd': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
plot_dfl_init_vs_trained Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/toy_example/plotting.py
code served (permissive licence) · get_code("7b01fabc88deafa7")
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 Figure. 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

torch.manual_seed(0)

# Create small tensors for the sweep parameter space
batch_size = 2
num_costs = 4

# w_values: sweep parameter values, shape (batch_size, 1) -> will be squeezed to (batch_size,)
w_values = torch.linspace(0, 1, batch_size).unsqueeze(-1)

# c_true: true costs, shape (batch_size, 4)
c_true = torch.randn(batch_size, num_costs)

# c_pred_init: predicted costs from initialized model, shape (batch_size, 4)
c_pred_init = torch.randn(batch_size, num_costs)

# c_pred_trained: predicted costs from trained model, shape (batch_size, 4)
c_pred_trained = torch.randn(batch_size, num_costs)

# y_true: true binary solutions, shape (batch_size, 4)
y_true = torch.randint(0, 2, (batch_size, num_costs)).float()

# y_pred_init: predicted solutions from initialized model, shape (batch_size, 4)
y_pred_init = torch.randint(0, 2, (batch_size, num_costs)).float()

# y_pred_trained: predicted solutions from trained model, shape (batch_size, 4)
y_pred_trained = torch.randint(0, 2, (batch_size, num_costs)).float()

# data_train: optional training data as (w_train, c_train) tuple
w_train = torch.linspace(0, 1, 3).unsqueeze(-1)
c_train = torch.randn(3, num_costs)
data_train = (w_train, c_train)

ARGS = {
    'w_values': w_values,
    'c_true': c_true,
    'c_pred_init': c_pred_init,
    'c_pred_trained': c_pred_trained,
    'y_true': y_true,
    'y_pred_init': y_pred_init,
    'y_pred_trained': y_pred_trained,
    'save_path': None,
    'show': False,
    'data_train': data_train,
    'intd': False,
    'title_init': 'Initialized Model',
    'title_trained': 'Trained Model',
    'label_init': 'Init',
    'label_trained': 'Trained',
    'color_init': 'tab:gray',
    'color_trained': 'tab:blue',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
plot_predictor_sweep Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/toy_example/plotting.py
code served (permissive licence) · get_code("ea2891bf31fe4db4")
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 Figure. 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

torch.manual_seed(0)

# Create small tensors for the sweep
batch_size = 5
num_costs = 4

# w_values: parameter sweep values
w_values = torch.linspace(0.0, 1.0, batch_size).unsqueeze(-1)

# c_true: true cost vectors (batch_size x num_costs)
c_true = torch.randn(batch_size, num_costs)

# c_pred_dfl: DFL predicted costs
c_pred_dfl = torch.randn(batch_size, num_costs)

# c_pred_adfl: A-DFL predicted costs
c_pred_adfl = torch.randn(batch_size, num_costs)

# y_true: true solutions (binary indicators, batch_size x num_costs)
y_true = torch.randint(0, 2, (batch_size, num_costs)).float()

# y_pred_dfl: DFL predicted solutions
y_pred_dfl = torch.randint(0, 2, (batch_size, num_costs)).float()

# y_pred_adfl: A-DFL predicted solutions
y_pred_adfl = torch.randint(0, 2, (batch_size, num_costs)).float()

# data_train: optional training data (w_train, c_train)
w_train = torch.linspace(0.2, 0.8, 3).unsqueeze(-1)
c_train = torch.randn(3, num_costs)
data_train = (w_train, c_train)

ARGS = {
    'w_values': w_values,
    'c_true': c_true,
    'c_pred_dfl': c_pred_dfl,
    'c_pred_adfl': c_pred_adfl,
    'y_true': y_true,
    'y_pred_dfl': y_pred_dfl,
    'y_pred_adfl': y_pred_adfl,
    'save_path': None,
    'show': False,
    'data_train': data_train,
    'intd': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
sol_value Ran
ran, honoured the contract we drafted
lucahart/DFL-for-Shortest-Path-Network-Interdiction/src/toy_example/main_funcs.py
code served (permissive licence) · get_code("f0464387a3967a80")
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 (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 torch
import numpy as np

torch.manual_seed(0)

# Test with torch tensors
c_torch = torch.randn(2, 4)
y_torch = torch.randn(2, 4)

# Test with numpy arrays
c_numpy = np.random.randn(2, 4)
y_numpy = np.random.randn(2, 4)

# Test with lists
c_list = [1.0, 2.0, 3.0]
y_list = [0.5, 1.5, 2.5]

ARGS = {
    "c": c_torch,
    "y": y_torch,
}
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 Tensor, 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

Also present in other papers' code

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

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 study decision-focused learning (DFL) in shortest-path network interdiction (SPNI) games, a Stackelberg game where an interdictor (leader) strengthens the networks' arcs against attacks, while an evader (follower) who is uncertain about costs of attacking network arcs relies on a machine-learned predictor to identify the shortest path. While DFL is highly effective as an end-to-end optimization framework, we show that it faces a fundamental structural failure when employed in this game setting: its training objective admits a broad decision-equivalence class of cost estimators that achieve zero nominal loss yet fail under interdiction, reversing DFL's usual advantage over a naive prediction-focused learning (PFL) approach. To address this, we propose Adversarial DFL (A-DFL), which replaces nominal training samples with interdicted scenarios to collapse the harmful equivalence class. Experiments on synthetic and real-world networks confirm that A-DFL restores DFL's advantage in this game setting, enabling effective end-to-end optimization.

For agents

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

get_harvested_code_for_paper("2608.09036")
get_code_for_paper("2608.09036")
have("2608.09036")

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

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

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

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

Connect an agent — have() is free.