Skip to content

melih545/or-simplex-solvers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simplex Codes

simplex_codes is a small Python package that collects a few simplex-based linear programming routines in a cleaner, reusable repository layout.

The project is intentionally lightweight and GitHub-focused: it is installable, tested, and documented, but still close to the original academic implementations.

Supported Solvers

  • Primal simplex
  • Dual simplex
  • Revised simplex
  • Big-M method

Installation

Core package:

python -m pip install -e .

Optional visualization helpers:

python -m pip install -e ".[viz]"

Quick Start

from simplex_codes import simplex

result = simplex(
    c=[-8, -5, 0, 0],
    A=[
        [1, 1, 1, 0],
        [9, 5, 0, 1],
    ],
    b=[6, 45],
    sense="max",
)

print(result.solution)
print(result.objective_value)
print(result.iterations)

Input Format

The solvers currently expect coefficient arrays in tableau-friendly form.

  • c must include every variable coefficient already aligned with the constraint matrix columns.
  • Slack, surplus, or artificial variable columns should already be present in A and c.
  • For big_m_method, artificial variables are assumed to be the last artificial_count columns in A.

This keeps the implementations close to the original project and makes the examples easy to compare.

Examples

Runnable examples live in examples/:

Project Structure

.
├── .github/workflows/
├── examples/
├── src/simplex_codes/
└── tests/

Limitations

  • Inputs are assumed to already be in a canonical matrix form.
  • The implementations are educational and do not yet cover every degeneracy or infeasibility edge case.
  • The visualization helper is only designed for 2D simplex paths.

Development

Run the test suite:

python -m pytest

If you are working in an offline environment with the required build tools already installed, use:

python -m pip install --no-build-isolation -e .

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages