distributed-resource-optimization

Distributed optimization algorithms for flexible resource coordination

Carrier-agnostic implementations of ADMM, COHDA, and averaging consensus — run in a single asyncio process or across a network via mango-agents.

pip install distributed-resource-optimization

Algorithms

ADMM Sharing

Coordinate flexible resources so their aggregate output matches a target vector. Solves a convex QP locally at each agent; a central coordinator handles the global update.

ADMM

ADMM Consensus

Drive all agents to agree on a shared solution vector while satisfying individual box and coupling constraints.

ADMM

COHDA

Fully distributed heuristic for combinatorial schedule selection. Agents gossip solution candidates until the system configuration stabilises.

COHDA

Averaging Consensus

Distributed averaging of a parameter vector, with optional gradient corrections for economic dispatch and price-signal coordination.

Averaging Consensus


Quick look

import asyncio
from distributed_resource_optimization import (
    create_admm_flex_actor_one_to_many,
    create_sharing_target_distance_admm_coordinator,
    create_admm_sharing_data, create_admm_start,
    start_coordinated_optimization,
)

async def main():
    flex1 = create_admm_flex_actor_one_to_many(10, [0.1,  0.5, -1.0])
    flex2 = create_admm_flex_actor_one_to_many(15, [0.1,  0.5, -1.0])
    flex3 = create_admm_flex_actor_one_to_many(10, [-1.0, 0.0,  1.0])
    coordinator = create_sharing_target_distance_admm_coordinator()
    start = create_admm_start(create_admm_sharing_data([-4, 0, 6], [5, 1, 1]))
    await start_coordinated_optimization([flex1, flex2, flex3], coordinator, start)
    print(flex1.x, flex2.x, flex3.x)

asyncio.run(main())
import asyncio
from distributed_resource_optimization import (
    create_cohda_participant,
    create_cohda_start_message,
    start_distributed_optimization,
)

async def main():
    actor1 = create_cohda_participant(1, [[0.0, 1, 2], [1, 2, 3]])
    actor2 = create_cohda_participant(2, [[0.0, 1, 2], [1, 2, 3]])
    start = create_cohda_start_message([1.2, 2.0, 3.0])
    await start_distributed_optimization([actor1, actor2], start)
    print(actor1.memory.solution_candidate.schedules.sum(axis=0))

asyncio.run(main())

Where to go next

Getting started

Install and run your first optimization in minutes.

Getting Started
Tutorials

End-to-end worked examples.

Tutorial: Energy Dispatch with ADMM
User guide

Algorithm background and parameter guidance.

ADMM
API Reference

Complete reference for every public class and function.

API Reference

Indices and tables