# ANGEL
[![Test and Coverage (Ubuntu)](https://github.com/GiulioRossetti/ANGEL/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/GiulioRossetti/ANGEL/actions/workflows/test_ubuntu.yml)
[![codecov](https://codecov.io/gh/GiulioRossetti/ANGEL/branch/master/graph/badge.svg?token=3YJOEVK02B)](https://codecov.io/gh/GiulioRossetti/ANGEL)
[![PyPI download month](https://img.shields.io/pypi/dm/angel-cd.svg?color=blue&style=plastic)](https://pypi.python.org/pypi/angel-cd/)
Community discovery in complex networks is an interesting problem with a number of applications, especially in the knowledge extraction task in social and information networks.
However, many large networks often lack a particular community organization at a global level.
In these cases, traditional graph partitioning algorithms fail to let the latent knowledge embedded in modular structure emerge, because they impose a top-down global view of a network.
We propose here a simple local-first approach to community discovery, namely **Angel**, able to unveil the modular organization of real complex networks.
This is achieved by democratically letting each node vote for the communities it sees surrounding it in its limited view of the global system, i.e. its ego neighborhood, using a label propagation algorithm; finally, the local communities are merged into a global collection.
Moreover, we provide also an evolution of Angel, namely **ArchAngel**, designed to extract community from evolving network topologies.
**Note:** Angel has been integrated within [CDlib](http://cdlib.readthedocs.io) a python package dedicated to community detection algorithms, check it out!
## Installation
You can easily install the updated version of Angel (and Archangel) by using pip:
```bash
pip install angel_community
```
or using conda
```bash
conda install -c giuliorossetti angel_community
```
## Implementation details
*Required input format(s)*
Angel:
.ncol edgelist (nodes represented with integer ids).
```
node_id0 node_id1
```
ArchAngel:
Extended .ncol edgelist (nodes represented with integer ids).
```
node_id0 node_id1 snapshot_id
```
# Execution
Angel is written in python and requires the following package to run:
- python 3.x
- python-igraph
- networkx
- tqdm
## Angel
```python
import angel as a
an = a.Angel(filename, threshold=0.4, min_comsize=3, outfile_name="angel_communities.txt")
an.execute()
```
Where:
* filename: edgelist filename
* threshold: merging threshold in [0,1]
* min_com_size: minimum size for communities
* out_filename: desired filename for the output
or alternatively
```python
import angel as a
an = a.Angel(graph=g, threshold=0.4, min_com_size=3, out_filename="communities.txt")
an.execute()
```
Where:
* g: an igraph.Graph object
## ArchAngel
```python
import angel as a
aa = a.ArchAngel(filename, threshold=0.4, match_threshold=0.4, min_com_size=3, outfile_path="./")
aa.execute()
```
Where:
* filename: edgelist filename
* threshold: merging threshold in [0,1]
* match_threshold: cross-time community matching threshold in [0, 1]
* min_com_size: minimum size for communities
* outfile_path: path for algorithm output files
Raw data
{
"_id": null,
"home_page": "https://github.com/GiulioRossetti/ANGEL",
"name": "angelcommunity",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "complex-networks,community discovery",
"author": "Giulio Rossetti",
"author_email": "giulio.rossetti@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/56/50/4c4ff6087b8d2a2a2a92e43533a6a4e758227c1a1e5093e6510de398cb4d/angelcommunity-2.0.0.tar.gz",
"platform": null,
"description": "# ANGEL\n[![Test and Coverage (Ubuntu)](https://github.com/GiulioRossetti/ANGEL/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/GiulioRossetti/ANGEL/actions/workflows/test_ubuntu.yml)\n[![codecov](https://codecov.io/gh/GiulioRossetti/ANGEL/branch/master/graph/badge.svg?token=3YJOEVK02B)](https://codecov.io/gh/GiulioRossetti/ANGEL)\n[![PyPI download month](https://img.shields.io/pypi/dm/angel-cd.svg?color=blue&style=plastic)](https://pypi.python.org/pypi/angel-cd/)\n\nCommunity discovery in complex networks is an interesting problem with a number of applications, especially in the knowledge extraction task in social and information networks. \nHowever, many large networks often lack a particular community organization at a global level. \nIn these cases, traditional graph partitioning algorithms fail to let the latent knowledge embedded in modular structure emerge, because they impose a top-down global view of a network. \nWe propose here a simple local-first approach to community discovery, namely **Angel**, able to unveil the modular organization of real complex networks. \nThis is achieved by democratically letting each node vote for the communities it sees surrounding it in its limited view of the global system, i.e. its ego neighborhood, using a label propagation algorithm; finally, the local communities are merged into a global collection. \n\nMoreover, we provide also an evolution of Angel, namely **ArchAngel**, designed to extract community from evolving network topologies.\n\n**Note:** Angel has been integrated within [CDlib](http://cdlib.readthedocs.io) a python package dedicated to community detection algorithms, check it out!\n\n\n## Installation\nYou can easily install the updated version of Angel (and Archangel) by using pip:\n\n```bash\npip install angel_community\n```\n\nor using conda\n\n```bash\nconda install -c giuliorossetti angel_community\n```\n\n## Implementation details\n\n*Required input format(s)* \n\nAngel:\n.ncol edgelist (nodes represented with integer ids).\n\n```\nnode_id0 node_id1\n```\n\nArchAngel:\nExtended .ncol edgelist (nodes represented with integer ids).\n\n```\nnode_id0 node_id1\tsnapshot_id\n```\n\n# Execution\nAngel is written in python and requires the following package to run:\n- python 3.x\n- python-igraph\n- networkx\n- tqdm\n\n## Angel\n\n```python\nimport angel as a\nan = a.Angel(filename, threshold=0.4, min_comsize=3, outfile_name=\"angel_communities.txt\")\nan.execute()\n```\n\nWhere:\n* filename: edgelist filename\n* threshold: merging threshold in [0,1]\n* min_com_size: minimum size for communities\n* out_filename: desired filename for the output \n\nor alternatively\n\n```python\nimport angel as a\nan = a.Angel(graph=g, threshold=0.4, min_com_size=3, out_filename=\"communities.txt\")\nan.execute()\n```\n\nWhere:\n* g: an igraph.Graph object\n\n## ArchAngel\n\n```python\nimport angel as a\naa = a.ArchAngel(filename, threshold=0.4, match_threshold=0.4, min_com_size=3, outfile_path=\"./\")\naa.execute()\n```\n\nWhere:\n* filename: edgelist filename\n* threshold: merging threshold in [0,1]\n* match_threshold: cross-time community matching threshold in [0, 1]\n* min_com_size: minimum size for communities\n* outfile_path: path for algorithm output files \n",
"bugtrack_url": null,
"license": "BSD-2-Clause",
"summary": "Community Discovery algorithm",
"version": "2.0.0",
"project_urls": {
"Homepage": "https://github.com/GiulioRossetti/ANGEL"
},
"split_keywords": [
"complex-networks",
"community discovery"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8678af726ca507c849f6361475444faf7a93a11d51c7ed2b47f58339b3a3f232",
"md5": "a730f763c89b97f2b703fcfcd04f2642",
"sha256": "eee96824c3a213fddf271a0fd0761fc37234efd1e88135ef363eb33ea9215c1b"
},
"downloads": -1,
"filename": "angelcommunity-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a730f763c89b97f2b703fcfcd04f2642",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10100,
"upload_time": "2023-06-07T15:19:04",
"upload_time_iso_8601": "2023-06-07T15:19:04.162861Z",
"url": "https://files.pythonhosted.org/packages/86/78/af726ca507c849f6361475444faf7a93a11d51c7ed2b47f58339b3a3f232/angelcommunity-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "56504c4ff6087b8d2a2a2a92e43533a6a4e758227c1a1e5093e6510de398cb4d",
"md5": "41928e5b0aaae21dc19295c8634ce304",
"sha256": "55960184fb5d2b9d16eaa9a96db8531ffcf1b355062f6f179ea670d46706a480"
},
"downloads": -1,
"filename": "angelcommunity-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "41928e5b0aaae21dc19295c8634ce304",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10337,
"upload_time": "2023-06-07T15:19:06",
"upload_time_iso_8601": "2023-06-07T15:19:06.125655Z",
"url": "https://files.pythonhosted.org/packages/56/50/4c4ff6087b8d2a2a2a92e43533a6a4e758227c1a1e5093e6510de398cb4d/angelcommunity-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-07 15:19:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GiulioRossetti",
"github_project": "ANGEL",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "angelcommunity"
}