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.2.tar.gz (25.8 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.2-cp312-cp312-win_amd64.whl (96.7 kB view details)

Uploaded CPython 3.12Windows x86-64

vc_flas-0.1.2-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.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

vc_flas-0.1.2-cp312-cp312-macosx_11_0_x86_64.whl (95.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

vc_flas-0.1.2-cp312-cp312-macosx_11_0_arm64.whl (86.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

vc_flas-0.1.2-cp311-cp311-win_amd64.whl (96.6 kB view details)

Uploaded CPython 3.11Windows x86-64

vc_flas-0.1.2-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.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (121.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

vc_flas-0.1.2-cp311-cp311-macosx_11_0_x86_64.whl (95.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

vc_flas-0.1.2-cp311-cp311-macosx_11_0_arm64.whl (86.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: vc_flas-0.1.2.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for vc_flas-0.1.2.tar.gz
Algorithm Hash digest
SHA256 86cb0786d17d2f392ab79681718093dc38f8b50d0721ffaeb64775e1521a0853
MD5 f33c09076c7a2ef970e3956a220b231a
BLAKE2b-256 2de934977769ba1318c93862a6dc61db1dc3a189eb19ee1dec6d3621ec96260e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: vc_flas-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 96.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for vc_flas-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 92a978f1c9f2190ea6c3b4cd77a5b970e722a08923e6c8d55ff37719e88eb054
MD5 22d01fed788cf16f944f236b3ec96074
BLAKE2b-256 6af29f7e61158bc52baa8b0a0c3ae7b9acd24d57d7d3b42185872acd84d30803

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3e50c2f843b8861c4e99d29ba1497afc55e4da4e6bb9336537e6749205e1dcba
MD5 ebff6eff11d565fabf3a143fbeedf994
BLAKE2b-256 6cef5c022fe6e4fd9d91ba9746a6bf8536d16b31a4b970fd71a679605cbef868

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd57e5ca7139f8abebc2c0847a29c27df69f97550141a1f4ea510638d1f9fe01
MD5 00194fc87f4abbf1c22f052b6648da3d
BLAKE2b-256 36a134cc414b917036925e9c8835d0d719b9109fa7652b3a5010cd2640ec515e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 70e31f6189306f771bcb6760cb7d640ddd0743e63b0d8e8afb9a333dc5e597e2
MD5 b34b725b235ebe006e34e04fdc32c969
BLAKE2b-256 9d59fbe49d492be8d747897521cf27c82f16ee13d6b70bc0a8f878411f579a7d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba392a7c071f5ce81af02332a2a396652309cc1e8edef90180c151e2e5f72a6c
MD5 7e5a04ef61bfcc45f18f9061b95e9045
BLAKE2b-256 81a63d56d55076e8509bb3be10155a9f13bc6eef10412d2152de12804d3410de

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: vc_flas-0.1.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 96.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for vc_flas-0.1.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d5184c689cfeb44e90a397c726441638b31978227aeac225399dc1bffd9db64e
MD5 46a56629197cb0e5874500a13427b4ed
BLAKE2b-256 36ba8231deb7f8887047d1f22494616bfe3289e3ab423d3c467b77e8f371de5b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e0b45efd31bf9dbcc59b2b0e804c7356c5d1c9153d96c1007c8abab56201fc7c
MD5 8f81cd54644a2df11c91e49997b9badb
BLAKE2b-256 38b96e9e92907c820a70d3266310c5c807c8daf1a71ef0ececeeff0ef75a597f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ce29f809eb87e83f02749f80219472f24ef2a2d23891dde8e20c4567c2931758
MD5 bf596924f3e213fe447c50ee012e73aa
BLAKE2b-256 91e525835e675818331599e108b3f3957e3b9a9af37c2ee1f0c8e76efe395b6c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 81ada774c316137927c50eb3ec8ac6d048a288544deb7dde8da85cb095d68bff
MD5 9eb200553659bd6194bedc2535af3063
BLAKE2b-256 8402cb6dde2922541c5a2634dcb02b3cea636b0d4c7d01a0a997c589d9151d34

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for vc_flas-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d5921d4b3f40a1e1a452171f0230435ec6221a74c8bce6e569f79a72fdb1476e
MD5 9f23c2beeabb62922b2de9d8ebb2c57f
BLAKE2b-256 cabe7239b9af12aca93ab6aed5b533b5557d3d295aa22ca9b111509f49bf8d42

See more details on using hashes here.

Provenance

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