Docs / Start here

Build a solver you can reason about.

DeltaSearch is a typed, dependency-free framework for heuristic subgraph extraction. Start with a local checkout, learn the problem contract, then choose the smallest solver that answers your question.

Alpha release — local install only

DeltaSearch is not published to PyPI yet. The supported path today is git clone followed by pip install -e ".[dev]". The API may change before the first package release.

Choose a path

01

I want to run a built-in problem

Follow Getting started, then swap in one of the six built-in problem classes.

02

I want to model my own objective

Read The problem contract and implement a subclass of SubgraphExtractionProblem.

03

I need to understand a surprising result

Attach an observer, inspect the objective trace, and check action feasibility before changing the solver.

04

I want to extend search behavior

Keep problem logic in the problem class and add search policy through a solver strategy. The extension model explains the boundary.

The short mental model

An input Graph is given to a SubgraphExtractionProblem. The problem exposes candidate Actions and scores them as an incremental DeltaResult. A solver chooses a move, applies it, and keeps the best feasible state until a budget or stopping condition ends the run.

input graph
    ↓
problem.evaluate_initial_state()
    ↓
enumerate actions → calculate delta → choose best feasible action
    ↓                         ↘ undo rejected candidate actions
new state → observe → repeat until budget / stall / target

Working principles

Make moves local

Use calculate_delta to derive objective change from the affected neighborhood. Do not re-score the entire graph for every candidate.

Keep moves reversible

Mutations go through apply_action and undo_action. This keeps candidate evaluation isolated and makes backtracking inspectable.

Make runs observable

Observers receive action evaluations, iteration completions, and convergence. Use them for logs, metrics, plots, and debugging.

Measure the right thing

Separate candidate scoring cost, state-copy cost, and total solve time. “O(1) delta” does not mean the whole iteration is O(1).