stab: Implement MaxWeightStableSetPerturber; update tests and docs

This commit is contained in:
2025-12-08 10:54:19 -06:00
parent 7fd88b0a3d
commit a4cb46f73e
23 changed files with 197 additions and 152 deletions

View File

@@ -7,6 +7,7 @@ from miplearn.collectors.basic import BasicCollector
from miplearn.io import write_pkl_gz
from miplearn.problems.stab import (
MaxWeightStableSetGenerator,
MaxWeightStableSetPerturber,
build_stab_model_gurobipy,
build_stab_model_pyomo,
)
@@ -17,9 +18,12 @@ gen = MaxWeightStableSetGenerator(
w=uniform(10.0, scale=1.0),
n=randint(low=50, high=51),
p=uniform(loc=0.5, scale=0.0),
fix_graph=True,
)
data = gen.generate(3)
pr = MaxWeightStableSetPerturber(
w_jitter=uniform(0.9, scale=0.2),
)
base_instance = gen.generate(1)[0]
data = pr.perturb(base_instance, 3)
params = {"seed": 42, "threads": 1}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.