Skip to main content

sherali_adams

A small library of functions with few dependencies to run k rounds of Sherali-Adams relaxation on a system of the form Ax <= b represented by raw numpy matrix A and array b.

notes

The constraints 0 <= y <= 1 will be added for all variables in the system returned. Send me a note if you'd like for this to be optional.

install

pip install sherali_adams

Testing

> nosetests

Ran 5 tests in 0.423s

OK

Examples

  1. Run 1 round of SA on a system with 2 variables.
    A = np.matrix([1,1],[1,1]) b = np.matrix([1,1]) (AA,bb) = run_SA(1,2,A,b)
  2. Find the original monomial corresponding to new variables. Here we find it for y_3 in the result above after 1 round of SA on a system with 2 variables.(0 based indexing) monomial = invert(2,2,1) monomial == [0,1] Thus y_3 = y_{0,1} which delinearizes to x_0x_1
  3. Supports dynamic programming/memoized mode and brute force. To use memoized: run_SA(k = 2,n = 5,A = A,b = b,memoize = True)

Metadata

Release files for sherali-adams 0.2

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

Source distribution (sdist)

Source distribution for sherali-adams 0.2
File Size Uploaded
sherali_adams-0.2.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sherali-adams 0.2
File Interpreter ABI Platform
sherali_adams-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / sherali_adams-0.2.tar.gz

Download URL sherali_adams-0.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f8f84bf1b0ca042be4abbd586d8d411741a6fd517cca284ee0108b92d77da0cd
BLAKE2b-256 checksum
How to use checksums
eed0f863eb282df804171337ea7af86f4be4f68e3f825b847f6dd9864d5b5ccc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / sherali_adams-0.2-py3-none-any.whl

Download URL sherali_adams-0.2-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
065d3fa87fce19d0f3e9ca99b1b3f022e9d4c7af53a5030609702ebbcae1e3f0
BLAKE2b-256 checksum
How to use checksums
5f89c49d342a597aa91255a8729fa98290b33bed065346858a86e42f1ad12412
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

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