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.5.tar.gz (26.4 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.5-cp312-cp312-win_amd64.whl (102.0 kB view details)

Uploaded CPython 3.12Windows x86-64

vc_flas-0.1.5-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.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (124.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

vc_flas-0.1.5-cp312-cp312-macosx_11_0_x86_64.whl (99.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

vc_flas-0.1.5-cp312-cp312-macosx_11_0_arm64.whl (90.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

vc_flas-0.1.5-cp311-cp311-win_amd64.whl (101.9 kB view details)

Uploaded CPython 3.11Windows x86-64

vc_flas-0.1.5-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.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (126.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

vc_flas-0.1.5-cp311-cp311-macosx_11_0_x86_64.whl (100.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

vc_flas-0.1.5-cp311-cp311-macosx_11_0_arm64.whl (91.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: vc_flas-0.1.5.tar.gz
  • Upload date:
  • Size: 26.4 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.5.tar.gz
Algorithm Hash digest
SHA256 4704446d634d12a70ba9686baaa5e1b8d36eb02f477f919036bf9d5adbb0b44e
MD5 3d48ab9b4367b6f8a837d87593f332a7
BLAKE2b-256 bb4a2284c40f9e462e0aa9f6d4e8ff3ce47ae01c0109f0950cb7bb99fae77e07

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5.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.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: vc_flas-0.1.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 102.0 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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6d8be9e99970bfdb09458815f388cced13cfd81c1221928acc552c8f28fe82df
MD5 0eeb2b2502fb6752cf0f0dd2820d53aa
BLAKE2b-256 8e24ab77912ac405b9eef5c1df10a17cedeb3e208da9bdc359262663141e9e51

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 767bd9686c1c68dadbf9dcdfb6e5410638d7e9b1a1b4536562c1d6b8eeba5465
MD5 ba2862318e429db2d17c9e8a636a17fd
BLAKE2b-256 9dbc40797bbef5dd444cbff0816a8f04b5355c55952f23aa1a58657e179a6e99

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38e4e241d3397b0ae94b9d3beeb6f88ae62d96dcb553bd0365c857edcd7f5bc1
MD5 9006aabf595f1e1d0a82620c83472287
BLAKE2b-256 7b007c412480159cc9c7b990603a6cb071df8bba0f63ccbb128ec53852c5421b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 638f466ef9c74de07e1720ba78144fd8179cfdc6e5bf04cd83e2603e23142cb9
MD5 db3f2e3dcef7339591fbb99464ea1c31
BLAKE2b-256 b88c833d3ad063016843f529942d1985a8420f170976771b1f0ec5c666d40a44

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f756fabde4dff206ab0f8084b61d9d4d03a223dcea30a6499fe07b719f989cbf
MD5 98aa5d8bb470532412816ca8dac202fb
BLAKE2b-256 c5332b03202c73fb458ffc01c72107fda922c5965db215959e283ab959e46ec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: vc_flas-0.1.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 101.9 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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7002eb6eff1d7cb78d57178869c50a10cb07b59988b4fdec447dd6fe6a61d3df
MD5 f25ec717130a4414aa67427c6bb9f945
BLAKE2b-256 485832de7926e4616916adca2444c11088a49fee2820970f979922940cd4d5be

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 166e769673dccd3612a814ff7e8e43a275a9dfa4d58c9b3a497dd061cd60d5b2
MD5 685585234d570133d0c94e59b0f280f6
BLAKE2b-256 9b1f35b93a726361d8c0f3ebcbf841954683719f7b50908e647a1087b85402bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e6a9b03334172de8fc1211c386570fdf144e687666a28efa9fd3a29f4b06a58
MD5 5fbcf6a2abbfa89589bc272d33e5abce
BLAKE2b-256 180e3428a4ff367847f20a7178af3f7ff8fcaf874ff2b3a1934b90047aba1bc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 aae60a5369b6c19fa67e08b066f1e9833ca8937ea346750c87b0cdf4450a28e7
MD5 a3f8befdc80121d1f4c65aa583a24900
BLAKE2b-256 ad2328a647b581f853f48b6d54dbe0ce341add49a0e40e3b4bd8b1b9e2d511f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vc_flas-0.1.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9c72e31769687057891d3533fc391ee4d85debd6b6fc6fe4c5aacf04f5882e74
MD5 640524188a6995824d93a524857d61cd
BLAKE2b-256 0c5deca5c40dbb2dac39a596a518bafe7e2e973c8c20b1f29260e62f7c28fff0

See more details on using hashes here.

Provenance

The following attestation bundles were made for vc_flas-0.1.5-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