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.3.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.3-cp312-cp312-win_amd64.whl (101.8 kB view details)

Uploaded CPython 3.12Windows x86-64

vc_flas-0.1.3-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.3-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.3-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.3-cp312-cp312-macosx_11_0_arm64.whl (90.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

vc_flas-0.1.3-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.3-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.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: vc_flas-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6ad904d027774aba8903c6f50639296eeeff251549a83a293ceb7e18f536931a
MD5 ccfd12f21d78f69ab8918ba655d3d28f
BLAKE2b-256 9bc69dd8bb5d8f1da9a663da1c6353259718eb434d878bf4ff505473ebf43618

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: vc_flas-0.1.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c62f6bf5e48fc76dda2670760ce6223d8e4b8a6ec5fd96e2c0358596c75e476e
MD5 e946f9a9a69dbfbfdf10b0db14093b25
BLAKE2b-256 e16579f9714c754d53e50f3977118363559b29b71203a8fa105cfb4469bcf64b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3031ece79623c94bc26ca7043fed19879c75d54ee8f22ddeabddd5133ccf743e
MD5 fbcd03a4c504e6af2f885e61011dd3df
BLAKE2b-256 6d8326c0a48aaa3112a46648f5ea05543f6e85b651600ae50d5998e70fa1f67e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f5f0b4f05275a33571537e204157314452064f23db5201582392a43f022121f3
MD5 541c86194051f506daa6d58e62256bb5
BLAKE2b-256 54c73ab6ed87b714b71bef07000e55a14c1810af8a201419093679573ec42842

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 914b675501f67aa289b075141fa4635dc024dbb3d28d75656421fa0cf089f8e8
MD5 0f54df56b65c29332b6ec6363dd12451
BLAKE2b-256 726d6ec42ab3d5ae25430ce381da8fd08d435f466ecd56373275f3fbccaca79f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 060d62efcbb0ef1a84258953c36bc823c08a3ee38624757fab2a627455cb209d
MD5 e818e1e9670e886a4177f37cfc0c717d
BLAKE2b-256 4d7bcd18f6d436036bdffc2a26783f666ffda18af8926a70c3193b716762c742

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: vc_flas-0.1.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 160c40d1daba16d587e5c07d1485419d384dc15bef4776ffa1e394e358d6bbff
MD5 5a6daabe9ec4d9ec5f8c5e88bc9b9bb7
BLAKE2b-256 e7e296c16e10f2df8a8ee6785280fa98062337da3cf88349f88e1610fad86b27

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e2cac55404ace38ccc617b988ca01fa33c18d7ea4a025660daea22778e88f330
MD5 b2ba614b8405e2e480fcad88eb9dd82a
BLAKE2b-256 4a15e3bba2fc5dacdbe6e6d896098786719a5a30c529d2e44141dd2f4d2f3c5d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4bdc3c97f15bc2d57f7008f60d24eb1bef4c4d70b9cb7f71be2369f9d4833a16
MD5 9f41d2565a8f0d219479a8094567aebd
BLAKE2b-256 fa7baf3071f99b8f3b768cfbf533e355d840167927a72ec5ac277d005a8b1651

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 5728180b8583aef6df4af2cb997434232bce5ddb2b8e77e567f708dc4120097c
MD5 6529604ec33855f59dde83adaba880e4
BLAKE2b-256 3a0554d9d447be73852b59e1539c8f254679def51ba168b8558209c23fc4c223

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6be3befe3d9fee6896c1f7085eb4ecfc0b119fb3e52f0304d249869971236775
MD5 7957ead7f978d7039cd55b15e69626f2
BLAKE2b-256 ebb33e97d17a8d528edaba624624cc6fb781b2cfc70a02434d3bcf6a703f6b0b

See more details on using hashes here.

Provenance

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