allocator

Efficiently collect data from geographically distributed locations

https://github.com/geosensing/allocator

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary

Keywords

distributed-data-collection traveling-salesman

Keywords from Contributors

electoral-rolls gender-classification india names
Last synced: 8 months ago · JSON representation ·

Repository

Efficiently collect data from geographically distributed locations

Basic Info
Statistics
  • Stars: 6
  • Watchers: 2
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
distributed-data-collection traveling-salesman
Created almost 9 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.rst

allocator: Optimally Allocate Geographically Distributed Tasks
==============================================================

.. image:: https://img.shields.io/pypi/v/allocator.svg
    :target: https://pypi.python.org/pypi/allocator
.. image:: https://pepy.tech/badge/allocator
    :target: https://pepy.tech/project/allocator

How can we efficiently collect data from geographically distributed locations? If the data 
collection is being crowd-sourced, then we may want to exploit the fact that workers
are geographically distributed. One simple heuristic to do so is to order the locations by 
distance for each worker (with some task registration backend). If you have hired 
workers (or rented drones) who you can send to different locations, then you must split the tasks 
across workers (drones), and plan the 'shortest' routes for each, ala the Traveling Salesman 
Problem (TSP). This is a problem that companies like Fedex etc. solve all the time. Since there 
are no computationally feasible solutions for solving for the global minimum, one heuristic solution 
is to split the locations into clusters of points that are close to each other (ideally, 
we want the clusters to be 'balanced'), and then to estimate a TSP solution for each cluster. 

The package provides a simple way to implement these solutions. Broadly, it provides three kinds of functions:

1. **Sort by Distance:** Produces an ordered list of workers for each point or an ordered list of points 
    for each worker.

2. **Cluster the Points:** Clusters the points into *n_worker* groups.

3. **Shortest Path:** Order points within a cluster (or any small number of points) into a path or itinerary. 

The package also provides access to three different kinds of distance functions for calculating the distance matrices
that underlie these functions: 

1. **Euclidean Distance:** use option ``-d euclidean``; similar to the Haversine distance within the same `UTM zone `__)

2. **Haversine Distance:** use option ``-d haversine``. 

3. **OSRM Distance:** use option ``-d osrm``. Neither Haversine nor Euclidean distance take account of the actual road network or the traffic. To use actual travel time, use `Open Source Routing Machine API `__ A maximum number of 100 points can be passed to the function if we use the public server. However, you can set up your own private OSRM server with ``--max-table-size`` to specific the maximum number of points.

4. **Google Distance Matrix API:**. use option ``-d google``. This option available in ``sort_by_distane`` and ``cluster_kahip`` only due to Google Distance Matrix API has very usage limits. Please look at the limitations `here. `__

Downloads
----------
As of February 3rd, 2018, the package had been downloaded nearly 1,700 times (see the `saved BigQuery `__).

Related Package
^^^^^^^^^^^^^^^
To sample locations randomly on the streets, check out `geo_sampling `__.

Application
^^^^^^^^^^^^^^^
Missing Women on the streets of Delhi. See `women count `__

Install
-------

::

    pip install allocator

Functions
---------

1. `Sort By Distance `__
    
2. **Cluster**
    
    Cluster data collection locations using k-means (clustering) or KaHIP (graph partitioning). To check which of the algorithms produces more cohesive, balanced clusters,
    run `Compare K-means to KaHIP `__
    
    a. `k-means `__

        **Examples:**

        ::

            python -m allocator.cluster_kmeans -n 10 allocator/examples/chonburi-roads-1k.csv --plot


    b. `KaHIP allocator `__


3. **Shortest Path**

    These function can be used find the estimated shortest path across all the locations in a cluster. We expose three different ways of getting the 'shortest' path, a) via MST (Christofides algorithm), b) via Google OR-Tools, b) Google Maps Directions API.

    a. `Approximate TSP using MST `__

    b. `Google OR Tools TSP solver Shortest path `__

    c. `Google Maps Directions API Shortest path `__ 

    d. `OSRM Trip API Shortest path `__ 


Documentation
-------------

Documentation available at: https://allocator.readthedocs.io/en/latest/

Authors
-------

Suriyan Laohaprapanon and Gaurav Sood

Contributor Code of Conduct
---------------------------

The project welcomes contributions from everyone! In fact, it depends on
it. To maintain this welcoming atmosphere, and to collaborate in a fun
and productive way, we expect contributors to the project to abide by
the `Contributor Code of
Conduct `__.

License
-------

The package is released under the `MIT
License `__.

Owner

  • Name: Geosensing
  • Login: geosensing
  • Kind: organization

Making it easier to collect and analyze geographically distributed data

Citation (Citation.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Sood"
  given-names: "Gaurav"
- family-names: "Laohaprapanon"
  given-names: "Suriyan"
title: "allocator: Optimally Allocate Geographically Distributed Tasks"
version: 0.1.0
date-released: 2017-07-15
url: "https://github.com/geosensing/allocator/"

GitHub Events

Total
  • Push event: 4
Last Year
  • Push event: 4

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 33
  • Total Committers: 3
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.273
Past Year
  • Commits: 4
  • Committers: 1
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Gaurav Sood g****7@g****m 24
Suriyan s****t@g****m 8
Snyk bot g****t@s****o 1
Committer Domains (Top 20 + Academic)
snyk.io: 1

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • soodoku (1)
  • snyk-bot (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • folium *
  • googlemaps *
  • haversine *
  • matplotlib ==1.5.1
  • networkx *
  • pandas *
  • pip >=9.0.0
  • polyline *
  • scipy *
  • sklearn *
  • sphinx *
  • sphinx_rtd_theme *
  • utm ==0.4.0
  • wheel *
setup.py pypi
  • folium *
  • googlemaps *
  • haversine *
  • matplotlib >=1.5.1
  • networkx *
  • numpy >=1.12.1
  • pandas >=0.19.2
  • polyline *
  • scipy *
  • utm >=0.4.0
.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
.github/workflows/python-app.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite