Skip to main content

Python implementation of the Fast Linear Assigment Sorting Algorithm

Project description

Fast Linear Assignment Sorting - FLAS

main_pic

FLAS allows to sort 2d grids based on similarity. This directory contains the python implementation and shows how to use it.

Features

  • Implementation of FLAS and DPQ (and other metrics to quantify an arrangement)
  • Allows frozen fields
  • Allows empty fields (holes)
  • Deterministic random when seeded
  • Installable via PyPI
  • Easy to use python interface with numpy support
  • Fast implementation in C++

Installation

pip install vc_flas

Install from sources

git clone https://github.com/Visual-Computing/LAS_FLAS.git
cd LAS_FLAS/c_python
pip install .  # or
pip install -e .  # for develop/editable mode

Usage

Basic Usage

Given that you have N features with D-dimensions, you can sort these features based on similarity with the following code:

import numpy as np
from vc_flas import Grid, flas

N, D = 241, 3
features = np.random.random((N, D))
grid = Grid.from_features(features)

arrangement = flas(grid, wrap=True, radius_decay=0.99)

sorted_features = arrangement.get_sorted_features()
height, width, dim = sorted_features.shape
assert (height, width, dim) == (16, 16, 3)

# show_image(sorted_features)

Working with Arrangements and Labels

Often you need not only the features sorted, but other objects (like images for example) as well. See this example for more information on that.

Creating Grids

There are more ways to initialize grids. See here for some examples.

Metrics

Once you have sorted your features, there are some methods to evaluate the quality of the arrangements.

arrangement = flas(grid)

print(arrangement.get_distance_preservation_quality())
print(arrangement.get_mean_neighbor_distance())
print(arrangement.get_distance_ratio_to_optimum())

About

Kai Barthel, Nico Hezel, Klaus Jung, Bruno Schilling and Konstantin Schall

HTW Berlin, Visual Computing Group, Germany

Visual Computing Group

This is an example implementation of the algorithms from the paper

Improved Evaluation and Generation of Grid Layouts using Distance Preservation Quality and Linear Assignment Sorting

Published in COMPUTER GRAPHICS Forum: (https://onlinelibrary.wiley.com/doi/full/10.1111/cgf.14718)

Reference

Reference to cite when you use any of the presented algorithms in a research paper:

@article{https://doi.org/10.1111/cgf.14718,
    author = {Barthel, K. U. and Hezel, N. and Jung, K. and Schall, K.},
    title = {Improved Evaluation and Generation Of Grid Layouts Using Distance Preservation Quality and Linear Assignment Sorting},
    journal = {Computer Graphics Forum},
    volume = {42},
    number = {1},
    pages = {261-276},
    keywords = {interaction, user studies, visualization, information visualization, high dimensional sorting, assistive interfaces},
    doi = {https://doi.org/10.1111/cgf.14718},
    url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/cgf.14718},
    year = {2023}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vc_flas-0.1.4.tar.gz (26.2 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vc_flas-0.1.4-cp312-cp312-win_amd64.whl (101.8 kB view details)

Uploaded CPython 3.12Windows x86-64

vc_flas-0.1.4-cp312-cp312-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

vc_flas-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

vc_flas-0.1.4-cp312-cp312-macosx_11_0_x86_64.whl (99.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

vc_flas-0.1.4-cp312-cp312-macosx_11_0_arm64.whl (90.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

vc_flas-0.1.4-cp311-cp311-win_amd64.whl (101.7 kB view details)

Uploaded CPython 3.11Windows x86-64

vc_flas-0.1.4-cp311-cp311-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

vc_flas-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (125.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

vc_flas-0.1.4-cp311-cp311-macosx_11_0_x86_64.whl (100.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

vc_flas-0.1.4-cp311-cp311-macosx_11_0_arm64.whl (90.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file vc_flas-0.1.4.tar.gz.

File metadata

  • Download URL: vc_flas-0.1.4.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for vc_flas-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c0f97f356a894c13e80b2a174f34ba4de255a6af17d52a66507f0e639301766b
MD5 f74b728385844064eb99b62d7600f91a
BLAKE2b-256 83e743e5140179be84f34ee61520f52cba8add43c96c3940a7c2cc2e2a9648ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4.tar.gz:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vc_flas-0.1.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 101.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for vc_flas-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a7060d22de758727abe8c29da84b706581f8ce972c714a54d2cb209fa6f34857
MD5 592081740fb8bf26db1d3e401559e85e
BLAKE2b-256 d94c57f64d76cc85959b1acf2d66a26e5bb5a1b06bd7de6715e9be17d92925c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp312-cp312-win_amd64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0a26f1b81a5d02d56f5df808ab0b6891a63817a82c243e114673405458a013c8
MD5 c88f844abdb3b059292d208c1c87829a
BLAKE2b-256 b297978079dbf4b6f0b1deafcc7f2d1452bc057b8978eac0f160055e43c8d31a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 be303bb25653a95cfde5d2d69ff331a4dd27bbf25e3563e63c388438fa104004
MD5 b013ea900f6838aab2d9df2237b98a66
BLAKE2b-256 35f894785d9f48a38d12ec0291f3696f5c75ba5003037a9f502edcf79fdb954e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cf47604c244ccae1b1a736dbfd0541a07d9f9e94f42ae11aa5913b821fea2c3c
MD5 66dbee5a697b09f00ff1ae3d8be5630f
BLAKE2b-256 08f046b123d81cfb84057404673070b61f2473b0c979645b5377bd05ae5e165c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp312-cp312-macosx_11_0_x86_64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e305370faebeeed45258fc8e55d95db6489a00aef02827857d8c1e784f76b335
MD5 a14c06e4f13836bd9f6da6de67ec52d8
BLAKE2b-256 28645cb9b6a9e74f306547079f26dd19da72ea2db83f15365e2cb97bbc649ebf

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: vc_flas-0.1.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 101.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for vc_flas-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 811dece6f5dec97b6df7da8bb8c2f5a9318b3e4b7934fd654c4ad40550a736de
MD5 5c89d20d73a2ed385838c442dbbea245
BLAKE2b-256 3cd1ab52c927a4079dac6ef6023d29e5142e1c7a547ea39eaf65c5c482e6cffc

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp311-cp311-win_amd64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8726c39fdb867beb9e450c0b8c7b2a135b647ffcbe1e862dc31cd71fa9336a76
MD5 f1433bb44b84817a4ed1e83329e4d7e0
BLAKE2b-256 5d284dd24a0575ae8ea2920da8680bd8379992bf047bf61278859b297b328076

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 68b03861df1ae3257f7f68a093c0b6bb18465f15db6aa9fc011624154c94d651
MD5 446a12529e349e0a9020ed148dc3b69d
BLAKE2b-256 6987aabf0685ffaf915bffc97decb515e7052016b43461a2d473241e366bf33c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3d92cbbffa5ed7df8addd52e0974a8118f8e3ab2c9a82b4f6357f527c77aec98
MD5 85c0c2eab283157010ee345dfd1161c2
BLAKE2b-256 5deb7bdb603b69c7ab94f531de4200cb82c551fc682017310a52dfcaeb92e8be

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp311-cp311-macosx_11_0_x86_64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vc_flas-0.1.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 df2086ec0a1d4b879d5f37f436022f594220d4aa25bb3a7f91b773d7e3ea747c
MD5 02b1e1ac445aa075f34c874cc7476add
BLAKE2b-256 74f9e28e2bc3fe16708536baaba13c1c4d742d34c88189fa5132a0423c34b93e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.4-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: BuildAndPublish.yml on Visual-Computing/LAS_FLAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page