dominosort
Sort sequences with respect to the similarity of consecutive items.
Definition
Given a sequence of items \((x_i, y_i)\), where each item is represented by two values \(x, y\), the goal is to sort the sequence such that the following loss is minimal:
where \(\mu\) denotes a suitable metric for the items’ values.
Example
Given the items
>>> items = [
... (0.4, 0.6),
... (0.0, 0.2),
... (0.8, 1.0),
... (0.6, 0.8),
... (0.2, 0.4),
... ]
together with the L1 distance \(\mu: (x, y) \rightarrow |x-y|\), the current loss is
>>> abs(0.6 - 0.0) + abs(0.2 - 0.8) + abs(1.0 - 0.6) + abs(0.8 - 0.2)
2.2
Clearly the optimal sort order which minimizes the loss is
>>> optimal = [ ... (0.0, 0.2), ... (0.2, 0.4), ... (0.4, 1.6), ... (0.6, 0.8), ... (0.8, 1.0), ... ]
Metadata
Release files for dominosort 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dominosort-0.1-py3-none-any.whl | Python 3 | none | any | Details for dominosort-0.1-py3-none-any.whl |
Release files / dominosort-0.1-py3-none-any.whl
| Download URL | dominosort-0.1-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
900a921343243985d42d51ff9655442f07ec3757451ce06314806889e354e1c4
|
|
BLAKE2b-256 checksum How to use checksums |
1779fcc54d8b1f9d05a7e7b6792d075a801eb36c553a31caf572b0aadea2bfff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for dominosort 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.