AI-470 · Lesson 10 of 12 · 25 min
Task allocation, negotiation and auctions
Whenever several agents share work or resources, someone must decide who does what and who gets what. A fleet of warehouse robots must divide picking jobs; delivery drivers must be matched to orders; cloud workloads must be placed on servers; and AI assistants may negotiate meeting times, prices or terms on behalf of their users. These are allocation problems, and agents solve them through centralized optimization, market mechanisms such as auctions, protocols such as the contract net, or negotiation. This lesson explains these approaches, compares their efficiency and robustness, introduces negotiation strategies and protocols, and discusses the new questions raised when language model agents negotiate with each other and with people.
The assignment problem
The simplest allocation problem assigns \(n\) tasks to \(n\) agents, one each, minimizing total cost, such as travel distance or time. With a cost matrix \(c_{ij}\) for agent \(i\) doing task \(j\), we seek the assignment minimizing:
Checking every assignment is impossible for large \(n\), since there are \(n!\) of them, but the Hungarian algorithm solves the problem exactly in polynomial time, and linear programming and min-cost flow algorithms handle variants with capacities and multiple tasks per agent. Real allocation problems add complications: tasks arrive over time, agents have different capabilities, tasks have deadlines and dependencies, and information is distributed among agents that may not share it freely. These complications motivate decentralized methods.
Centralized versus decentralized allocation
A central planner with complete information can compute optimal or near-optimal allocations. Centralized approaches work well in controlled settings, such as a single company's warehouse robots, but they create a single point of failure, may not scale to very large or fast-changing systems, and require agents to report private information truthfully, which self-interested agents may not do. Decentralized approaches let agents bid, negotiate or follow local rules, using information they hold privately and adapting quickly to change, at the cost of possibly less efficient outcomes. Many systems combine both: a central optimizer sets the overall plan, and local mechanisms handle disruptions.
Auctions and market mechanisms
Auctions are a natural way to allocate tasks among agents with private costs. In a task auction, an auctioneer announces a task and agents submit bids reflecting their cost of doing it; the lowest bidder wins. Sequential single-item auctions allocate tasks one at a time; combinatorial auctions let agents bid on bundles of tasks, capturing synergies, such as two deliveries on the same route, at the cost of a much harder winner determination problem. Market-based approaches are used in multi-robot coordination, cloud resource allocation, electricity markets and advertising.
import numpy as np
from itertools import permutations
# Allocating delivery tasks to robots: sequential auction versus the optimal assignment
rng = np.random.default_rng(10)
robots = rng.uniform(0, 10, (5, 2)); tasks = rng.uniform(0, 10, (5, 2))
cost = np.linalg.norm(robots[:, None, :] - tasks[None, :, :], axis=2) # travel distance
# sequential single-item auction: each task in turn goes to the lowest bidder still free
free = set(range(5)); auction = {}
for t in range(5):
bids = {r: cost[r, t] for r in free}
winner = min(bids, key=bids.get); auction[t] = winner; free.remove(winner)
auction_cost = sum(cost[r, t] for t, r in auction.items())
# greedy by cheapest pair overall
pairs = sorted((cost[r, t], r, t) for r in range(5) for t in range(5))
used_r, used_t, greedy_cost = set(), set(), 0.0
for c, r, t in pairs:
if r not in used_r and t not in used_t:
used_r.add(r); used_t.add(t); greedy_cost += c
# optimal assignment by checking all 120 permutations
best = min(permutations(range(5)), key=lambda p: sum(cost[p[t], t] for t in range(5)))
opt_cost = sum(cost[best[t], t] for t in range(5))
print(f"sequential auction (tasks in fixed order): total distance {auction_cost:5.1f}")
print(f"greedy cheapest-pair-first: total distance {greedy_cost:5.1f}")
print(f"optimal assignment (all 120 options): total distance {opt_cost:5.1f}")
print("optimal plan: " + ", ".join(f"task {t} -> robot {best[t]}" for t in range(5)))sequential auction (tasks in fixed order): total distance 24.7 greedy cheapest-pair-first: total distance 21.2 optimal assignment (all 120 options): total distance 20.1 optimal plan: task 0 -> robot 0, task 1 -> robot 1, task 2 -> robot 3, task 3 -> robot 2, task 4 -> robot 4
The sequential auction, which allocates tasks in a fixed order to the cheapest robot still free, produces a total distance of 24.7. Allocating the cheapest robot–task pair first gives 21.2, and the optimal assignment, found here by checking all 120 possibilities, gives 20.1. Simple decentralized mechanisms are often reasonably efficient but not optimal: early allocations can take robots that would have been much better used later. Improvements include auctioning tasks in a better order, allowing agents to trade tasks after the initial allocation, and combinatorial bidding. The right choice balances efficiency against communication, computation and robustness.
The contract net protocol
The contract net protocol, proposed by Reid Smith in 1980, is a classic decentralized method for task allocation. A manager agent announces a task with its requirements; contractor agents that can perform it evaluate the task and submit bids; the manager awards the contract to the best bid; and the contractor performs the task and reports results. Contractors can themselves become managers, subcontracting parts of the work, creating hierarchies dynamically. The protocol is simple, flexible and robust to agents joining and leaving, and variants are used in manufacturing control, logistics and multi-robot systems. Its weaknesses include communication overhead with many agents and myopic allocation, since each task is awarded independently.
Negotiation
When agents have conflicting interests and no central authority, they negotiate. Negotiation theory distinguishes distributive negotiation, dividing a fixed pie such as a price, from integrative negotiation, where creative trades across several issues can make both parties better off, for example accepting a later delivery date in exchange for a lower price. Key concepts include each party's reservation value (the worst deal they would accept), their BATNA (best alternative to a negotiated agreement), the zone of possible agreement between reservation values, and Pareto-efficient agreements, where no change could make one party better off without making the other worse off.
Automated negotiation protocols, such as the alternating offers protocol, have agents exchange proposals until one accepts or a deadline passes. Strategies range from time-dependent concession, conceding slowly at first and faster near the deadline, to tit-for-tat concession that mirrors the opponent, to strategies that model the opponent's preferences from their offers to find mutually beneficial trades. The annual Automated Negotiating Agents Competition (ANAC) has driven research in this area.
| Concept | Meaning | Example |
|---|---|---|
| Reservation value | Worst acceptable deal | Seller will not go below $800 |
| BATNA | Best alternative without agreement | Another buyer offering $850 |
| Zone of possible agreement | Overlap of acceptable deals | Buyer max $1,000, seller min $800 |
| Pareto efficiency | No mutual improvement possible | Trading delivery time for price |
| Integrative bargaining | Trading across issues | Lower price, longer contract |
Language model agents as negotiators
Language model agents can negotiate in natural language, explaining positions, making offers and finding creative trades. Meta's CICERO combined a language model with strategic planning to play the negotiation-heavy game Diplomacy at a strong human level, coordinating with and persuading human players. Research and early products have AI agents negotiating prices, scheduling meetings between assistants, and handling procurement. These raise distinctive issues:
- Faithful representation: the agent must stay within its principal's limits and preferences, never committing beyond its authority.
- Honesty: agents may be tempted, or trained, to bluff or deceive; designers must decide what persuasion is acceptable, and some deception would violate law or policy.
- Manipulation and robustness: an agent can be manipulated by a counterpart's messages, including prompt injection designed to make it reveal its reservation price or accept bad terms.
- Disclosure: people may have a right to know they are negotiating with an AI agent, and some laws require such disclosure in certain contexts.
- Collusion and market effects: agents from the same provider negotiating on both sides, or many agents learning similar strategies, may affect markets in ways regulators will scrutinize.
Good practice includes explicit limits enforced in code rather than only in prompts, logging of negotiations, human approval for commitments above a threshold, and testing agents against adversarial counterparts.
Worked problem
Finding the zone of possible agreement
A buyer agent may pay at most $12,000 for equipment and has a BATNA offer of $11,500 elsewhere. The seller's minimum is $10,500. What is the zone of possible agreement, and what should the buyer agent never accept?
Show solution
- The buyer's effective limit is its BATNA: paying more than $11,500 is worse than the alternative.
- The seller will accept at least $10,500.
- The zone of possible agreement is $10,500 to $11,500.
- The buyer agent should never accept above $11,500, and should never reveal its limits to the seller.
- Integrative options, such as including installation or a longer warranty, might create value within the zone.
Answer: Between $10,500 and $11,500; never above $11,500.
Fairness and incentives in allocation
Efficient allocation is not the only goal. Allocations may need to be fair: drivers on a delivery platform may expect a reasonable share of good jobs, and shared computing resources may need to guarantee each team a minimum. Fairness criteria include envy-freeness, where no agent prefers another's allocation to its own, and proportionality, where each agent receives at least its fair share by its own valuation. Mechanisms must also consider incentives: if agents gain by misreporting their costs or preferences, a mechanism that is optimal for truthful reports can perform badly in practice. Truthful mechanisms, such as the Vickrey auction and its generalization the Vickrey–Clarke–Groves mechanism, make honest reporting a dominant strategy, at the cost of computational complexity and sometimes revenue.
Online and dynamic allocation
In many systems, tasks and agents arrive continuously: ride requests, delivery orders, support tickets and compute jobs. Online allocation decides as each arrives, without knowing the future, and its performance is measured against what an omniscient planner could have done. Strategies include batching requests over short windows to make better joint decisions, reserving capacity for high-priority work, and periodically reoptimizing existing assignments. Ride-hailing platforms, for example, batch requests over a few seconds and solve matching problems repeatedly, balancing wait times, travel distances and driver earnings. The same ideas apply to agent systems that route tasks among many AI workers and human reviewers.
Learning to negotiate and allocate
Agents can also learn allocation and negotiation strategies from experience, using reinforcement learning against simulated counterparts or historical data. Learned strategies can outperform hand-designed ones but may discover aggressive or deceptive tactics if the reward only values winning, which is why negotiation agents are usually trained with constraints and rewards that also value agreement, fairness and honesty.
Robustness of allocation mechanisms
Allocation mechanisms must also cope with failure: an agent that wins a task may break down, lose connectivity or discover it cannot complete the work. Robust systems reauction or reassign tasks when an agent fails to report progress within a deadline, keep some spare capacity, and record commitments so that no task is silently dropped. Testing mechanisms with simulated failures before deployment reveals weaknesses that efficient but fragile designs hide.
In every allocation and negotiation setting, logging decisions and outcomes allows the mechanism to be audited later. Records of who bid what, who was awarded which task and why, and what agreements agents reached let operators check efficiency and fairness, investigate disputes and detect collusion or manipulation, which is increasingly expected when AI agents act in markets on behalf of people.
Common mistakes
MistakeAssuming simple auctions give optimal allocations.
InsteadCheck efficiency; allow re-trading or better mechanisms.
MistakeCentralizing everything in a fast-changing system.
InsteadCombine central planning with local mechanisms.
MistakeEnforcing negotiation limits only in prompts.
InsteadEnforce limits in code and require approval for commitments.
MistakeNegotiating on a single issue when several exist.
InsteadLook for integrative trades across issues.
MistakeIgnoring manipulation by counterparties.
InsteadTest agents against adversarial messages.
Summary and key terms
- The assignment problem minimizes total cost; the Hungarian algorithm solves it exactly.
- Centralized allocation can be optimal; decentralized methods are robust and adaptive.
- Auctions allocate tasks using agents' private costs.
- Sequential auctions are simple but can be inefficient.
- The contract net protocol announces, bids, awards and reports.
- Negotiation uses reservation values, BATNAs and integrative trades.
- LLM negotiators need enforced limits, honesty norms and manipulation resistance.
- Assignment problem
- Matching tasks to agents at minimum cost.
- Hungarian algorithm
- Polynomial-time exact assignment algorithm.
- Task auction
- Allocating tasks by agents' bids.
- Combinatorial auction
- Auction allowing bids on bundles.
- Contract net protocol
- Announce, bid, award task allocation protocol.
- Reservation value
- Worst acceptable negotiation outcome.
- BATNA
- Best alternative to a negotiated agreement.
- ZOPA
- Zone of possible agreement.
- Integrative negotiation
- Creating value by trading across issues.
- Alternating offers
- Protocol of exchanging proposals in turn.
Practice problems
Work each problem on paper first, then reveal the answer to check.
How many assignments exist for 6 tasks and 6 agents?
Show answer
720.
What algorithm solves assignment exactly and efficiently?
Show answer
The Hungarian algorithm.
Give a drawback of central allocation.
Show answer
Single point of failure or needing truthful reports.
In C10, what was the optimal total distance?
Show answer
20.1.
Why was the sequential auction worse?
Show answer
Early awards took robots better used later.
List the contract net steps.
Show answer
Announce, bid, award, perform and report.
What is a BATNA?
Show answer
Best alternative to a negotiated agreement.
Buyer max $500, seller min $420: ZOPA?
Show answer
$420 to $500.
What did CICERO demonstrate?
Show answer
Strong play in Diplomacy combining language and strategy.
How should an agent's spending limit be enforced?
Show answer
In code, with approval above thresholds.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.