Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.1.2 instead.

NGSaddle

A framework for discovering adversarial, hard benchmark instances for any computational problem (e.g., TSP, SAT, and FSSP) using gradient-free black-box optimization (Nevergrad).

Disclaimer: NGSaddle is licensed under Apache-2.0. Solver backends and optional dependencies—including Concorde and IBM CP Optimizer—are governed by their own licences and are not distributed as part of NGSaddle.


Features

Used (present and actively used)

  • Pluggable instance encodings per domain
  • Pluggable solver as the hardness objective (Concorde, CP-SAT / CP-Optimizer)
  • Noise-robust repeat protocol (per-call seeds + median)
  • Configurable hardness aggregation
  • Configurable objective function shaping (steer the optimizer)
  • Parallel execution — two-level multiprocessing for batch / HPC sweeps
  • Per-eval logging (zarr)
  • Post-processing — sort + champion extraction
  • Plot generation — optimizer trajectories (best / confidence band / per-run)

Experimental (present, not actively used)

  • External instance seeding
  • Steady-state / sliding-window evaluation mode
  • Re-solving / re-timing logged instances

Installation

You can install NGSaddle via pip:

pip install ngsaddle

Solver Dependencies

To evaluate instances, NGSaddle relies on the external solver you want to test. You must install and configure the specific solver backend required for your domain (e.g., Concorde, CP Optimizer, or any custom solver you are evaluating).


Usage and Pipeline

The core NGSaddle library accepts configuration parameters as standard Python dictionaries. The optimization pipeline consists of three main stages:

  1. gen (Generation): Spawns a parallel pool of Nevergrad optimizers to search the instance space. Evaluation results and checkpoints are logged using chunked Zarr arrays to a logs/ directory.
  2. transform: Post-processes the logs, sorts the instances by hardness, and extracts the "champions" (the hardest instances found).
  3. plot: Generates trajectory plots showing the optimizer's progress (e.g., best running time found over time, confidence bands).

Example Scripts

While the core library is pure Python, this repository includes several example domains (TSP, SAT, Ham, JSSP) that wrap the library.

For instance, in the TSP/ directory, there is an exp.py wrapper script that parses a user-provided JSON configuration file and converts it into the Python dictionary required by NGSaddle:

cd TSP
python exp.py --file example.json

Advanced HPC Usage

NGSaddle is designed for robust parallel execution on large machines:

  • Core Affinity: It uses psutil to limit process CPU affinity, avoiding OS thread oversubscription.
  • Preemption Safety: Intermediate results are saved frequently. If a cluster job is preempted or you hit Ctrl+C, the progress is safely preserved in the .zarr datasets and can be resumed. You can also press s in the terminal to trigger a manual save.

Release files for ngsaddle 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ngsaddle 0.1.1
File Size Uploaded
ngsaddle-0.1.1.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ngsaddle 0.1.1
File Interpreter ABI Platform
ngsaddle-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / ngsaddle-0.1.1.tar.gz

Download URL ngsaddle-0.1.1.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
67b81914a076e35b89598e48bea6ef9c9a3c297e4524e306151576dab5a1fd9b
BLAKE2b-256 checksum
How to use checksums
b3907f411a078ccff17e50b3150e8c15f4a387910e92bfcf7998cb7e1d7fb583
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release files / ngsaddle-0.1.1-py3-none-any.whl

Download URL ngsaddle-0.1.1-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7406847145d990f896b9733e743d2d71315d0a830808a4f281d299aa918b3f7
BLAKE2b-256 checksum
How to use checksums
f3aa8c99fcebc6e15ebac1fb14f31d2a0a95ee4634dca54e0839e81ee5e86729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.5

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page