mincluster
mincluster is a package that allows to minimize the maximum intercluster distance
Overview
The problem of clustering a set of points so as to minimize the maximum intercluster distance is studied. An O(kn) approximation algorithm, where n is the number of points and k is the number of clusters, that guarantees solutions with an objective function value within two times the optimal solution value is presented. This approximation algorithm succeeds as long as the set of points satisfies the triangular inequality. We also show that our approximation algorithm is best possible, with respect to the approximation bound, if P ≠ NP.
Installation
pip install mincluster
Usage
from mincluster.cluster import ClusterMinimization
k = 3
data = [231, 22, 73, 54, 60, 29, 10, 192, 115]
c = ClusterMinimization(k, data)
clusters, cluster_heads = c.expand_clusters(c.clusters, c.cluster_heads)
try:
for i in range(k):
print(f'Cluster {i + 1}: Head = {cluster_heads[i]}, Elements = {clusters[i]}')
except IndexError as e:
print(e)
Output
Cluster 1: Head = 60, Elements = {192, 231, 73, 10, 115, 54, 22, 29}
Cluster 2: Head = 231, Elements = {192, 231, 73, 10, 115, 54, 22, 60, 29}
Cluster 3: Head = 115, Elements = {192, 231, 73, 10, 115, 54, 22, 60, 29}
License
This project is licensed under the MIT License - see the LICENSE file for details
References
Gonzalez, Teofilo F. “Clustering to Minimize the Maximum Intercluster Distance.” Theoretical Computer Science, vol. 38, Elsevier BV, Jan. 1985, pp. 293–306, https://doi.org/10.1016/0304-3975(85)90224-5. Accessed 26 Oct. 2023.
Metadata
Release files for mincluster 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mincluster-0.0.1.tar.gz | 3.9 kB | Without provenance | Details for mincluster-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mincluster-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for mincluster-0.0.1-py3-none-any.whl |
Total release size: 8.2 kB
Release files / mincluster-0.0.1.tar.gz
| Download URL | mincluster-0.0.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7090f842b83a7db1b57aa96f866e169ebe5edacb5fa7791cecf1c835490f7f1
|
|
BLAKE2b-256 checksum How to use checksums |
b26e8bd8477a51993768a6875e9e1d6328352dbfd97382637a8d8c60e1f38044
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / mincluster-0.0.1-py3-none-any.whl
| Download URL | mincluster-0.0.1-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
69f6be4e0e1e8cc6afbcf84a1e08d1cfbe0b4dd5ccde7f91cdc172c937f47e3b
|
|
BLAKE2b-256 checksum How to use checksums |
b5cd0d5d51ea2e2c0dad46f19139300d69fd8e7ce4104d164836b778fa501d0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for mincluster 0.0.1
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.