Skip to main content

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 apache-age-community-detection

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_community_detection 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 : 0 to N-1
  • Edges :
    • 2d array : adjacency list
    • Each element between 0 to N-1

Generate Community Assignment

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

Reference

Metadata

Release files for apache-age-community-detection 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apache-age-community-detection 0.1.4
File Size Uploaded Provenance Actions
apache-age-community-detection-0.1.4.tar.gz 14.4 kB Without provenance Details for apache-age-community-detection-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apache-age-community-detection 0.1.4
File Interpreter ABI Platform Actions
apache_age_community_detection-0.1.4-py3-none-any.whl Python 3 none any Details for apache_age_community_detection-0.1.4-py3-none-any.whl

Total release size: 33.7 kB

Release files / apache-age-community-detection-0.1.4.tar.gz

Download URL apache-age-community-detection-0.1.4.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5449210f6dddad3d11990ba00694fc9739a05dad7a291a1b8c0c74815ae83fc3
BLAKE2b-256 checksum
How to use checksums
7bb8f087c780b7939072b36670a9587c865acfa085c86f3b228f4b4f4ffeda32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / apache_age_community_detection-0.1.4-py3-none-any.whl

Download URL apache_age_community_detection-0.1.4-py3-none-any.whl
Size 19.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cdf72a7ccd6fa5f7c3d5899c1a96e7475c1c1030671253f12498183b910000a
BLAKE2b-256 checksum
How to use checksums
37e4ddd1a1c8f371130030339c6485b30ae70e22667cfba44861b5c1a655ceed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for apache-age-community-detection 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page