This repository consists the code accompanying the report drawn under CS 307 Optimization Algorithm & Techniques course. The topic of the report is Milk Industry Profit Maximization.
- Python - for coding LP models
- JSON - for storing data
The following parts comprise the code of the project.
simplex.py
- The matrix based simplex method that runs by iterating over Basic Feasible Points.tableau_simplex.py
- This class uses the tableau method to find the optimal solution.data.py
- To generate and process data that goes into the constraints. It involves random data creation and reshaping functions. It also dumps the output intodump.json
.json2np.py
- Convert json input to np arrays to feed into the simplex models.main.py
- Main file that consists of the driver functions.wrapper.py
- Wrapper file for driver functionsdata/
- Consists of the test case inputs/outputs in json format, that can be used to test the models.
Create virtual environment and install the dependencies.
$ python -m venv /path/to/new/virtual/environment
$ pip install -r requirements.txt
Run the models and generate output
$ python main.py -m method {1,2} -i input-file -o output-file
# Example
$ python main.py -i data/inp1.json -o data/out1.json
In absence of data, Pseduo-Random data can be generated by supplying custom parameters
$ python input_generator -n n -m m -t t -o output-file
- Gaurav Jain (200001023)
- Vihaan Thora (200001079)
We would like to express our gratitude to Dr. Kapil Ahuja, Professor, CSE, Indian Institute of Technology, Indore. We have learned immensely by completing his course and preparing this project for the adjoining lab course.