route-optimization-constrained 0.1.3
Python library for Route Optimization Constrained
License: MIT

## Route Optimization Constrained
[![Build Status](https://travis-ci.org/jingw2/size_constrained_clustering.svg?branch=master)](https://travis-ci.org/jingw2/size_constrained_clustering)
[![PyPI version](https://badge.fury.io/py/size-constrained-clustering.svg)](https://badge.fury.io/py/size-constrained-clustering)
![GitHub](https://img.shields.io/github/license/jingw2/size_constrained_clustering)
[![codecov](https://codecov.io/gh/jingw2/size_constrained_clustering/branch/master/graph/badge.svg)](https://codecov.io/gh/jingw2/size_constrained_clustering)
![PyPI - Downloads](https://img.shields.io/pypi/dm/size-constrained-clustering)
![Codecov](https://img.shields.io/codecov/c/github/jingw2/size_constrained_clustering)


Implementation of Clustering with Constrained Algorithm. 
Route Optimization Constrained can be treated as an optimization problem. 

### Installation
Requirement Python >= 3.6, Numpy >= 1.13
* install from PyPI
```shell
pip install route-optimization-constrained
```

### Methods
* Constrained Clustering Algorithm: Route Optimization Constrained algorithms


### Usage:
```python
# setup
from route-optimization-constrained import RouteOptimizationConstraint
```

```python
if __name__ == "__main__":
    X = []
    n_points = 1000
    random_state = 42
    random.seed(random_state)
    np.random.seed(random_state)
    X = np.random.rand(n_points, 2)
    demands = np.ones((n_points, 1))
    n_clusters = 4
    n_iters = 100
    max_size = [n_points / n_clusters] * n_clusters
    max_size = [0.25, 0.5, 0.1, 0.15]

    roc = RouteOptimizationConstraint(n_clusters, max_size, n_iters)
    roc.fit(X, demands)
    labels = roc.labels_
    centers = roc.cluster_centers_
```

## Copyright
Copyright (c) 2021 Tri Basuki Kurniawan. Released under the MIT License. 

Third-party copyright in this distribution is noted where applicable.

### Reference
* [Shrinkage Clustering](https://www.researchgate.net/publication/322668506_Shrinkage_Clustering_A_fast_and_size-constrained_clustering_algorithm_for_biomedical_applications)
* [Deterministic Annealing, Clustering and Optimization](https://thesis.library.caltech.edu/2858/1/Rose_k_1991.pdf)
* [Clustering with size constraints](https://www.researchgate.net/publication/268292668_Clustering_with_Size_Constraints)
* [Data Clustering with Cluster Size Constraints Using a Modified k-means Algorithm](https://core.ac.uk/download/pdf/61217069.pdf)
* [KMeans Constrained Clustering Inspired by Minimum Cost Flow Problem](https://github.com/joshlk/k-means-constrained)
* [Clustering with Capacity and Size Constraints: A Deterministic
Approach](http://web.eecs.umich.edu/~mayankb/docs/ClusterCap.pdf)
* [Same Size Kmeans Heuristics Methods](https://elki-project.github.io/tutorial/same-size_k_means)
* [Cluster KMeans Constrained](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2000-65.pdf)
 * [Deterministic Annealing, Constrained Clustering, and Opthiieation](https://authors.library.caltech.edu/78353/1/00170767.pdf)
 * [Google's Operations Research tools's
SimpleMinCostFlow](https://developers.google.com/optimization/flow/mincostflow)