Skip to main content

OP-Research

A unified collection of algrithms for solving operational research problems in an effiecient way

Purpose of the Package

The purpose of the package is to provide a collection of tools to solve operation research problems and help researchers.

Features

The current implementation uses two phase method and is able to identify case for Infeasible solution, Unbounded solution, Degeneracy and Alternate Solution. In case of Infeasible solution and Unbounded solution it raises an ValueError and in case of Degeneracy and Alternate Solution it gives a warning and returns a optimum solution.

The constraints right hand side should be positive and all variables should hold non-negativity conditions.

Rules for constraint representation:

Each variable should have coefficient if it is in constraint i.e x_1 is not allowd instead use 1x_1. Note that it is not necessary to represent each variable in a constraint, but if a variable is there then it should have a coefficient. Only single spaces should be used. For a variable x_i i should be an integer in [1, num_vars], where num_vars is number of variables Objective function should be a tuple with first element as objective ie to maximize or minimize and second element should value that is to be optimized.

Simplex solution solver The package can be found on pypi hence you can install it using pip

Installation

pip install op_research

Usage

>>> from op_research import Simplex
>>> objective = ('maximize', '7x_1 + 4x_2')
>>> constraints = ['5x_1 + 2x_2 = 7', '1x_1 + 8x_2 >= 9', '3x_1 + 4x_2 <= 8']
>>> Lp_system = Simplex(num_vars=2, constraints=constraints, objective_function=objective)
>>> print(Lp_system.solution)
{'x_1': Fraction(6, 7), 'x_2': Fraction(19, 14)}

Contribution

Contributions are welcome Notice a bug let us know. Thanks

Author

Main Maintainer: Rehan Ahmed

Metadata

Release files for op-research 0.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 op-research 0.0.2
File Size Uploaded
op_research-0.0.2.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for op-research 0.0.2
File Interpreter ABI Platform
op_research-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / op_research-0.0.2.tar.gz

Download URL op_research-0.0.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3b46958935956ca5088f7cf4d38fc209280e45534205a6775393e64f86e5b081
BLAKE2b-256 checksum
How to use checksums
49a362d5008d39cdca25e229264bf05bc5314a8847706f2f682a515cdd3addd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.6 Linux/5.10.102.1-microsoft-standard-WSL2

Release files / op_research-0.0.2-py3-none-any.whl

Download URL op_research-0.0.2-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d932d37dc6ab281216e85d0fbd8787f6efb310012ca8173ccd99e7416e7bd9ea
BLAKE2b-256 checksum
How to use checksums
a642e0bf3e0075da197f8d50225047193248f73fb0615483c0ca32c032e1f77d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.6 Linux/5.10.102.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.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