Operations Research vs. LLM-Driven Multi-Agent Negotiation
Given a set of engineers with heterogeneous skills and a set of tasks with specific requirements, assign engineers to tasks to optimize project criteria while respecting constraints:
Compared on a common footing — identical instances, identical metrics.
Mixed Integer Linear Programming
An effective-skill factor \(\bar{s}_{et}\) rewards over-qualification (capped at \(\rho\)): one hour of work yields \(\bar{s}_{et}\) units of effort.
Minimize labour cost + priority-weighted penalties for lateness and unstaffed work:
\[ \min\; \sum_{e}\sum_{t}\sum_{h} c_e\, x_{eth} \;+\; P_{\text{late}}\sum_{t}\pi_t\,(b_t - y_t) \;+\; P_{\text{drop}}\sum_{t}\pi_t\,(1 - b_t) \]
Choosing \(P_{\text{drop}} > P_{\text{late}}\) makes the solver leave a task unstaffed only when it is genuinely infeasible.
Capacity — no more than available hours per period:
\[ \sum_{t} x_{eth} \le C_e\, a_{eh} \qquad \forall e, h \]
On-time delivery — enough effort by the deadline:
\[ \sum_{e}\sum_{h \le d_t} \bar{s}_{et}\, x_{eth} \ge w_t\, y_t \qquad \forall t \]
Plus assignment-linking (\(x_{eth} \le C_e b_t\)), ordering (\(y_t \le b_t\)) and structural skill qualification.
LangGraph + local open-weight LLMs
Advocates for the engineer: fair workload, good skill fit. May accept, decline, or raise concerns.
Delivers projects: proposes assignments, balances the team, resolves conflicts.
Represents the business: sets priorities, gives the final approve / reject on the plan.
All three roles are driven by the same shared model — only the system prompt differs.
DEVELOPER_SYSTEM_PROMPT = """
You are {name}, a software engineer with a '{persona}' attitude.
Your skills (0-1): {skills}. Capacity: {budget} h; committed: {load} h.
Accept work that fits your skills and remaining capacity;
reject a poor skill match or a clear overload. Be decisive.
"""
The LLM shapes which feasible allocation emerges — never whether it is feasible.
The allocation is a bounded state machine with conditional transitions.
C4 container view
A controlled cross-model study
| Size | Engineers | Tasks | Skills | Horizon |
|---|---|---|---|---|
| Small | 5 | 8 | 6 | 8 |
| Medium | 8 | 12 | 8 | 10 |
| Large | 12 | 18 | 10 | 12 |
Greedy decoding (temperature 0) → each model is deterministic per instance.
Same harness, only the model changes — three regions, a wide range of scale.
| Model | Developer | Region | Size |
|---|---|---|---|
| Llama-3.1-8B | Meta | US | 8.0B |
| Qwen2.5-7B | Alibaba | CN | 7.6B |
| Mistral-7B | Mistral AI | EU | 7.2B |
| Phi-4-mini | Microsoft | US | 3.8B |
Run locally on Apple-Silicon (MPS), half precision — no hosted API.
Both methods are scored by identical code:
| Size | |E| | |T| | Cost (USD) | Complete | On-time | Time (s) |
|---|---|---|---|---|---|---|
| Small | 5 | 8 | 20,905 | 89.6% | 89.6% | 0.268 |
| Medium | 8 | 12 | 35,782 | 97.2% | 97.2% | 0.037 |
| Large | 12 | 18 | 51,334 | 100.0% | 100.0% | 0.055 |
| Model | Complete | Skill | Wkld CV | Gap | Calls | Time (s) |
|---|---|---|---|---|---|---|
| Llama-3.1-8B (US) | 93.1% | 1.68 | 0.74 | 11.9% | 9.1 | 105.4 |
| Qwen2.5-7B (CN) | 95.6% | 1.68 | 0.69 | 5.7% | 8.9 | 83.5 |
| Mistral-7B (EU) | 95.6% | 1.68 | 0.62 | 5.2% | 9.1 | 135.6 |
| Phi-4-mini (US) | 95.6% | 1.66 | 0.66 | 5.3% | 8.8 | 57.7 |
How far above the MILP optimum — lower is better.
Runtime and LLM-call volume per instance.
The optimiser answers “what is the least-cost feasible allocation?” — the agents answer “what allocation would these stakeholders plausibly agree to, and why?”
Questions?