Cooperative Graph-based Networked Agent Challenges for Multi-Agent Reinforcement Learning.
Project description
🥃 COGNAC: COoperative Graph-based Networked Agent Challenges
📚 Documentation is available here : https://cognac-marl.readthedocs.io/en/latest/ .
COGNAC is a Python-based benchmark suite offering flexible, graph-structured, cooperative multi-agent environments for MARL research. The package offers standardized minimal implementations of several well-known theoretical graph-based MARL problems taken from the literature, adapted for empirical benchmarking with modern RL tooling.
🎯 Benchmark example available here
Getting Started
Standard Installation
You can install cognac from pip very easily if you want to use the environment and all standard features out-of-the-box.
pip install cognac
Advanced installation
If you plan to explicitely modify the environments, not only changing hyperparameters but also changing the dynamics. We recommend the following :
git clone https://github.com/yojul/cognac.git
cd cognac
pip install -e .
Quickstart
from cognac.env import BinaryConsensusNetworkEnvironment
from cognac.utils.graph_utils import generate_adjacency_matrix, plot_influence_graph
# Utility for generating random adjacency matrix
adjacency_matrix = generate_adjacency_matrix(10)
# Ploting influence graph (see figure below)
plot_influence_graph(adjacency_matrix)
# Instantiating environment with adjacency matrix and default parameters
env = BinaryConsensusNetworkEnvironment(adjacency_matrix=adjacency_matrix)
# Standard PettingZoo usage. See PettingZoo documentation for more details.
obs, infos = env.reset()
obs, rewards, dones, truncs, infos = env.step(
{agent: env.action_space(agent).sample() for agent in env.possible_agents}
)
Here is an example of randomly generated adjacency matrix:
List of Environments
| Environment | Modular Size | Graph Agnostic | Joint State Space | Joint Act. Space | Env. description |
|---|---|---|---|---|---|
| Firefighting Graph (1D) | ✔️ | ❌ | $$\theta^N$$ | $$2^N$$ | Multiple agents (firemen) cooperate to extinguish fires on a line of houses, with partial and noisy observations of fire levels, probabilistic fire spreading and extinguishing dynamics, and rewards based on reducing fire levels at their controlled locations. |
| Firefighting Graph (2D) | ✔️ | ❌ | $$\theta^{N \times M}$$ | $$4^N$$ | 2-Dimensional adaptation of the 1D env with a grid of houses. Each agent control 4 houses. |
| Binary Consensus | ✔️ | ✔️ | $$2^N$$ | $$2^N$$ | Agents with binary votes iteratively choose to keep or switch their vote based on local neighborhood observations, aiming to reach consensus on the initial majority opinion within a time horizon on a graph-structured network. |
| SysAdmin | ✔️ | ✔️ | $$9^N$$ | $$2^N$$ | Agents manage a network of computers that can be good, faulty, or dead, choosing at each step whether to reboot machines to restore functionality while balancing task progress, with the goal of maximizing completed tasks under fault propagation on a graph. |
| Multi-commodity Flow | ✔️ | ❌ | $$\rho_{max}^{k \times E}$$ | $$\rho_{max}^{k \times E}$$ | Each node-agent directs integer-valued flows of multiple commodities through outgoing edges on a capacitated network graph, aiming to minimize the total flow circulation cost while satisfying capacity and flow conservation constraints. |
Citing
If you used this environment for your experiments or found it helpful, consider citing it:
@inproceeding{sintes2025cognac,
title={COGNAC: Cooperative Graph-based Networked Agent Challenges for Multi-Agent Reinforcement Learning},
author={Sintes, Jules and Busic, Ana},
url={\url{https://github.com/yojul/cognac}},
journal={Advances in Neural Information Processing Systems},
year={2025}
}
License
This project is licensed under the Apache-2.0 License. See LICENSE.txt for details.
Contact
For questions or feedback, please open an issue or contact the maintainer:
- Repo Owner: Jules Sintes, INRIA Paris, DIENS, École Normale Supérieure, PSL University.
- Email: jules.sintes@inria.fr
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cognac-0.1.7.tar.gz.
File metadata
- Download URL: cognac-0.1.7.tar.gz
- Upload date:
- Size: 9.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dc3442a09b502bed045f3138bf2eab2cc83ca02a729b66a483b42d3ec956d60
|
|
| MD5 |
1e7cf6f66d152a4c0a7ddf0fb2b8dc45
|
|
| BLAKE2b-256 |
3eab57216fb1fd0138b24896e8bf4655ebf2ed0c99a538e9c0d8e2952a20a7ba
|
Provenance
The following attestation bundles were made for cognac-0.1.7.tar.gz:
Publisher:
python-publish.yml on yojul/cognac
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognac-0.1.7.tar.gz -
Subject digest:
1dc3442a09b502bed045f3138bf2eab2cc83ca02a729b66a483b42d3ec956d60 - Sigstore transparency entry: 704927521
- Sigstore integration time:
-
Permalink:
yojul/cognac@1ba121ae6b593fd37b1cde1966a7d3a4e669a172 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/yojul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1ba121ae6b593fd37b1cde1966a7d3a4e669a172 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cognac-0.1.7-py3-none-any.whl.
File metadata
- Download URL: cognac-0.1.7-py3-none-any.whl
- Upload date:
- Size: 43.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
583f83722fe566d8c94eebb6e81ed25fa0e921de1569d6ed0efdcfb932d5ed4f
|
|
| MD5 |
752065a1cccb51c9a0458eadeba03856
|
|
| BLAKE2b-256 |
d9eeef16e3f014b7f76c41b21e328a3280ff93f0e433b8dc921b135565861b22
|
Provenance
The following attestation bundles were made for cognac-0.1.7-py3-none-any.whl:
Publisher:
python-publish.yml on yojul/cognac
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cognac-0.1.7-py3-none-any.whl -
Subject digest:
583f83722fe566d8c94eebb6e81ed25fa0e921de1569d6ed0efdcfb932d5ed4f - Sigstore transparency entry: 704927524
- Sigstore integration time:
-
Permalink:
yojul/cognac@1ba121ae6b593fd37b1cde1966a7d3a4e669a172 -
Branch / Tag:
refs/tags/v0.1.7 - Owner: https://github.com/yojul
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@1ba121ae6b593fd37b1cde1966a7d3a4e669a172 -
Trigger Event:
release
-
Statement type: