Skip to main content

MOHAF: Multi-Objective Hierarchical Auction Framework

Overview

This repository provides the implementation and supporting materials for the paper:

"MOHAF: A Multi-Objective Hierarchical Auction Framework for Scalable and Fair Resource Allocation in IoT Ecosystems"

MOHAF is a distributed resource allocation mechanism for heterogeneous IoT environments.
It combines hierarchical clustering, submodular optimization, and dynamic pricing to achieve:

  • Efficient allocation of resources in large-scale IoT ecosystems
  • Joint optimization of cost, energy efficiency, quality of service (QoS), and fairness
  • Theoretical guarantees with a (1 - 1/e) approximation ratio
  • Perfect fairness across participants (Jain’s Index = 1.000 in experiments)

We provide code, experimental setup, and references to enable reproducibility and extension of this work.


Repository Contents

MOHAF-Resource-Allocation
├─ .gitignore
├─ LICENSE
├─ MOHAF.ipynb
├─ README.md
├─ docs
│  ├─ index.md
│  ├─ mohaf_paper.pdf
│  └─ usage.md
├─ examples
│  ├─ analyze_results.ipynb
│  └─ run_experiments.py
├─ mohaf
│  ├─ __init__.py
│  ├─ auction_mechanisms.py
│  ├─ core.py
│  ├─ scenarios.py
│  └─ utils.py
├─ pyproject.toml
├─ requirements.txt
└─ tests
   ├─ __init__.py
   ├─ test_auction_mechanisms.py
   └─ test_core.py

Installation

You can install MOHAF directly from PyPI:

pip install mohaf

Usage

After installation, you can import MOHAF in your Python scripts:

from mohaf.auction_mechanisms import MOHAFAuction
from mohaf.scenarios import generate_synthetic_scenario

# 1. Initialize the auction mechanism
mohaf_auction = MOHAFAuction(alpha=0.3, beta=0.3, gamma=0.2, delta=0.2)

# 2. Generate a synthetic scenario
resources, requests = generate_synthetic_scenario(n_resources=50, n_requests=30)

# 3. Run the auction
results = mohaf_auction.run_auction(resources, requests)
metrics = mohaf_auction.calculate_metrics(results)

print("Auction completed!")
print(f"  Allocation Efficiency: {metrics['allocation_efficiency']:.3f}")
print(f"  Revenue: ${metrics['revenue']:.2f}")

For more detailed examples and to reproduce the experiments from the paper, please see the examples/ directory and the MOHAF.ipynb notebook in the repository.


Command Line Interface (CLI)

You can also run MOHAF from the terminal without writing code once installed from PyPI.

Basic usage

# Default MOHAF mechanism with a balanced synthetic scenario
mohaf

# Specify number of resources/requests and scenario type
mohaf --n-resources 100 --n-requests 60 --scenario-type high_demand

# Choose a different baseline mechanism
mohaf --mechanism greedy

Available mechanisms

  • mohaf (default)
  • first_price
  • vickrey
  • hungarian
  • greedy
  • random

MOHAF weights

You can tune the MOHAF multi-objective weights and learning rate:

mohaf --alpha 0.3 --beta 0.3 --gamma 0.2 --delta 0.2 --learning-rate 0.01

Reproducibility and loading scenarios from file

  • Seed: --seed 42 to make random generation deterministic.
  • Load from JSON: Provide a file with resources and requests arrays matching the mohaf.core.Resource and mohaf.core.Request fields. Example structure:
{
  "resources": [
    {
      "id": "resource_0",
      "type": "compute",
      "capacity": 50,
      "cost_per_unit": 0.8,
      "location": [0, 0],
      "availability": 0.9,
      "reliability": 0.85,
      "energy_efficiency": 0.75,
      "owner_id": "owner_0"
    }
  ],
  "requests": [
    {
      "id": "request_0",
      "requester_id": "device_0",
      "resource_type": "compute",
      "amount": 20,
      "max_price": 30,
      "deadline": 1730000000.0,
      "priority": 5,
      "location": [10, 10],
      "qos_requirements": {"min_reliability": 0.6, "max_latency": 50}
    }
  ]
}

Run with:

mohaf --input scenario.json

JSON output

Return results and metrics as JSON (for scripting/automation):

mohaf --json --pretty

This prints

{
  "result": { "allocations": [...], "execution_time": 0.123, ... },
  "metrics": { "allocation_efficiency": 0.87, "revenue": 123.45, ... }
}

Saving results to files

  • Allocations to CSV: --allocations-csv allocations.csv
  • Metrics to JSON: --metrics-json metrics.json

Quiet mode

Suppress internal prints from mechanisms:

mohaf --quiet

Full help

mohaf --help

Output includes all flags:

  • --mechanism {mohaf,first_price,vickrey,hungarian,greedy,random}
  • --n-resources INT and --n-requests INT
  • --scenario-type {balanced,high_demand,low_resource}
  • --alpha --beta --gamma --delta --learning-rate (MOHAF only)
  • --json and --pretty

Dataset

Experiments rely on the publicly available Google Cluster Data: https://github.com/google/cluster-data


License

This project is licensed under the MIT License.


Citation

If you use this repository, please cite the associated paper:

@misc{Agrawal2025,
  author       = {Agrawal, Kushagra and Goktas, Polat and Bandopadhyay, Anjan, and Ghosh, Debolina and Jena, Junali Jasmine and Gourisaria, Mahendra Kumar},
  title        = {MOHAF: A Multi-Objective Hierarchical Auction Framework for Scalable and Fair Resource Allocation in IoT Ecosystems},
  year         = {2025},
  eprint       = {2508.14830},
  archivePrefix= {arXiv},
  primaryClass = {cs.DC},
  doi          = {10.48550/arXiv.2508.14830},
  url          = {https://arxiv.org/abs/2508.14830}
}

📌 Repository link: https://github.com/afrilab/MOHAF-Resource-Allocation/tree/main

Metadata

Release files for mohaf 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mohaf 0.2.0
File Size Uploaded Provenance
mohaf-0.2.0.tar.gz 17.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mohaf 0.2.0
File Interpreter ABI Platform
mohaf-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.7 kB

Release files / mohaf-0.2.0.tar.gz

Download URL mohaf-0.2.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
53ba617671ab9ebda338b60fcfe547a9d9286ceeaea86cc1e6376b0a38ed4a50
BLAKE2b-256 checksum
How to use checksums
4f75c0fb573f4e84acb9d7ce4aa56ef654d16c356842d4c25d5fc838cdecae4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.10

Release files / mohaf-0.2.0-py3-none-any.whl

Download URL mohaf-0.2.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06090a1c811f4d37308a797a6954ebc12191d447b77c729558b4844685169d31
BLAKE2b-256 checksum
How to use checksums
c573c3c04e9e5cb80c7fdab88ff0b6defcfba0da969374bc30565f5331998182
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.10

Security for mohaf 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page