Community detection package using louvain's algorithm
Project description
Louvain-Enhanced
This package has some functions taken from python-louvain package
Louvain-Enhanced is a Python package for community detection in large networks using the Louvain method. This package provides enhanced functionalities and optimizations for efficient and accurate community detection.
Features
- Efficient implementation of the Louvain method for community detection.
- Support for weighted and unweighted graphs.
- Easy integration with NetworkX.
- Randomized node evaluation for different partitions at each call.
- Modular and extensible design.
Installation
You can install Louvain-Enhanced using pip:
pip install louvain-enhanced
Usage
Importing the Package
import networkx as nx
from louvain_enhanced import (
get_partition_at_level,
calculate_modularity,
find_best_partition,
create_dendrogram,
create_induced_graph,
load_binary_graph,
)
Creating a Graph
G = nx.karate_club_graph()
Finding the Best Partition
partition = find_best_partition(G)
print(partition)
Calculating Modularity
modularity = calculate_modularity(partition, G)
print(f"Modularity: {modularity}")
Creating a Dendrogram
dendrogram = create_dendrogram(G)
print(dendrogram)
Getting Partition at a Specific Level
level = 1
partition_at_level = get_partition_at_level(dendrogram, level)
print(partition_at_level)
Creating an Induced Graph
induced_graph = create_induced_graph(partition, G)
print(induced_graph)
Loading a Binary Graph
binary_graph = load_binary_graph("path_to_binary_file")
print(binary_graph)
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file louvain_enhanced-0.2.tar.gz.
File metadata
- Download URL: louvain_enhanced-0.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3407a0f47c0d4c68de7f9ca54bb71f1a92e8a856a242d623c78f3ea59e24e58
|
|
| MD5 |
1ef70b6ba65013409c835becd72cf170
|
|
| BLAKE2b-256 |
f9734b1d3b6458e1b8df64cafcdf2317db288a441c73ee088812e4fd2c56289c
|
File details
Details for the file louvain_enhanced-0.2-py3-none-any.whl.
File metadata
- Download URL: louvain_enhanced-0.2-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3722bee4fe9625d10c5014c9718e0ad395cc24953ab68e713f8df08b8c93723f
|
|
| MD5 |
9a9d923f8d3aac45ee82317bdf783446
|
|
| BLAKE2b-256 |
8a4bc38201995644d24dd79cab508260b0d05cc408198c6ff29d049e36e1eae0
|