8000 GitHub - ankur-tutlani/social-norms: A repository for exploring evolutionary game dynamics, network-based strategy adaptation, and social norms evolution.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A repository for exploring evolutionary game dynamics, network-based strategy adaptation, and social norms evolution.

License

Notifications You must be signed in to change notification settings

ankur-tutlani/social-norms

Repository files navigation

Overview

This repository contains a comprehensive suite of functions and scripts for studying evolutionary game dynamics, social norms evolution, and network-based strategy adaptation. It includes tools for modeling and analyzing Nash equilibria, simulating strategy evolution in dynamic networks (using Erdős–Rényi and Barabási–Albert random networks), and visualizing trends and norms. Additionally, R scripts calculate stability metrics (eigenvalues, Jacobians) for replicator and logit dynamics, offering insights into equilibrium behavior and strategic stability. These components provide a robust framework for exploring the interplay between network topology and evolutionary dynamics. The next section provides a brief explanation of all the code files available in the repository.

Explanation

  1. Nashequilibrium.py: This code models a two-player game using Nashpy to compute Nash equilibria from defined payoff matrices. It identifies stable strategy profiles where players cannot unilaterally improve their outcomes, supporting analysis of strategic behavior in social norms evolution.
  2. Payofffunction.py : This function models how agents in a network adapt their strategies based on payoffs and neighbor interactions. It incorporates fixed constraints and randomness to simulate decision-making dynamics.
  3. NetworkProperties.py: This function analyzes a network graph to calculate its density, diameter, clustering coefficient, and tail properties based on a power-law fit of degree distribution. It categorizes the tail as heavy, medium, or low based on the estimated power-law exponent.
  4. ErdosRenyiGraph.py: This function simulates strategy evolution in a dynamic network of agents using an Erdős–Rényi random graph, where connections are formed based on a specified probability. Agents adapt strategies over time through payoff-based interactions and perturbation, with emerging norms and strategy trends analyzed. Results include visualizations of network states and strategy distributions.
  5. ExecutingERgraph.py: This script analyzes network properties and simulates strategy evolution within dynamic random graphs. It generates Erdős–Rényi networks with varying connection probabilities, evaluates their structural features (e.g., density, diameter, clustering, fat-tailedness), and stores these metrics. Two specific cases as an example are then simulated using the simulation_function_neighbors2 to study strategy dynamics and emerging norms, visualized through network states and trends.
  6. Barabási–AlbertGraph.py: This function simulates strategy evolution in a hybrid network where an Erdős–Rényi graph is used as the initial input for constructing a Barabási–Albert network. The focus is on the Barabási network, which evolves through preferential attachment to model hierarchical connectivity. Agents adapt strategies based on payoff-driven interactions, with emerging norms and trends analyzed through visualizations of network states and strategy distributions.
  7. ExecutingBAgraph.py: This script is an application of the previous function to test the creation of Barabási–Albert networks using varying parameter values. It uses an Erdős–Rényi graph as the initial input for the Barabási–Albert network, ensuring connectivity before expansion. Network properties like density, diameter, clustering, and fat-tailedness are analyzed across iterations. Some specific combinations of values are then tested which simulate strategy evolution.
  8. Phasediagram.R: This R script analyzes dynamic systems in two-strategy games by generating phase diagrams using different payoff matrices and dynamic models (Replicator, BNN, Smith, and Logit dynamics). A custom phaseDiagram2S_test function has been created. By varying the payoff matrix (Tables 1–4) and parameters like eta in Logit dynamics, the script visualizes equilibrium points, strategy evolution, and system behavior under various conditions. It supports exploring strategic stability and evolutionary trajectories.
  9. Jacobian.R: This R script calculates the Jacobian matrix and eigenvalues for replicator and logit dynamics in a two-strategy evolutionary game. It uses defined equilibrium points and payoff parameters to assess system stability and dynamic behavior. The eigenvalues of the Jacobian matrix at equilibrium are critical for analyzing the stability of the strategies, providing insights into the dynamics' convergence or divergence in evolutionary systems.

References

Not all parameters in the provided Python functions require configuration. Redundant parameters can be assigned arbitrary values. For a detailed breakdown of the parameters, refer to the resources listed below.

  1. https://github.com/ankur-tutlani/multi-agent-decision
  2. https://cran.r-project.org/web/packages/EvolutionaryGames/index.html
0