nds


Namends JSON
Version 0.4.2 PyPI version JSON
download
home_pagehttps://github.com/KernelA/nds-py
SummaryNon-dominated sorting algorithm.
upload_time2023-01-09 05:38:01
maintainer
docs_urlNone
authorAlexander Kryuchkov
requires_python>=3.6
licenseMIT
keywords nds multiobjective-optimization non-dominated-sorting
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Non-dominated sorting

![Test nds library](https://github.com/KernelA/nds-py/workflows/Test%20nds%20library/badge.svg?branch=master)

## Description of the method

You can read about the method in the next article:

Buzdalov M., Shalyto A. A Provably Asymptotically Fast Version of the Generalized Jensen Algorithm for Non-dominated Sorting  // Parallel Problem Solving from Nature XIII.- 2015. - P. 528-537. - (Lecture Notes on Computer Science; 8672)

## Requirements

1. Python 3.6 or higher.
2. Installed [setuptools](https://pypi.org/project/setuptools/).
3. Installed [wheel](https://pythonwheels.com/).

## Installation

### PyPI

[![PyPi version](https://badge.fury.io/py/nds.svg)](https://badge.fury.io/py/nds)

### Local installation 

Run `pip install .`.

## Tests

Run command:
```
python -m unittest discover -v ./tests
```

## How to use

The example:

```python
import random

# Package must be installed.
from nds import ndomsort

seq = [random.sample(range(-10, 11), 5) for i in range(30)]

# It is dictionary.
fronts = ndomsort.non_domin_sort(seq)

# Or we can get values of objectives.
# fronts = ndomsort.non_domin_sort(seq, lambda x: x[:4])

# 'fronts' is a tuple of front's indices, not a dictionary.
# fronts = ndomsort.non_domin_sort(seq, only_front_indices=True)

for front in fronts:
    print("\nFront index is {}".format(front))
    for seq in fronts[front]:
        print("\t{}".format(seq))

```

## Other implementations

* [Java (Jensen-Fortin-Buzdalov divide-and-conquer method)](https://github.com/mbuzdalov/non-dominated-sorting)
* [C#](https://github.com/KernelA/nds)

## Example

![Pareto front figure](docs/fronts.svg)




            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/KernelA/nds-py",
    "name": "nds",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "nds,multiobjective-optimization,non-dominated-sorting",
    "author": "Alexander Kryuchkov",
    "author_email": "KernelA@users.noreply.github.com",
    "download_url": "",
    "platform": null,
    "description": "# Non-dominated sorting\n\n![Test nds library](https://github.com/KernelA/nds-py/workflows/Test%20nds%20library/badge.svg?branch=master)\n\n## Description of the method\n\nYou can read about the method in the next article:\n\nBuzdalov M., Shalyto A. A Provably Asymptotically Fast Version of the Generalized Jensen Algorithm for Non-dominated Sorting  // Parallel Problem Solving from Nature XIII.- 2015. - P. 528-537. - (Lecture Notes on Computer Science; 8672)\n\n## Requirements\n\n1. Python 3.6 or higher.\n2. Installed [setuptools](https://pypi.org/project/setuptools/).\n3. Installed [wheel](https://pythonwheels.com/).\n\n## Installation\n\n### PyPI\n\n[![PyPi version](https://badge.fury.io/py/nds.svg)](https://badge.fury.io/py/nds)\n\n### Local installation \n\nRun `pip install .`.\n\n## Tests\n\nRun command:\n```\npython -m unittest discover -v ./tests\n```\n\n## How to use\n\nThe example:\n\n```python\nimport random\n\n# Package must be installed.\nfrom nds import ndomsort\n\nseq = [random.sample(range(-10, 11), 5) for i in range(30)]\n\n# It is dictionary.\nfronts = ndomsort.non_domin_sort(seq)\n\n# Or we can get values of objectives.\n# fronts = ndomsort.non_domin_sort(seq, lambda x: x[:4])\n\n# 'fronts' is a tuple of front's indices, not a dictionary.\n# fronts = ndomsort.non_domin_sort(seq, only_front_indices=True)\n\nfor front in fronts:\n    print(\"\\nFront index is {}\".format(front))\n    for seq in fronts[front]:\n        print(\"\\t{}\".format(seq))\n\n```\n\n## Other implementations\n\n* [Java (Jensen-Fortin-Buzdalov divide-and-conquer method)](https://github.com/mbuzdalov/non-dominated-sorting)\n* [C#](https://github.com/KernelA/nds)\n\n## Example\n\n![Pareto front figure](docs/fronts.svg)\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Non-dominated sorting algorithm.",
    "version": "0.4.2",
    "split_keywords": [
        "nds",
        "multiobjective-optimization",
        "non-dominated-sorting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "91367e50c9cc3224c5a7c553ead2ed04603f03fc1b72b45e32f11ec890003638",
                "md5": "7a875ffbbf350e9589a21c5b53c4f258",
                "sha256": "d14b0a47f4666fcff1bfdc1a0d5bdb53d55c445a7ec30b5fe69f7c024e8045a6"
            },
            "downloads": -1,
            "filename": "nds-0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7a875ffbbf350e9589a21c5b53c4f258",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7309,
            "upload_time": "2023-01-09T05:38:01",
            "upload_time_iso_8601": "2023-01-09T05:38:01.934217Z",
            "url": "https://files.pythonhosted.org/packages/91/36/7e50c9cc3224c5a7c553ead2ed04603f03fc1b72b45e32f11ec890003638/nds-0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-09 05:38:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "KernelA",
    "github_project": "nds-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "nds"
}
        
Elapsed time: 0.03283s