Published July 19, 2025 | Version v10
Software Open

Network Entropy as a key to the past: Quantifying adaptive cycles in complex networks: SUPPLEMENTARY MATERIAL

  • 1. ROR icon Universitat de València
  • 2. Universitat Politècnica de València
  • 3. National Centre for Scientific Research-Demokritos

Description

How can we objectively measure and characterize the phases of complex adaptive systems? Despite widespread recognition of the Adaptive Cycle Model's value for understanding system dynamics, its application has been constrained by the predominance of qualitative approaches. This paper introduces a novel methodological framework that channels the analytical power of entropy to quantify and characterize adaptive cycle phases in complex networks. Our approach proposes integrating four sophisticated entropy measures—degree, eigenvector, community, and betweenness entropy—into a comprehensive system for identifying and measuring phase transitions. We validate this innovative framework through an empirical test case analyzing archaeological networks from Eastern Iberia (5300-3800 cal BP), where entropy patterns reveal previously undetectable signatures of system transformation. The method's application demonstrates remarkable precision in phase identification, with entropy variations providing clear mathematical signatures for each adaptive cycle phase. This breakthrough in quantitative analysis enables objective comparison of system states. It reveals subtle patterns in phase transitions that traditional approaches miss entirely, opening new possibilities for studying complex system dynamics across multiple disciplines.

PANARCH (Phase Analysis of Network Adaptive Research & Complex Hierarchies)

This compendium accompanies the manuscript "Entropy as a key to the past: Quantifying adaptive cycles in complex networks" by Joaquín Jiménez-Puerto.

Repository Structure

  • PANARCH.py: Main script implementing adaptive cycle analysis in networks. Contains core classes for phase detection and metric calculations.
  • ABM.py: Agent-based model implementation for network simulation.
  • Sensitivity_Analysis.py: Script for sensitivity analysis and advanced statistical testing.
  • .graphml files: Network files used in the analysis (in the root directory).

Software Requirements

Core Dependencies

  • Python 3.10.9 (This exact version was used in development - any Python 3.10.x should work)
  • Key libraries (specific versions in requirements.txt):
    • networkx==2.8.4
    • numpy==1.24.4
    • scipy==1.13.0
    • matplotlib==3.5.2
    • seaborn==0.11.2
    • pandas==1.4.3
    • plotly==5.9.0
    • statsmodels==0.13.2
    • scikit-learn==1.1.1
    • setuptools>=58.0.0 (required to avoid 'distutils' and 'build_meta' errors)

Verifying Your Setup

Before starting with the analysis, verify your environment:

# Make the verification script executable
chmod +x verify_setup.sh

# Run verification
./verify_setup.sh

This will:

  • Check Python installation (must be version 3.10.x)
  • Verify setuptools version (≥58.0.0) to avoid common errors
  • Verify all required packages with their exact versions
  • Check for all necessary files
  • Run basic functionality tests
  • Run unit tests if available

If any step fails, check the error message and consult the Troubleshooting section below.

Getting Started

  1. Download the archive from Zenodo:

  2. Extract the archive to your working directory:

unzip panarch.zip
cd panarch
  1. Create and activate a virtual environment:
python3.10 -m venv panarch-env

# On Unix/macOS:
source panarch-env/bin/activate

# On Windows:
panarch-env\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Usage Instructions

Running with Python

  1. Start with the main analysis:
python PANARCH.py

This will process the network files and generate initial visualizations.

  1. Run the agent-based simulations:
python ABM.py

This generates simulation results and related plots.

  1. Perform sensitivity analysis:
python Sensitivity_Analysis.py

This conducts statistical tests and creates additional visualizations.

Running with Docker

# Build the Docker image
docker build -t panarch .

# Run the analysis
docker run -it panarch

Relationship to Manuscript Figures and Tables

PANARCH.py Output

  • HTML 3D trajectory plot showing network evolution
  • Figure 6: Phase space visualization
  • Figure 7: Transition network diagram
  • CSV: Summary metrics by adaptive phase

ABM.py Output

  • Figure 5) A,B,C,D:
    • Agent-based model simulation results
    • Phase distribution in simulations
    • Network metrics over time
  • json: Simulation statistics

Sensitivity_Analysis.py Output

  • Figure 4) A,B,C,D:
    • Phase distribution in sensitivity analysis
    • Weight space heatmap
    • Statistical test results
  • Transition probability matrix
  • CSV: Sensitivity analysis results

Troubleshooting

Common issues and solutions:

  • ModuleNotFoundError: No module named 'distutils':

    • This is caused by an outdated setuptools version
    • Solution: pip install --upgrade setuptools>=58.0.0
    • Make sure you're using Python 3.10.x
  • ImportError: Cannot import 'setuptools.build_meta':

    • This is also related to setuptools compatibility issues
    • Solution: pip install --upgrade setuptools>=58.0.0
  • Package version mismatches:

    • Ensure you use the exact versions specified in requirements.txt
    • Solution: pip install -r requirements.txt
  • File not found errors:

    • Ensure all files are in the root directory (not in subdirectories)
    • Check that the file "Sensitivity_Analysis.py" doesn't have spaces in the name

Reproducibility Notes

  • All random seeds are fixed (set to 42) for reproducibility
  • Input data files (.graphml) are included in the root directory
  • Each script includes detailed logging for traceability
  • Unit tests ensure core functionality
  • This compendium has been tested on multiple systems to ensure reproducibility
  • Using exact package versions is essential for reproducibility

License and Citation

This software is released under the MIT License with Academic Citation Requirement. If you use this code in your research, please cite:

Jiménez-Puerto, J. (2025). PANARCH (Phase Analysis of Network Adaptive Research & Complex Hierarchies): Network Entropy as a key to the past: Quantifying adaptive cycles in complex networks.

Files

license.txt

Files (1.7 MB)

Name Size Download all
md5:6000ad589ad26618ec0bdf39f0338993
33.7 kB Download
md5:5124141e4357e96365ca32d819a56834
2.2 kB Download
md5:c82e2eff769b57fc31a166435ad9c933
1.4 kB Preview Download
md5:9dc80dd1c14c2049a6d23321bdaf7113
64.7 kB Download
md5:3c8038ac4270295d244c868e496b9acc
6.0 kB Preview Download
md5:0c88684d8527c848a73e7fa885c822b9
3.5 kB Preview Download
md5:964222a5db49ac7bbe4e5ac3e3433a85
272 Bytes Preview Download
md5:6ae437ba7f32b0acada289cc2738aaf9
25.4 kB Download
md5:1994e62437f5562f9dd85f70d59f83e7
151.3 kB Download
md5:41fa424f6be3685456212915a5a6d464
55.0 kB Download
md5:08ae47e5cefbcbc7d6e3a4caabbe613e
559.7 kB Download
md5:cc30a572ab92276b5a7d84b751e2dbe4
76.6 kB Download
md5:3945ca8d4d615fda99ad5eee451ba679
92.3 kB Download
md5:e7397a9e4102bf22bfb7f59a836f021e
287.2 kB Download
md5:c73c76472e35fc0a72236471fb8c7a96
103.8 kB Download
md5:1f4fa3d3b644133309d8e8736d81e73e
82.1 kB Download
md5:67cb69b38cf793183d46906ba631ff0b
62.5 kB Download
md5:554b254744d0dcd03c51b899286b078e
89.0 kB Download
md5:3254c864eeed0e3cf881767c18b4b199
3.9 kB Download

Additional details

Additional titles

Subtitle (En)
PANARCH (Phase Analysis of Network Adaptive Research & Complex Hierarchies)

Software

Programming language
Python