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
pip install age-cda
Build from Source
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
python -m unittest test_community.py
Instruction
import
from age_cda import Graph
Create Graph
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 :
any - Edges :
2d array : adjacency list- `Each element within Nodes array
Generate Community Assignment
res = g.get_community()
Output Format
[[3,4,5],[0,1,2]]
- List community
- Each community has list of nodes
Samples
Reference
Metadata
Release files for age-cda 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| age_cda-0.0.4.tar.gz | 2.3 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| age_cda-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.6 MB
Release files / age_cda-0.0.4.tar.gz
| Download URL | age_cda-0.0.4.tar.gz |
|---|---|
| Size | 2.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dcf21a133cec697b6cd9c48cbafe61f7e7552d8efc85e443d6ec73b60e54f4f1
|
|
BLAKE2b-256 checksum How to use checksums |
dfb664039580f630f5233932d1b7fde297705a983050fc5d8d6a3e2e009fd721
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / age_cda-0.0.4-py3-none-any.whl
| Download URL | age_cda-0.0.4-py3-none-any.whl |
|---|---|
| Size | 2.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18524addfd66d3a5a6a4c2c81e8a97399afacf08c5d9f862d5fc2867ea6217fe
|
|
BLAKE2b-256 checksum How to use checksums |
0934013014dc9ef2132830e0bb56e04cd8cc66270e51d5ca8ffac856954e25c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|