Reference implementation of Vote-Informed Co-Evolution (VICE), the evolutionary algorithm for multi-agent team composition design from the paper
Haochen Wu, Anirudh Kanchi, Alparslan Emrah Bayrak, Oleg B. Sapunkov, Bogdan I. Epureanu. Multi-Agent Team Co-Design of Behavior and Composition for Operational Requirements. Under review at Autonomous Agents and Multi-Agent Systems (JAAMAS).
The repository contains the algorithm, the two baselines it is compared against (ASCE and GA Random), the multi-attribute benchmark problems, and scripts that reproduce the VICE experiments in the paper (Figure "VICE_all"). With the default seed, the code reproduces the published curves exactly. The tests check this.
This repository covers the VICE experiments only. The disaster-relief environment and the IDEAL (multi-agent reinforcement learning) experiments are in hcaawu/IDEAL.
VICE co-evolves three teams. Each team is a population of agents, where an agent is a chromosome with one gene (capability level) per attribute. Each team also keeps a vote memory over the agents it has seen. Every iteration has three phases:
- Evaluation. Score each team (Team Score, TS) and each agent (Agent Score, AS). All agents in the best team get +1 vote, and the best team keeps its best agent.
- Migration. The best agent of each of the other two teams gets −1 vote in its own team. If an equal agent is already in the best team, that agent gets +1 vote there. Otherwise the two migrants become parents, and their offspring joins the best team.
- Natural selection. Every other slot is refilled. With probability
p_mutationthe slot gets a uniformly random agent. Otherwise two parents are drawn from the team's vote memory, with probability proportional to votes, and crossed over.
Crossover and mutation (CrossoverMutation(M, p_c), Algorithm 1 and Eq. 3 in the paper; VICE itself is Algorithm 2). A child is built gene by gene. Each gene comes from parent 1 with probability p_crossover, from parent 2 with probability p_crossover, and otherwise is a uniformly random capability level (probability 1 − 2·p_crossover). Genes are always drawn from the problem's capability levels, so every child is a valid agent and no clipping is needed. In natural selection, a slot instead gets a uniformly random new agent with probability p_mutation (the paper's p_m). Teams hold distinct agents: a duplicate is discarded and the slot is drawn again, either a new random agent or a new child.
| Method | Parent selection | p_crossover |
p_mutation |
|---|---|---|---|
vice |
votes in the team's own memory | 0.45 | 0.2 |
asce (Agent-Score Co-Evolution) |
Agent Score, from the best team's memory | 0.45 | 0.2 |
ga_random (no votes) |
none: every new agent is random | 0 | 1 |
For the 4-agent problem, the migration phase generates two offspring for the best team, and with probability 0.2 the best agent of the best team is not kept (n_offspring=2, p_drop_elite=0.2), as described in the paper. config_for(method, problem) returns these settings.
Metric. Each team remembers the top compositions it has seen. The Team Score Sum (TSS) adds up, over the three teams, the mean TS of each team's top K = 2 compositions. TSS reaches its maximum (3 × optimal TS) only when every team holds two optimal compositions. The algorithm also records the iterations at which the first and second optimal solution types appear.
Each problem has two optimal solution types, for example [ab | bc | cd] and its mirror [ba | cb | dc] for 3 agents with 2 attributes. High capability levels such as x and y give agents a high AS but never appear in an optimal team. This is the trap that agent-score-based selection falls into. See vice/problems.py for the full score definitions.
| Key | Panel | Agents × attributes | Genes | Design options | Iterations |
|---|---|---|---|---|---|
abcdxy_3x2 |
A(a) | 3 × 2 | a b c d x y | ≈ 4.7 × 10⁴ | 1,500 |
abcdpqxy_3x2 |
A(b) | 3 × 2 | a b c d p q x y | ≈ 2.6 × 10⁵ | 10,000 |
abcde_3x3 |
B(a) | 3 × 3 | a b c d e | ≈ 2.0 × 10⁶ | 15,000 |
abcdexy_3x3 |
B(b) | 3 × 3 | a b c d e x y | ≈ 4.0 × 10⁷ | 50,000 |
abcdef_4x3 |
C | 4 × 3 | a b c d e f | ≈ 2.2 × 10⁹ | 500,000 |
Python 3.8 or later.
git clone https://github.com/hcaawu/VICE.git
cd VICE
pip install -r requirements.txtThe algorithm itself only uses the Python standard library. NumPy is used to save results, Matplotlib and seaborn to plot them, and pytest for the tests.
from vice import PROBLEMS, VICEConfig, config_for, run
problem = PROBLEMS["abcde_3x3"]
result = run(problem, config_for("vice", problem), seed=3)
print(result.tss[-1]) # 30.0, the maximum Team Score Sum
print(result.solutions) # [679, 752], iterations where each solution type was found
print(result.top_compositions) # top-2 (TS, composition) per team
# Custom settings
result = run(problem, VICEConfig(p_crossover=0.4, p_mutation=0.1), max_iter=5000, seed=0)For your own problem, create a LetterTeamProblem with your genes, team size, solution types and score bonuses. To use a different scoring model, subclass it and override agent_score and team_score.
# All 5 problems × 3 methods (about 3 minutes in total; the 4-agent
# problem takes the longest). -j runs jobs in parallel.
python experiments/run_paper.py -j 4
# Or one problem at a time
python experiments/run_paper.py -p abcdxy_3x2
# Figure
python experiments/plot_paper.py # writes results/VICE_all.png
# Exact-reproduction tests for the three smaller problems (about 10 s)
python -m pytest testsrun_paper.py writes one results/<problem>_<method>.npz per run (the TSS curve and the solution iterations) and a results/summary.json. The repository already includes these files and the figure for all 15 runs, so plot_paper.py works without rerunning anything.
Expected iterations at which the first and second solution types are found (seed 3):
| Problem | VICE | ASCE | GA Random |
|---|---|---|---|
abcdxy_3x2 |
58, 103 | none | 1363 |
abcdpqxy_3x2 |
410, 1660 | none | 8293 |
abcde_3x3 |
679, 752 | 6416 | 10265 |
abcdexy_3x3 |
3749, 20520 | none | none |
abcdef_4x3 |
49370, 49744 | none | none |
vice/vice.py follows the code that produced the paper's figures step for step, including the order of random draws, so results match exactly. A few details of that code are kept on purpose and are worth knowing if you build on it:
- Two parents are used for crossover, but
n_attributescandidates are drawn from the memory, and the first two are used. - While refilling the best team, the algorithm falls back to random agents if the best team's memory has fewer than two agents, or if the last of the other teams has no votes.
- In ASCE, every team draws parents from the best team's memory.
- A few bonus groups in the team score are irregular, for example the pair
("cd", "dc")in the 2-attribute problems. They are marked invice/problems.py.
@article{wu2025vice,
title = {Multi-Agent Team Co-Design of Behavior and Composition for Operational Requirements},
author = {Wu, Haochen and Kanchi, Anirudh and Bayrak, Alparslan Emrah and Sapunkov, Oleg B. and Epureanu, Bogdan I.},
journal = {Autonomous Agents and Multi-Agent Systems},
note = {Under review},
year = {2025}
}Released under the MIT License.