apache-age-community-detection


Nameapache-age-community-detection JSON
Version 0.1.4 PyPI version JSON
download
home_pagehttps://github.com/Munmud/Community-Detection-Modularity
SummaryDetection of Community by maximizing modularity
upload_time2023-04-09 16:20:10
maintainer
docs_urlNone
authorMoontasir Mahmood
requires_python>=3.9
licenseApache2.0
keywords community-detection modularity reichardt and bornholdt newman partition network k means cluster
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Community-Detection-Modularity

Eigenvector-based community detection is a method used to identify communities or groups within a network by analyzing the eigenvectors of the network's adjacency matrix. The basic idea behind this approach is that nodes that belong to the same community will be more strongly connected to each other than to nodes in other communities.

The method starts by calculating the adjacency matrix of the network, which represents the connections between nodes. Next, the eigenvalues and eigenvectors of this matrix are calculated. The eigenvectors with the largest eigenvalues are then used to assign nodes to communities.

The basic idea is that nodes that belong to the same community will have similar eigenvector values for these dominant eigenvectors. By grouping nodes with similar eigenvector values together, communities can be identified.

The method starts by calculating the adjacency matrix of the network, which represents the connections between nodes. Next, the eigenvalues and eigenvectors of this matrix are calculated. The eigenvectors with the largest eigenvalues are then used to assign nodes to communities.

The basic idea is that nodes that belong to the same community will have similar eigenvector values for these dominant eigenvectors. By grouping nodes with similar eigenvector values together, communities can be identified.

## Installation

### Install via PIP
```cmd
pip install apache-age-community-detection
```

### Build from Source
```cmd
sudo apt-get update
sudo apt-get install libeigen3-dev
git clone https://github.com/Munmud/Community-Detection-Modularity
cd Community-Detection-Modularity
python setup.py install
```

### Unit Test
```cmd
python -m unittest test_community.py
```

## Instruction

### import
```py
from age_community_detection import Graph
```

### Create Graph
```py
nodes = [0, 1, 2, 3, 4, 5]
edges = [[0, 1], [0, 2], [1, 2], [2, 3], [3, 4], [3, 5], [4, 5]]
g = Graph.Graph()
g.createGraph(nodes, edges)
```
- Nodes : `0 to N-1`
- Edges : 
    - `2d array : adjacency list`
    - `Each element between 0 to N-1`

### Generate Community Assignment
```py
res = g.get_community()
```

### Output Format
```
[1, 1, 1, 0, 0, 0, 2, 2, 0, 3, 3, 1, 3]
```
- Here each number represents the community number of corresponding node

### Samples
- [Creating Graph](https://github.com/Munmud/Community-Detection-Modularity/blob/main/Samples/sample1.py)

### Reference
- [Finding community structure in networks using the eigenvectors of matrices](https://arxiv.org/pdf/physics/0605087.pdf)
- [Modularity and community structure in networks](https://www.pnas.org/doi/10.1073/pnas.0601602103)
- [Statistical Mechanics of Community Detection](https://ia903002.us.archive.org/33/items/arxiv-cond-mat0603718/cond-mat0603718.pdf)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Munmud/Community-Detection-Modularity",
    "name": "apache-age-community-detection",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "Community-Detection,Modularity,Reichardt and Bornholdt,Newman,partition network,k means cluster",
    "author": "Moontasir Mahmood",
    "author_email": "moontasir042@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/7b/b8/f087c780b7939072b36670a9587c865acfa085c86f3b228f4b4f4ffeda32/apache-age-community-detection-0.1.4.tar.gz",
    "platform": null,
    "description": "# Community-Detection-Modularity\n\nEigenvector-based community detection is a method used to identify communities or groups within a network by analyzing the eigenvectors of the network's adjacency matrix. The basic idea behind this approach is that nodes that belong to the same community will be more strongly connected to each other than to nodes in other communities.\n\nThe method starts by calculating the adjacency matrix of the network, which represents the connections between nodes. Next, the eigenvalues and eigenvectors of this matrix are calculated. The eigenvectors with the largest eigenvalues are then used to assign nodes to communities.\n\nThe basic idea is that nodes that belong to the same community will have similar eigenvector values for these dominant eigenvectors. By grouping nodes with similar eigenvector values together, communities can be identified.\n\nThe method starts by calculating the adjacency matrix of the network, which represents the connections between nodes. Next, the eigenvalues and eigenvectors of this matrix are calculated. The eigenvectors with the largest eigenvalues are then used to assign nodes to communities.\n\nThe basic idea is that nodes that belong to the same community will have similar eigenvector values for these dominant eigenvectors. By grouping nodes with similar eigenvector values together, communities can be identified.\n\n## Installation\n\n### Install via PIP\n```cmd\npip install apache-age-community-detection\n```\n\n### Build from Source\n```cmd\nsudo apt-get update\nsudo apt-get install libeigen3-dev\ngit clone https://github.com/Munmud/Community-Detection-Modularity\ncd Community-Detection-Modularity\npython setup.py install\n```\n\n### Unit Test\n```cmd\npython -m unittest test_community.py\n```\n\n## Instruction\n\n### import\n```py\nfrom age_community_detection import Graph\n```\n\n### Create Graph\n```py\nnodes = [0, 1, 2, 3, 4, 5]\nedges = [[0, 1], [0, 2], [1, 2], [2, 3], [3, 4], [3, 5], [4, 5]]\ng = Graph.Graph()\ng.createGraph(nodes, edges)\n```\n- Nodes : `0 to N-1`\n- Edges : \n    - `2d array : adjacency list`\n    - `Each element between 0 to N-1`\n\n### Generate Community Assignment\n```py\nres = g.get_community()\n```\n\n### Output Format\n```\n[1, 1, 1, 0, 0, 0, 2, 2, 0, 3, 3, 1, 3]\n```\n- Here each number represents the community number of corresponding node\n\n### Samples\n- [Creating Graph](https://github.com/Munmud/Community-Detection-Modularity/blob/main/Samples/sample1.py)\n\n### Reference\n- [Finding community structure in networks using the eigenvectors of matrices](https://arxiv.org/pdf/physics/0605087.pdf)\n- [Modularity and community structure in networks](https://www.pnas.org/doi/10.1073/pnas.0601602103)\n- [Statistical Mechanics of Community Detection](https://ia903002.us.archive.org/33/items/arxiv-cond-mat0603718/cond-mat0603718.pdf)\n",
    "bugtrack_url": null,
    "license": "Apache2.0",
    "summary": "Detection of Community by maximizing modularity",
    "version": "0.1.4",
    "split_keywords": [
        "community-detection",
        "modularity",
        "reichardt and bornholdt",
        "newman",
        "partition network",
        "k means cluster"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "37e4ddd1a1c8f371130030339c6485b30ae70e22667cfba44861b5c1a655ceed",
                "md5": "105e4ffa2fd5659caeb2523c402e26b9",
                "sha256": "6cdf72a7ccd6fa5f7c3d5899c1a96e7475c1c1030671253f12498183b910000a"
            },
            "downloads": -1,
            "filename": "apache_age_community_detection-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "105e4ffa2fd5659caeb2523c402e26b9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 19279,
            "upload_time": "2023-04-09T16:20:09",
            "upload_time_iso_8601": "2023-04-09T16:20:09.279670Z",
            "url": "https://files.pythonhosted.org/packages/37/e4/ddd1a1c8f371130030339c6485b30ae70e22667cfba44861b5c1a655ceed/apache_age_community_detection-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7bb8f087c780b7939072b36670a9587c865acfa085c86f3b228f4b4f4ffeda32",
                "md5": "04aaac6a0d06c7d04469b7a552091fac",
                "sha256": "5449210f6dddad3d11990ba00694fc9739a05dad7a291a1b8c0c74815ae83fc3"
            },
            "downloads": -1,
            "filename": "apache-age-community-detection-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "04aaac6a0d06c7d04469b7a552091fac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 14399,
            "upload_time": "2023-04-09T16:20:10",
            "upload_time_iso_8601": "2023-04-09T16:20:10.867150Z",
            "url": "https://files.pythonhosted.org/packages/7b/b8/f087c780b7939072b36670a9587c865acfa085c86f3b228f4b4f4ffeda32/apache-age-community-detection-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-09 16:20:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Munmud",
    "github_project": "Community-Detection-Modularity",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "apache-age-community-detection"
}
        
Elapsed time: 0.05146s