Skip to main content

Model-Based Local Search algorithm designer built on Routix

Project description

mbls

A Python toolkit for Model-Based Local Search (MBLS) algorithm design, built on top of Routix. This library provides a modular framework for orchestrating subroutines, managing experimental runs, and integrating mathematical models into heuristic search routines, with a focus on CP-SAT (OR-Tools) integration.

Features

  • Modular Architecture: Compose and extend LNS-style or hybrid metaheuristics using reusable subroutine components.
  • CP-SAT Integration: Includes ready-to-use classes for fixed and optional interval scheduling, custom CP models, and solution progress logging.
  • Experiment Management: Leverage Routix for structured routine execution, logging, timers, and experiment summarization.
  • Extensible Modeling Layer: Easily add custom models, constraints, or solvers for new problem domains.
  • Objective Tracking: Built-in utilities for tracking objective values and bounds over time.
  • Visualization Tools: Added painter module for objective value and time series plotting.

Installation

pip install mbls
  • Requires Python 3.11
  • Core dependency: routix
  • For CP-SAT features: ortools

Quick Example

from mbls.cpsat import CustomCpModel

# Initialize model
model = CustomCpModel()

# Define variables, constraints, and objective
# ...

# Configure and solve
model.init_solver(computational_time=10.0, num_workers=4)
status, elapsed, ub, lb = model.solve_and_get_status(10.0, 4)

print(f"Status: {status}, UB: {ub}, LB: {lb}")

Extending mbls

mbls is designed for research and experimentation. You can:

  • Subclass CpSubroutineController to define custom LNS or hybrid metaheuristics
  • Extend CustomCpModel or use CpModelWithFixedInterval / CpModelWithOptionalFixedInterval for new scheduling domains
  • Compose repeatable flows with structured routine names and modular inputs

Project Structure

  • src/mbls/ — Core framework and Routix integration
  • src/mbls/cpsat/ — CP-SAT models, controllers, and utilities
  • src/mbls/painter/ — Visualization tools for plotting objective values and time series
  • tests/ — Unit tests for models and controllers

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mbls-0.0.11.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mbls-0.0.11-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file mbls-0.0.11.tar.gz.

File metadata

  • Download URL: mbls-0.0.11.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for mbls-0.0.11.tar.gz
Algorithm Hash digest
SHA256 dacebe6f0c44aad37b1418516799d4f00d19e65064f40605264cbdfc951e8dad
MD5 689521f5d83fc8df386269c1f01b15e2
BLAKE2b-256 a054c44c1101e25b81c0b086d412b48554e451ee5eb2b18f1e3316bc60380a1b

See more details on using hashes here.

File details

Details for the file mbls-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: mbls-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for mbls-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 30592eb9c3f01d450986a43da5548334a3d421d991b2711697ab1753e2e74691
MD5 5226c81fb76277254fb252f7a19e62f7
BLAKE2b-256 4dbfdde43f9200b10ac5bdb828b677d37e7cf7934fc658f0f073b445b3725f6f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page