A simple command-line-based program (food nutrition optimization) implemented using branch and bound algorithm.
This project is one of tasks in IF2211 Strategi Algoritma. The goal of this project is to create a program which can optimize food consumption by budget and energy need. This project is implemented using branch and bound algorithm.
- Python 3 (minimum)
- clone this repository
git clone https://github.com/mgstabrani/food-nutrition.git
Interactive mode (prompts for input):
python main.py
Non-interactive mode (pass flags directly):
python main.py --category <1-19> --budget <amount>
Example:
python main.py --category 7 --budget 50000
Short flags -c and -b are also supported. Run python main.py --help to see all options.
This project follows Semantic Versioning with staged modernization:
MAJOR: breaking public interface changes (CLI, SDK, REST API contracts).MINOR: backward-compatible features and improvements.PATCH: backward-compatible bug fixes.
Current version is stored in VERSION and release notes are tracked in CHANGELOG.md.
This repository now uses GitHub Actions:
- CI workflow: runs Python syntax validation on pushes and pull requests.
- Release workflow: runs semantic-release on
mainpushes.
Release automation behavior:
- Calculates next semantic version from conventional commit messages.
- Updates
VERSIONautomatically. - Generates and updates
CHANGELOG.mdautomatically. - Creates GitHub Release with generated notes.
Workflow files:
.github/workflows/ci.yml.github/workflows/release.yml
Use Conventional Commits so version bumping is automatic:
fix: ...-> PATCH releasefeat: ...-> MINOR releasefeat!: ...orBREAKING CHANGE:-> MAJOR releasedocs: ...,chore: ...,refactor: ...-> no release by default unless marked as breaking
- Step 1: Semantic versioning baseline (
0.1.0). ✓ - Step 2: Core engine refactor (separate algorithm from input/output). ✓
- Step 3: CLI adapter on top of shared core. ✓
- Step 4: Python SDK adapter.
- Step 5: REST API adapter with versioned endpoints.