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.8.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.8-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file cognac-0.1.8.tar.gz.

File metadata

  • Download URL: cognac-0.1.8.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.8.tar.gz
Algorithm Hash digest
SHA256 3fc7fc20550de2f9eb991db37ebd8bf6cc8c149ddf24995f01167bc85d03de92
MD5 0551d132cead558d0295413917f6fb1f
BLAKE2b-256 61737ba633aef3eb8c9b973ae5fb30ffc9e38cd0452ce3ccd4d1d62debd00ea0

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognac-0.1.8.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.8-py3-none-any.whl.

File metadata

  • Download URL: cognac-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 43.8 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 25f61b6718ad4ac5a6479992e1673f4d549ca6ab6dc67c15846ad20665eba0c7
MD5 634cbc7c88bd7d610e5c82a6eb109e05
BLAKE2b-256 60cf031be33fe6c13afd5da301b482031ed624d3b0e0d96090741eb2b387b062

See more details on using hashes here.

Provenance

The following attestation bundles were made for cognac-0.1.8-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