Korado is a CLI application for linear optimizations that mimics the syntax of LINDO, a popular optimization modeling language. Korado stands for "Koray's Operations Research App for Decision Optimization". Koray is my middle name, and it does sound cool in the title, therefore being in it.
The purpose of this tool is to provide a LINDO-like optimization tool for any OS. I first started this basic app after I realized that there wasn't a LINDO for MacOS, and the alternative, LINGO, was not user-friendly. I wanted to create a simple, more easily usable and accessible alternative.
- LINDO Syntax Compatibility: Supports the core components of the LINDO modeling language:
- Objective functions:
MAXIMIZE(orMAX) andMINIMIZE(orMIN). SUBJECT TO(orST,S.T.,SUCH THAT) section for constraints.ENDstatement to conclude the model definition.- Comment lines starting with
!. - Constraint labels (e.g.,
ROW1)).
- Objective functions:
- Post-END Declarations: Handles common variable specifications placed after the
ENDstatement:FREE: Unrestricted variables.GIN: General integer variables.INT: Binary integer variables (0 or 1).SLB: Simple Lower Bounds.SUB: Simple Upper Bounds.TITLE: A title for the model.
- Interactive Editor: Provides a simple, full-screen text editor (powered by
curses) for composing and editing models directly in the terminal. - Standard Solver Backend: Uses the robust and widely-used PuLP modeling library with the CBC (COIN-OR Branch and Cut) solver.
- Clear Output: Presents the solution, including the objective function value, variable values, and binding constraints, in a clean, readable format.
-
Clone the repository:
git clone https://github.com/batukoray/Korado.git cd Korado -
Create a virtual environment (recommended):
python3 -m venv .venv source .venv/bin/activate -
Install the required packages:
pip install -r requirements.txt
This will install
pulp, which automatically includes the CBC solver.
Run the script from your terminal:
python3 korado.pyThis will launch the interactive editor.
- Navigate: Use the arrow keys (
↑,↓,←,→),Home, andEndto move the cursor. - Edit: Type to insert characters. Use
BackspaceandDeleteto remove them. - New Line: Press
Enterto create a new line. - Solve: Press
Ctrl+Gto solve the model. - Quit: Press
Ctrl+Qto exit the program.
The script includes a built-in example. To run it directly, use the --example flag:
python3 korado.py --exampleThis will immediately solve the following model and print the solution:
MIN 50 X1 + 100 X2
ST
7 X1 + 2 X2 >= 28
2 X1 + 12 X2 >= 24
END
- Input: The tool accepts a multi-line string formatted according to LINDO syntax.
- Parsing: A series of regular expressions and parsing functions break down the input text into its core components:
- The optimization sense (
MAXorMIN). - The objective function expression.
- A list of constraints, each with a left-hand side, an operator (
<=,>=,=), and a right-hand side. - Any post-
ENDdeclarations for variable types and bounds.
- The optimization sense (
- Model Formulation: The parsed specification is used to build an optimization problem object using the
pulplibrary.LpVariableobjects are created with the appropriate bounds and categories (Continuous, Integer, or Binary). - Solving: The problem is passed to the CBC solver.
- Output: The solver's results (status, objective value, variable values, and constraint slack) are formatted and printed to the console.
- PuLP: A popular open-source linear programming modeler for Python.
- CBC (COIN-OR Branch and Cut): A high-performance open-source mixed-integer programming solver that is included with PuLP.
This tool is for educational and simulation purposes and is not an official product of LINDO Systems Inc.

