Making Explanations Smaller - Minimizing Graph Counterfactual Explanations with Local Bounded Search

Making Explanations Smaller - Minimizing Graph Counterfactual Explanations with Local Bounded Search

November 24, 2026

Story based on “On the Minimization of Graph Counterfactual Explanations: Theory and a Local Bounded Search Algorithm”, available (open access) at Journal of Machine Learning - Springer

@Article{Garcia_PradoRomero_Gullo_Stilo_GCmin_2026,
author = {Rodrigo García and Mario Alfonso Prado-Romero and Francesco Gullo and Giovanni Stilo},
title = {On the Minimization of Graph Counterfactual Explanations: Theory and a Local Bounded Search Algorithm},
journal = {Machine Learning},
year = {2026},
volume = {115},
pages = {224},
doi = {10.1007/s10994-026-07157-0},
url = {https://doi.org/10.1007/s10994-026-07157-0}
}

In short



The generate-and-minimize pipeline for graph counterfactual explanations

Figure 1: The generate-and-minimize pipeline. A generator first produces a valid counterfactual (red) that crosses the model's decision boundary. A minimizer then refines it into a minimal counterfactual (green), closer to the original graph. The paper focuses on this often-overlooked second step. (Figure from the paper, CC BY 4.0.)


Imagine a model that rejects a loan application and, when asked why, answers with a different application: “had you been a completely different person, you would have been approved”. Technically correct, practically useless. A good explanation should tell us the smallest change that would have flipped the outcome.

This is the idea behind counterfactual explanations: given an input and a black-box model, find a new input that is as close as possible to the original but gets a different prediction. The closer it is, the easier it is for a human to read it, check it, and act on it.

When the data are graphs

Many of the most interesting data are not tables but graphs: molecules, brain connectivity networks, protein structures, social networks. A graph counterfactual is a modified graph, with some edges added or removed and, possibly, some node attributes changed, for which the model changes its mind. “Close to the original” then means “few edits”.

In molecular or biomedical settings this matters a lot. A chemist who is told that removing two bonds changes the predicted toxicity of a compound can inspect the claim. If the explanation instead rewrites half the molecule, there is nothing to learn from it.

The step nobody studied

Most modern graph counterfactual explainers follow a generate-and-minimize recipe (Figure 1): first they produce any valid counterfactual, then they try to trim it so that it moves closer to the original graph while still fooling the model.

Generation has received almost all the attention. Minimization has been treated as an afterthought: either a simple random edge-swapping heuristic, or a step so tightly welded to one specific generator that it cannot be reused or improved on its own. There was not even a formal definition of what minimizing a counterfactual means.

That is the gap this paper, by Rodrigo García, Mario Alfonso Prado-Romero, Francesco Gullo and Giovanni Stilo, sets out to fill.

Theory: a hard problem, formally stated

The authors define the GC-min problem: given a black-box model, a graph, and a valid counterfactual of it, modify the counterfactual so that it remains valid and the number of edits with respect to the original graph is as small as possible.

They then prove that GC-min is NP-hard, by a reduction from the classic Feedback Arc Set problem. The result holds regardless of the task or the model, and holds also when restricted to undirected graphs. In plain words: no one should expect an efficient algorithm that always finds the best possible explanation, so good heuristics are the way forward.

The proposed heuristic is Local Bounded Search (LBS). It is model-agnostic, since it only needs to ask the model for predictions, and it works on top of any generator. Starting from a valid counterfactual, it repeatedly tries small moves, always accepting the first one that improves the solution, in a fixed order of priority:

  1. Single-edit removal: drop one edit and check the model still changes its prediction. Every success makes the explanation strictly smaller.
  2. Shrinking-overshooting: when no single edit can be dropped, remove an edit anyway and compensate with a different one, escaping dead ends.
  3. Replacement: swap one edit for another, keeping the size constant but restructuring the solution.
  4. Bounded addition: add an edit only while the explanation stays smaller than the best one found so far.

Two design choices keep it honest. The search never goes beyond the size of the best valid solution found, and the authors prove this bound never excludes an optimal solution. And since the model sees the whole graph, structural edits are tried together with a family of node-attribute adjustments (for example smoothing a node’s features towards its neighbours or diffusing them over the graph), so that edge changes and feature changes can help each other.

Does it work?

The experiments cover nine datasets: synthetic ones (Tree-Cycles, Synthie, COLORS-3), brain networks of children with autism (ASD), molecules (BBBP, BZR, AIDS) and proteins (ENZYMES, PROTEINS). LBS is paired with three generators from different families (DCE, OFS, RSGG) and compared against the existing decoupled minimizer obs, plus two further baselines, one of which (RHC) is a plain hill-climber with the same edit operations and the same budget.

The main results:


Results of LBS and baseline minimizers on top of the DCE generator

Figure 2: Results with the DCE generator on four datasets: structural edit distance (GED), feature edit distance (FED) and model calls, comparing the generator alone, LBS, OBS, DBS and RHC (lower is better). The GED axis is capped at 100. (Figure from the paper, CC BY 4.0.)


Ablations: every ingredient counts

The authors switch components off one at a time. Allowing node-attribute changes helps substantially on attributed graphs (on BBBP with the RSGG generator, GED drops from 5.29 to 0.69), at the price of somewhat larger feature changes. Removal moves alone fail on attributed data, while swap and addition moves alone fail badly on attribute-free graphs, so the two families are complementary. Finally, the order matters: deferring removals is catastrophic on attribute-free graphs (GED 81.58 against 3.02 on Tree-Cycles), so trying small removals first is the most robust choice.

Where it does not shine

The paper is candid about the limits. Gains are smaller when the initial counterfactual has little redundancy or when the class depends on a global property of a large, dense graph: on AIDS (tiny molecules) GED goes only from 15.09 to 11.90, and on PROTEINS from 67.45 to 45.86, because many edits are individually necessary. In those cases the search can get stuck in local optima, and the authors point to a learned strategy selector as future work. Other directions are comparison with simulated annealing or tabu search, domain-specific plausibility constraints, and richer edit spaces.

Why this matters

The practical message is a change of perspective for explainability systems: treat minimization as a first-class component. A decoupled minimizer can be plugged on top of any existing counterfactual generator, makes different generators comparable on fair ground, and can turn even a rough, valid counterfactual into a concise explanation a human can actually read.

The experiments run on the open-source GRETEL framework, and the experimental configurations are publicly released.

Final Version of the paper available at https://link.springer.com/article/10.1007/s10994-026-07157-0

Please cite us using:

@Article{Garcia_PradoRomero_Gullo_Stilo_GCmin_2026,
author = {Rodrigo García and Mario Alfonso Prado-Romero and Francesco Gullo and Giovanni Stilo},
title = {On the Minimization of Graph Counterfactual Explanations: Theory and a Local Bounded Search Algorithm},
journal = {Machine Learning},
year = {2026},
volume = {115},
pages = {224},
doi = {10.1007/s10994-026-07157-0},
url = {https://doi.org/10.1007/s10994-026-07157-0}
}


Back to all posts …