cycle_analysis module, performing minimal cycle basis calculation and cycle coalescecne.
Project description
cycle-coalescence-algorithm
Introduction
Hello everyone,
I wrote this package during my PhD, when working on the characterization of transport networks.
Have you ever wondered how cycles in graphs form a vector space and encapsulate nesting information? If so, were you never really sure how to deal with this? Here is a tool ready to use, enabling you to calculate the cycle bases, mapping them onto a merging tree, and analyze this tree's asymmetry.
This project is based on the algorithm published in 'Extracting Hidden Hierarchies in 3D Distribution Networks' by Modes et al, 2016. Please acknowledge if used for any further publication or projects.
./notebook contains examples to play with in the form of jupyter notebooks
Installation
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps cycle_analysis
Usage
import networkx as nx
import cycle_analysis.cycle_coalescence as cc
import cycle_analysis.test as cat
# generate a dummy graph for testing
# put an edge weight distribution on the system, available are random/gradient/nested_square
G=nx.grid_graph((7,7,1))
G=cat.generate_pattern(G,'nested_square')
# merge all shortest cycles and calc the merging tree's asymmetry for each branch
asymmetry=cc.calc_cycle_asymmetry(G)
print(asymmetry)
Requirements
networkx
, numpy
Gallery
random weight distribution
nested square weight distribution
gradient weight distribution
Acknowledgement
cycle_analysis
written by Felix Kramer
This implementation is based on the cycle coalescence algorithm as described by Modes et al, 2016. https://journals.aps.org/prx/pdf/10.1103/PhysRevX.6.031009
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
Hashes for cycle_analysis-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c451c8f3c3533b0f6a8feff3ff9efa26b975e3935435c39ed2cb08960e7e1551 |
|
MD5 | 7d387153b25dbab21b869f5443f5dbec |
|
BLAKE2b-256 | 3519bf81b76b064e04fa991d6913f489a7f06cd210bfc2630d632534689efe3b |