Skip to content

Commit 6b2d01e

Browse files
committed
initial commit
0 parents  commit 6b2d01e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+39360
-0
lines changed

.gitignore

+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
db.sqlite3-journal
62+
63+
# Flask stuff:
64+
instance/
65+
.webassets-cache
66+
67+
# Scrapy stuff:
68+
.scrapy
69+
70+
# Sphinx documentation
71+
docs/_build/
72+
73+
# PyBuilder
74+
target/
75+
76+
# Jupyter Notebook
77+
.ipynb_checkpoints
78+
79+
# IPython
80+
profile_default/
81+
ipython_config.py
82+
83+
# pyenv
84+
.python-version
85+
86+
# pipenv
87+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
88+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
89+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
90+
# install all needed dependencies.
91+
#Pipfile.lock
92+
93+
# celery beat schedule file
94+
celerybeat-schedule
95+
96+
# SageMath parsed files
97+
*.sage.py
98+
99+
# Environments
100+
.env
101+
.venv
102+
env/
103+
venv/
104+
ENV/
105+
env.bak/
106+
venv.bak/
107+
108+
# Spyder project settings
109+
.spyderproject
110+
.spyproject
111+
112+
# Rope project settings
113+
.ropeproject
114+
115+
# mkdocs documentation
116+
/site
117+
118+
# mypy
119+
.mypy_cache/
120+
.dmypy.json
121+
dmypy.json
122+
123+
# Pyre type checker
124+
.pyre/

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Wei Chien Benny Chin <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# HETA: Hierarchical Edge Type Analysis
2+
3+
## Intro
4+
5+
An algorithm for detecting edge types using common neighbor concept.
6+
7+
This is a rewritten of: https://github.com/canslab1/Identification-Algorithm/ , into convenient function that take NetworkX Graph objects, and to be compatible with Python3.
8+
9+
#### Install
10+
11+
```sh
12+
pip install -e .
13+
```
14+
15+
#### Usage
16+
17+
Please check the test.py script.
18+
19+
In simple:
20+
21+
```python
22+
23+
# import necessary packages and heta package
24+
import networkx as nx
25+
import heta
26+
27+
# read file as nx.Graph() object
28+
fp = 'data/net/14p.net'
29+
g = nx.Graph(nx.read_pajek(fp))
30+
31+
# run algorithm using default parameter
32+
g, ext_dic, int_dic = heta.bridge_or_bond(g)
33+
34+
# get all edge types
35+
for u, v, d in g.edges(data=True):
36+
print(u, v, d['type'])
37+
38+
# draw the results
39+
import matplotlib.pyplot as plt
40+
heta.draw_result(g, layout='sprint')
41+
plt.show()
42+
43+
# external and internal threshold
44+
print(ext_dic, int_dic)
45+
46+
# fingerprint analysis
47+
# proportion of ['bond', 'local', 'global', 'silk']
48+
print(heta.fingerprint(g))
49+
50+
```
51+
52+
53+
54+
## Article reference
55+
56+
### Beyond Bond Links in Complex Networks: Local Bridges, Global Bridges and Silk Links
57+
58+
#### Highlights
59+
60+
- An identification algorithm for determining hierarchical link types is described.
61+
- Multi-hierarchy level link types are identified using the common neighbor concept.
62+
- Two applications are demonstrated: fingerprint analysis and network partitioning.
63+
- Fingerprint analysis is used to compare topological structures among networks.
64+
- Hierarchical link structures are used to partition networks into communities.
65+
66+
#### Abstract
67+
68+
Many network researchers use intuitive or basic definitions when discussing the importance of strong and [weak links](https://www.sciencedirect.com/topics/physics-and-astronomy/weak-link) and their roles. Others use an approach best described as “if not strong, then weak” to determine the strengths and weaknesses of individual links, thus deemphasizing hierarchical network structures that allow links to express different strength levels. Here we describe our proposal for a hierarchical edge type analysis (HETA) algorithm for determining link types at multiple network hierarchy levels based on the common neighbor concept plus statistical factors such as bond links, *k*th-layer local bridges, global bridges, and silk links—all generated during long-term network development and evolution processes. Two sets of networks were used to validate our proposed algorithm, one consisting of 16 networks employed in multiple past studies, and one consisting of two types of one-dimensional small-world networks expressing different random rewiring or shortcut addition probabilities. Two applications with potential for developmental contributions are demonstrated: a network fingerprint analysis framework, and a hierarchical network community [partition method](https://www.sciencedirect.com/topics/mathematics/partition-method).
69+
70+
Keywords: Network topology, Hierarchy of links, Common neighbor concept, Fingerprint analysis, Hierarchical community partition, Edge type analysis
71+
72+
73+
article url: https://www.sciencedirect.com/science/article/pii/S0378437119306375
74+
75+
cite this as:
76+
Huang C. Y., Chin, W. C. B., Fu, Y. H., & Tsai, Y. S. (in press) Beyond bond links in complex networks: Local bridges, global bridges and silk links. Physica A: Statistical Mechanics and its Applications. DOI: https://doi.org/10.1016/j.physa.2019.04.263 .

data/net/14p.net

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
*Vertices 12
2+
1 "I1"
3+
2 "W3"
4+
3 "W4"
5+
4 "W1"
6+
5 "W2"
7+
6 "W5"
8+
7 "S1"
9+
8 "W7"
10+
9 "W8"
11+
10 "S4"
12+
11 "W9"
13+
12 "W6"
14+
*Arcs
15+
*Edges
16+
1 2 1
17+
1 3 1
18+
1 4 1
19+
1 5 1
20+
4 1 1
21+
4 2 1
22+
4 6 1
23+
4 3 1
24+
4 7 1
25+
4 5 1
26+
5 1 1
27+
5 4 1
28+
5 2 1
29+
5 3 1
30+
5 7 1
31+
2 1 1
32+
2 6 1
33+
2 3 1
34+
2 7 1
35+
2 4 1
36+
2 5 1
37+
3 2 1
38+
3 5 1
39+
3 7 1
40+
3 6 1
41+
3 1 1
42+
3 4 1
43+
6 2 1
44+
6 4 1
45+
6 3 1
46+
6 7 1
47+
6 8 1
48+
7 5 1
49+
7 4 1
50+
7 2 1
51+
7 3 1
52+
7 6 1
53+
8 6 1
54+
8 9 1
55+
8 10 1
56+
8 11 1
57+
8 12 1
58+
9 8 1
59+
9 12 1
60+
9 11 1
61+
9 10 1
62+
12 8 1
63+
12 9 1
64+
12 11 1
65+
11 10 1
66+
11 9 1
67+
11 8 1
68+
11 12 1
69+
10 9 1
70+
10 8 1
71+
10 11 1

0 commit comments

Comments
 (0)