Giter Club home page Giter Club logo

rehan-stack / op-research Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 17 KB

The op_research package is a Python library for solving linear programming problems using the simplex algorithm. It provides a high-level interface for formulating and solving optimization problems.Simplex is designed to be easy to use and efficient, with a focus on simplicity.

Home Page: https://pypi.org/project/op-research/

Python 100.00%
linear-programming operational-research simplex-algorithm

op-research's Introduction

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

op-research's People

Contributors

rehan-stack avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.