semvec/pypi-packages huggingface dataset:
Lazy-Lagrangian-Relaxation 0.1.0
Helper package that provides lagrangian relaxation algorithm to MILP and LP with minimal effort. Also provides solver-independent support and some key config to the algorithm.
License: MIT
Requires Python: >=3.7

Lazy-Lagrangian-Relaxation
==========================

Ever tired of implementing the entire lagrangian relaxation algorithm case by case every time you want to use it?
Or maybe you just want to test the effectiveness of lagrangian relaxation without putting too much effort in coding?

This package is right for you.

**Lazy-Lagrangian-Relaxation** is a package that provide lagrangian relaxation algorithm without you putting
extra effort. All you need to do is to form a model in any solver(with some extra effort if not builtin-supported)
and tell the `LazyLRHelper` what your model is and which constraints you wish to relax.
Then, the helper will handle the hard work for you.


Features
--------

**Lazy-Lagrangian-Relaxation** provides the `LazyLRHelper` class with provides builtin lagrangian relaxation algorithm
implementations. One could use the minimal effort to benefit from the Lagrangian relaxation algorithm.

With some key features such as: Smart lagrangian multiplier initialization, Solver-independent,
Customized step size finder support, Configurator class to provide extra control over the entire algorithm, etc.


Example: Minial effort using `LazyLRHelper`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from lazy_lagrangian_relaxation import LazyLRHelper

    model: SomeSolver.ModelObject
    some_constraint_1: SomeSolver.ConstraintObject # some_constraint_1 must be associate with model
    some_constraint_2: SomeSolver.ConstraintObject # some_constraint_2 must be associate with model

    # tell the helper the model and constraints need to be relaxed
    lr_helper = LazyLRHelper(primal_model=model,
                             relaxed_constrs=[(some_constraint_1, "<=", 100),
                                              (some_constraint_2, ">=", -100)])
    # start lagrangian relaxation algorithm
    lr_helper.start()
    best_bound = lr_helper.get_best_bound()
    best_solution = lr_helper.get_best_feasible_solution()
    lr_helper.plot()


Installation
------------
The easiest way to install it is using ``pip`` from PyPI

.. code:: bash

    pip install lazy-lagrangian-relaxation


License
-------

See the `LICENSE`_ file for license rights and limitations (MIT).


Documentation
-------------

For more detailed documentation, please see README.md in the `SourceCode`_.

.. _LICENSE: https://github.com/W-Yuhao/Lazy-Lagrangian-Relaxation/blob/master/LICENSE.md
.. _SourceCode: https://github.com/W-Yuhao/Lazy-Lagrangian-Relaxation