Smart-cities-evaluation-framework

Published: 15 September 2026| Version 1 | DOI: 10.17632/9vkbkp7c8z.1
Contributor:
Hugo Gaspar Hernandez Palma

Description

Smart Cities Evaluation Framework: Multi-Criteria Evaluation, Gap Diagnosis and Multi-Objective Optimization of Smart Cities — Software and Sample Dataset (Version 1.0.0) This deposit packages the "Smart Cities Evaluation Framework", a full-stack research prototype (software + sample data) that operationalizes a four-stage analytical pipeline for smart-city assessment. Stage 1 ingests a city-by-indicator matrix (CSV/Excel), validates it, profiles data quality and imputes missing values (median or mean). Stage 2 performs multi-criteria decision-making (MCDM) enhanced with machine learning: criterion weights are obtained via AHP (eigenvector method with Saaty consistency check), CRITIC (standard deviation and correlation-based), Random Forest / Gradient Boosting feature importance, or a HYBRID combination of CRITIC and ML weights; alternatives are then aggregated into city rankings with SAW and TOPSIS. Stage 3 produces a per-city, per-criterion gap diagnosis against the ideal city or against a K-Means-defined reference performance group. Stage 4 applies the NSGA-II evolutionary algorithm to search the Pareto front of budget-constrained improvement allocations that maximize the expected overall score of each city, returning optimistic, pessimistic and balanced reference solutions. The deposit contains: (1) the backend source code (Python 3.11, FastAPI, SQLAlchemy 2, Celery, PostgreSQL with JSONB, Redis), (2) the frontend source code (React 18, TypeScript, Vite), (3) an illustrative synthetic dataset of 10 cities described by 10 normalized smart-city indicators (smart_mobility, digital_infrastructure, environmental_quality, public_safety, governance_transparency, innovation_ecosystem, energy_efficiency, citizen_participation, health_services, education_quality; each on a benefit-oriented [0,1] scale), (4) the complete methodological documentation with all implemented equations, (5) unit tests of the MCDM engine (pytest, 5 tests), and (6) containerization and deployment assets (Docker Compose base/dev/prod variants and Kubernetes Kustomize manifests for staging and production). The sample dataset is synthetic and intended for demonstration, testing and teaching; it is not official statistics. Users may substitute their own city × indicator matrices (limits: 100 cities × 30 criteria) through the web interface or the REST API. All generated results (evaluations, diagnoses, optimization scenarios) are persisted in a documented relational schema provided in the accompanying data dictionary. Category: Computer and Information Science (or: Software Engineering) Keywords: smart cities; multi-criteria decision making; MCDM; CRITIC; AHP; TOPSIS; SAW; machine learning; random forest; K-Means; NSGA-II; multi-objective optimization; Pareto front; FastAPI; React

Files

Steps to reproduce

SMART CITIES EVALUATION FRAMEWORK v1.0.0 - PASOS DE REPRODUCCION Validado: 10/10 E2E y 5/5 pytest (outputs reales). 0. REQUISITOS Docker 24+ + Compose v2 (Ruta A, recomendada) o nativa (Ruta B): Python 3.11/3.12, Node 18+, PostgreSQL 15+, Redis 7. No actualizar pines; bcrypt==4.0.1 OBLIGATORIO. 1. DESCARGA E INTEGRIDAD unzip smart-cities-mendeley-data-v1.0.0.zip cd smart-cities-evaluation-framework-v1.0.0 find . -type f | wc -l -> 74 2. RUTA A: DOCKER (recomendada) cp .env.example .env # editar SECRET_KEY: openssl rand -hex 32 make up # = docker compose up -d --build curl http://localhost:8000/health -> {"status":"ok",...} Primer arranque: 5-10 min. Login (localhost:5173): admin@smartcities.local / admin123 3. RUTA B: NATIVA (hosts 127.0.0.1; BD/usuario smartcities + redis) python -m venv .venv && source .venv/bin/activate pip install -r backend/requirements.txt cd backend && uvicorn app.main:app --port 8000 celery -A app.core.celery_app worker --loglevel=info celery -A app.core.celery_app flower --port=5555 cd frontend && npm ci && npm run dev # npm ci, NUNCA npm install 4. TESTS pytest tests/ -v -> 5 passed in 3.00s 5. FLUJO API (base http://localhost:8000/api/v1; bearer) TOKEN=$(curl -s -X POST .../auth/login -d "username=admin@smartcities.local" \ -d "password=admin123" | jq -r .access_token) a) Proyecto: POST .../projects {"name":"Reproduction 2026"} -> id 1 b) Datos: POST .../projects/1/datos -F file=@data/sample_cities.csv \ -F imputation_method=median -> 10x10 ciudades/criterios, 0 imputadas c) Evaluacion: POST .../projects/1/evaluacion \ -d '{"use_ahp": false, "ml_method": "random_forest"}' Top HYBRID-TOPSIS: Copenhagen 0.9064, Amsterdam 0.8075, Barcelona 0.6468 Top SAW: Copenhagen 0.9291, Amsterdam 0.8145, Singapore 0.7512 d) Diagnostico: POST .../projects/1/diagnostico?reference=ideal -> brechas + k-means (2 clusters) e) Optimizacion: POST .../projects/1/optimizacion -d '{"budget":1000, "generations":60,"pop_size":40,"projects":[smart_mobility, citizen_participation, energy_efficiency; c/u max_improvement 0.3, cost_per_unit 50, linear]}' -> Pareto + 3 puntos: optimistic/pessimistic/balanced f) Matrices grandes (~100x30): "run_async": true; seguir en Flower (localhost:5555). 6. CHECKLIST (8/8 = completa) [1] /health 200 [2] login JWT [3] datos 10x10 [4] evaluacion CRITIC/ML/ HYBRID top Copenhagen [5] diagnostico 2 clusters [6] Pareto + 3 puntos [7] tarea Celery OK [8] pytest 5 passed. 7. PROBLEMAS FRECUENTES Puerto ocupado (5432/6379/8000/5173/5555): liberar o cambiar mapeo. Fallo de auth: bcrypt==4.0.1. Errores RESP3: Redis 7 real. Versiones nuevas de frontend: npm ci. Timeout: run_async + Flower. BD "connection refused" (nativa): host 127.0.0.1, no "postgres". Notas: dataset sintetico; limite 100x30 (MAX_CITIES/MAX_CRITERIA). Formulas: docs/METODOLOGIA.md; esquema: DATA_DICTIONARY.md; cita: CITATION.cff.

Institutions

Categories

Engineering, Software

Funders

  • Corporación Universitaria Iberoamericana

Licence