# privateeye-zzy/simplex architecture

> Architecture diagram of the GitHub repository privateeye-zzy/simplex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/privateeye-zzy/simplex
- Repository: https://github.com/privateeye-zzy/simplex

## Overview

This repository is a small educational set of Python examples for solving linear programs with the simplex method. Each script is self-contained: its example constructs a model, calls its local solver, and reports results; the investment-risk example also plots risk versus profit. The solver implementation is repeated across all three files rather than shared as a package. The README points to a technical blog but documents no further runtime capabilities.

Main entry points: [`LP_math_model.py`](https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model.py) (Risk model example), [`LP.py`](https://github.com/privateeye-zzy/simplex/blob/master/LP.py) (Basic LP example), [`LP_math_model2.py`](https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model2.py) (Investment example)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_lp_example["Basic LP example<br/>[LP.py]"]
node_lp_solver["Basic simplex solver<br/>[LP.py]"]
node_risk_example["Risk model example<br/>[LP_math_model.py]"]
node_risk_solver["Risk model solver<br/>[LP_math_model.py]"]
node_investment_example["Investment example<br/>[LP_math_model2.py]"]
node_investment_solver["Investment solver<br/>[LP_math_model2.py]"]
node_risk_plot["Risk-profit plot<br/>[LP_math_model.py]"]

node_lp_example -->|"calls solve"| node_lp_solver
node_risk_example -->|"calls solve"| node_risk_solver
node_investment_example -->|"calls solve"| node_investment_solver
node_risk_example -->|"plots results"| node_risk_plot

click node_lp_example "https://github.com/privateeye-zzy/simplex/blob/master/LP.py"
click node_lp_solver "https://github.com/privateeye-zzy/simplex/blob/master/LP.py"
click node_risk_example "https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model.py"
click node_risk_solver "https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model.py"
click node_investment_example "https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model2.py"
click node_investment_solver "https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model2.py"
click node_risk_plot "https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lp_example,node_lp_solver,node_investment_example,node_investment_solver,node_risk_plot toneTeal
class node_risk_example,node_risk_solver toneIndigo
```

## Components

### Other components

- [Basic LP example](https://github.com/privateeye-zzy/simplex/blob/master/LP.py): `LP.py`
- [Basic simplex solver](https://github.com/privateeye-zzy/simplex/blob/master/LP.py): `LP.py`
- [Risk model example](https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model.py): `LP_math_model.py`
- [Risk model solver](https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model.py): `LP_math_model.py`
- [Investment example](https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model2.py): `LP_math_model2.py`
- [Investment solver](https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model2.py): `LP_math_model2.py`
- [Risk-profit plot](https://github.com/privateeye-zzy/simplex/blob/master/LP_math_model.py): `LP_math_model.py`

## Connections

- Basic LP example → Basic simplex solver: calls solve (evidence: `LP.py`)
- Risk model example → Risk model solver: calls solve (evidence: `LP_math_model.py`)
- Investment example → Investment solver: calls solve (evidence: `LP_math_model2.py`)
- Risk model example → Risk-profit plot: plots results (evidence: `LP_math_model.py`)
