Unverified Commit f25401a6 authored by Felix's avatar Felix Committed by GitHub
Browse files

update readme

parent 2348c3ed
# cycle-coalescence-algorithm
## Introduction
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.
Have you ever wondered how cycles in graphs form a vector space and encapsulate nesting information? 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](./gallery/modes_merging_algorithm_2016.png)
## Introduction
This python module allows users to analyze weighted, undirected simple graphs for their nested cycle structure by performing two major functions: Calculating minimal cycle bases (Horton algorithm) and computing the merging tree (cycle coalescence algorithm). The algorithm is described in "Modes et al,'Extracting Hidden Hierarchies in 3D Distribution Networks', 2016" and basically follows the shown scheme below:
- All fundamentals minimal cyles (minimal number of edges) are listed in the weighted graph G and mapped onto the leaves of a new tree T.
- Then one identifies the lightest edge e in G and merges the two smallest cycles along this edge, creating a new vertex in the tree T for the merger cycle
- remove the original two cycles and proceed with the next lightest edge e until all cycles in G are merged
- finally calculate the tree asymmetry using the techniques of "Van-Pelt et al, 'Tree Asymmetry—A Sensitive and Practical Measure for Binary Topological Trees' ,1992"
- the asymmetry orderparameter will be be 1 for perfecly asymmetric trees and 0 for perfectly symmetric trees
![modes](./gallery/modes_merging_algorithm_2016.png)
Figure taken from: Modes et al,'Extracting Hidden Hierarchies in 3D Distribution Networks', 2016
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
pip install cycle_analysis
## Usage
## Usage
Currently this implementation only supports networkx graphs.
Call cycle_analysis.cycle_coalescence for graph analysis, while cycle_analysis.test provides you with pre-customized functions to put specific weight patterns onto the graph: random/gradient/nested_square
```python
import networkx as nx
import cycle_analysis.cycle_coalescence as cc
......@@ -26,9 +33,9 @@ G=cat.generate_pattern(G,'nested_square')
asymmetry=cc.calc_cycle_asymmetry(G)
print(asymmetry)
```
./notebook contains examples to play with in the form of jupyter notebooks
## Requirements
``` networkx ```, ``` numpy ```
``` python3.6+ ```,``` networkx ```, ``` numpy ```
## Gallery
random weight distribution\
![random](./gallery/random.png)
......@@ -42,4 +49,4 @@ gradient weight distribution\
```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
https://journals.aps.org/prx/pdf/10.1103/PhysRevX.6.031009. Please acknowledge if used for any further publication or projects.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment