A modern web-based implementation of Vogel's Approximation Method for solving Balanced Transportation Problems.
- Modern Web UI: Clean, responsive interface using Tailwind CSS
- Dynamic Matrix Sizing: Support for 2x2 up to 5x5 transportation problems
- Real-time Validation: Input validation with helpful error messages
- Export Functionality: Export results as JSON
- Docker Support: Easy containerization and deployment
- Comprehensive Testing: Unit tests for algorithm validation
- RESTful API: Clean API endpoints for integration
- Docker and Docker Compose installed
-
Clone and navigate to the project:
git clone <repository-url> cd Logistic-Optimization-DSS
-
Build and run with Docker Compose:
docker-compose up --build
-
Access the application:
- Open your browser and go to
http://localhost:5000 - Or with nginx (if configured):
http://localhost:80
- Open your browser and go to
-
Stop the application:
docker-compose down
Build only:
docker build -t vogel-app .Run standalone container:
docker run -p 5000:5000 vogel-appView logs:
docker-compose logs -f- Python 3.8 or higher
- pip (Python package manager)
-
Clone the repository:
git clone <repository-url> cd Logistic-Optimization-DSS
-
Create virtual environment (recommended):
# On Windows python -m venv venv venv\Scripts\activate # On macOS/Linux python3 -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Access the application:
- Open your browser and go to
http://localhost:5000
- Open your browser and go to
For development with auto-reload:
# Set environment variable
export FLASK_ENV=development # On macOS/Linux
set FLASK_ENV=development # On Windows
# Run with debug mode
python app.py# From project root
python tests/run_tests.py
# Or using unittest
python -m unittest tests.test_vogels_algorithmpython -m unittest tests.test_vogels_algorithm.TestVogelsApproximation.test_simple_balanced_problempip install coverage
coverage run -m unittest tests.test_vogels_algorithm
coverage report
coverage html # Opens detailed HTML reportReturns the main web interface.
Health check endpoint.
{
"status": "healthy"
}Solve a transportation problem.
Request Body:
{
"cost_matrix": [[3, 1, 2], [2, 4, 1], [5, 3, 2]],
"supply": [10, 15, 20],
"demand": [12, 18, 15]
}Successful Response:
{
"success": true,
"allocation": [[0, 10, 0], [12, 0, 3], [0, 8, 12]],
"total_cost": 89.0,
"iterations": 5
}Error Response:
{
"success": false,
"error": "Unbalanced problem: Supply sum (45) != Demand sum (45)"
}- Select Matrix Size: Choose the number of sources and destinations (2x2 to 5x5)
- Enter Cost Matrix: Input transportation costs between each source and destination
- Enter Supply and Demand: Input available supply at each source and required demand at each destination
- Validate: The system automatically checks for balanced problems (total supply = total demand)
- Solve: Click "Solve Problem" to compute the optimal allocation
- View Results: See the allocation matrix and total transportation cost
- Export: Download results as JSON for further analysis
Cost Matrix:
Dest1 Dest2 Dest3
Src1 3 1 2
Src2 2 4 1
Src3 5 3 2
Supply: [10, 15, 20] Demand: [12, 18, 15]
Expected Output: Optimal allocation with minimum total cost
Logistic-Optimization-DSS/
├── app.py # Flask web application
├── vogels_algorithm.py # Core algorithm implementation
├── requirements.txt # Python dependencies
├── Dockerfile # Docker container configuration
├── docker-compose.yml # Docker Compose configuration
├── templates/
│ └── index.html # Web interface template
├── tests/
│ ├── test_vogels_algorithm.py # Unit tests
│ └── run_tests.py # Test runner
└── README.md # This file
-
Port already in use:
# Find process using port 5000 netstat -tulpn | grep :5000 # Linux netstat -ano | findstr :5000 # Windows # Kill the process or change port export PORT=5001 # Then run app.py
-
Docker build fails:
# Clear Docker cache docker system prune -a # Rebuild without cache docker-compose build --no-cache
-
Module not found error:
# Ensure you're in the correct directory cd Logistic-Optimization-DSS # Install dependencies pip install -r requirements.txt
-
Permission denied (Linux/macOS):
# Fix file permissions chmod +x tests/run_tests.py
- For large matrices (5x5), the algorithm completes in milliseconds
- Docker deployment provides consistent performance across environments
- Use Gunicorn for production deployments (included in Dockerfile)
- Check the application logs for error messages
- Run tests to verify algorithm correctness:
python tests/run_tests.py - Verify Docker is running:
docker --version - Check port availability:
netstat -an | grep 5000
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests:
python tests/run_tests.py - Submit a pull request
This project is licensed under the MIT License.
For questions or issues, please create an issue in the repository or contact the development team.