Skip to main content

Cooperative Graph-based Networked Agent Challenges for Multi-Agent Reinforcement Learning.

Project description

🥃 COGNAC: COoperative Graph-based Networked Agent Challenges

Downloads PyPI - Python Version PyPI - Version LICENSE Documentation Status

📚 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:

drawing


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

cognac-0.1.7.tar.gz (9.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cognac-0.1.7-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

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

Hashes for cognac-0.1.7.tar.gz
Algorithm Hash digest
SHA256 1dc3442a09b502bed045f3138bf2eab2cc83ca02a729b66a483b42d3ec956d60
MD5 1e7cf6f66d152a4c0a7ddf0fb2b8dc45
BLAKE2b-256 3eab57216fb1fd0138b24896e8bf4655ebf2ed0c99a538e9c0d8e2952a20a7ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognac-0.1.7.tar.gz:

Publisher: python-publish.yml on yojul/cognac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for cognac-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 583f83722fe566d8c94eebb6e81ed25fa0e921de1569d6ed0efdcfb932d5ed4f
MD5 752065a1cccb51c9a0458eadeba03856
BLAKE2b-256 d9eeef16e3f014b7f76c41b21e328a3280ff93f0e433b8dc921b135565861b22

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognac-0.1.7-py3-none-any.whl:

Publisher: python-publish.yml on yojul/cognac

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page