A modular Python implementation of two fairness-oriented resource-allocation formulations for a NOMA-enabled mobile edge computing (MEC) network. The project models proportional fairness (alpha = 1) and max-min fairness (alpha = infinity) using Pyomo and successive convex approximation (SCA).
Research implementation, not a certified reproduction. The included three-user configuration is illustrative and comes from the original scripts. It is not presented as the paper's official simulation configuration. Solver results must be generated and validated in your own environment.
Q. Wang and F. Zhou, “Fair Resource Allocation in an MEC-Enabled Ultra-Dense IoT Network with NOMA,” 2019 IEEE International Conference on Communications Workshops (ICC Workshops), 2019, pp. 1–6.
DOI: 10.1109/ICCW.2019.8757173
This work studies resource allocation in ultra-dense IoT networks using mobile edge computing and non-orthogonal multiple access, and proposes an iterative successive-convex-approximation approach to non-convex resource-allocation problems.
| Fairness case | Module | Purpose |
|---|---|---|
| alpha = 1 | models/proportional_fairness.py |
Proportional-fair optimization formulation |
| alpha = infinity | models/max_min_fairness.py |
Max-min-fair optimization formulation |
| Shared model | models/common.py |
NOMA rate, power model and initial values |
| SCA execution | solver.py |
Iterative solve, convergence history and solver checks |
| Metrics | metrics.py |
Per-user rates, power and feasibility indicators |
.
├── .github/workflows/ # CI across supported Python versions
├── configs/scenarios/ # Versioned example parameter sets
├── docs/ # Model notes and reproducibility guide
├── src/mec_fair_allocation/
│ ├── models/
│ │ ├── common.py
│ │ ├── proportional_fairness.py
│ │ └── max_min_fairness.py
│ ├── cli.py
│ ├── config.py
│ ├── metrics.py
│ └── solver.py
├── tests/ # Unit and model-structure tests
├── CITATION.cff
├── CONTRIBUTING.md
└── pyproject.toml
Python 3.10 or newer is required.
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev]'The model uses Pyomo. IPOPT is the default nonlinear solver and must be installed separately. Confirm that the ipopt executable is available on your PATH.
mec-fair-allocation \
--config configs/scenarios/three-user-example.json \
--fairness alpha-1 \
--output results/alpha-1.jsonmec-fair-allocation \
--config configs/scenarios/three-user-example.json \
--fairness alpha-infinity \
--output results/alpha-infinity.jsonYou can also run the CLI without installing the console entry point:
python -m mec_fair_allocation.cli --helpCopy configs/scenarios/three-user-example.json and update the user-indexed values. Every per-user mapping must contain exactly the same user IDs as the users list.
The configuration documents the following physical quantities:
bandwidth: Hznoise_power,power_threshold,circuit_power: Wf_min,f_max: CPU cycles/sg_squared: squared channel magnitudecn: CPU cycles per input bit, as used by the source implementationorder: unique SIC ordering index
The parameter validator checks positive physical quantities, matching user keys, CPU bounds, power feasibility at minimum frequency, and unique SIC order.
- Validate scenario parameters.
- Build the selected Pyomo model.
- Initialize log-domain transmit powers and SCA expansion points.
- Solve the current nonlinear subproblem.
- Update expansion points and calculate the infinity-norm change.
- Stop at the configured tolerance or iteration limit.
- Export decision variables, iteration history, and derived metrics.
The solver checks termination status and fails explicitly if a usable solution is not returned.
ruff check .
pytest
python -m buildThe CI workflow runs linting, tests and a package build on Python 3.10, 3.11 and 3.12. Model-construction tests require Pyomo but do not require IPOPT; the end-to-end optimization requires a separately installed solver.
Read Model formulation and Reproducibility before interpreting numerical results.
In particular, the max-min model retains the direction of the rate-threshold constraint from the original script. That direction needs to be checked against the exact equation and variable definitions in the paper before treating it as a conventional QoS lower bound. The implementation deliberately does not silently change the mathematical formulation.
If you use this implementation, cite the paper above. Repository metadata is provided in CITATION.cff.
See CONTRIBUTING.md. Mathematical changes should identify the source equation, units, and validation evidence.
No license has been added because the repository did not previously specify one. Until a license is selected, reuse and redistribution permissions are not granted by default.