Skip to main content

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.

modes

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
random

nested square weight distribution
nested

gradient weight distribution
gradient

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

cycle_analysis-0.0.1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

cycle_analysis-0.0.1-py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 3

Supported by

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