Skip to main content

A research framework for Multi-Objective Hierarchical Auction Framework (MOHAF) for IoT resource allocation.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mohaf-0.2.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mohaf-0.2.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file mohaf-0.2.0.tar.gz.

File metadata

  • Download URL: mohaf-0.2.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for mohaf-0.2.0.tar.gz
Algorithm Hash digest
SHA256 53ba617671ab9ebda338b60fcfe547a9d9286ceeaea86cc1e6376b0a38ed4a50
MD5 01d6945858393511d7b6628013656567
BLAKE2b-256 4f75c0fb573f4e84acb9d7ce4aa56ef654d16c356842d4c25d5fc838cdecae4b

See more details on using hashes here.

File details

Details for the file mohaf-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mohaf-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.10

File hashes

Hashes for mohaf-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06090a1c811f4d37308a797a6954ebc12191d447b77c729558b4844685169d31
MD5 f5ccfa43d182c791c393b5f3981c925f
BLAKE2b-256 c573c3c04e9e5cb80c7fdab88ff0b6defcfba0da969374bc30565f5331998182

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page