Expand description
The consensus-based bundle algorithm (CBBA).
Each agent alternates two phases, communicating only with whoever it can currently reach:
- Bundle phase (
Agent::build_bundle): the agent greedily adds tasks to its bundle, each time the one with the highest marginal gain it can win, bidding that gain. It can win a task when its bid beats the best bid it knows of: higher, or equal and placed by an agent with a larger identifier. - Consensus phase (
Agent::receive): the agent merges a neighbor’sMessageinto its own winner tables, task by task, with the published conflict-resolution table. When it learns it was outbid on a task in its bundle, it drops that task and every task it added after it, since their bids assumed the lost task.
Messages carry the sender’s whole state, so they can be delayed, dropped, duplicated or reordered, and the topology can change: an agent ignores a message older than what it already knows of the sender, and later messages repair what an earlier one got wrong.
With diminishing marginal gains, once every pair of agents keeps getting messages through, directly or relayed, the team settles on an assignment where:
- every agent believes in the same winner for every task, and no task has two holders;
- every winning bid is the holder’s real marginal gain, given the tasks it added before;
- no agent with room left could outbid the winner of a task it does not hold.
The literature states that, with diminishing gains, CBBA settles on the sequential greedy assignment (Choi, Brunet and How, as restated by Buckman, Choi and How, 2019). With this implementation that often holds, but not always: an agent outbid by a bid that is later withdrawn may already have filled the slot with another task, and keeps it; and equal gains can be resolved in a different order. The tests pin both cases, the first with a step-by-step trace. Agents that replan, releasing their bundle before every bundle phase, free such slots, and settle on a sequential greedy assignment for some order of tied gains.
The algorithm is from Choi, Brunet and How, “Consensus-Based Decentralized Auctions for Robust Task Allocation”, IEEE Transactions on Robotics 25(4), 2009. Its state and release rule follow the restatement in Section II.B of Johnson, Ponda, Choi and How, “Asynchronous Decentralized Task Allocation for Dynamic Environments”, AIAA Infotech@Aerospace 2011, and its conflict table was checked entry by entry against the open-source CBBA-Python implementation (https://github.com/zehuilu/CBBA-Python). Timestamps here are logical clocks: every agent counts the messages it sends, and agents track the latest count they have seen of each other agent, directly or relayed. No synchronized clocks are needed.
sequenceDiagram
participant A as agent 0
participant B as agent 1
A->>A: build_bundle
B->>B: build_bundle
A->>B: message
B->>A: message
A->>A: receive, release outbid tasks
B->>B: receive, release outbid tasks
A->>A: build_bundlesim runs a team over a simulated network with delays, losses and
partitions.
Structs§
- Agent
- One CBBA agent: its valuation, its bundle, and what it knows about every task’s winner.
- Message
- One agent’s broadcast: its belief about every task’s winner and winning bid, and the latest clock value it has seen of every agent.
Enums§
- Replan
- How much of its bundle an agent releases before each bundle phase, to reconsider it.