# Computing Height-Optimal Tangles Faster

**Authors:** Oksana Firman, Philipp Kindermann, Alexander Ravsky, Alexander Wolff,, Johannes Zink

arXiv: 1901.06548 · 2024-01-02

## TL;DR

This paper addresses the problem of constructing height-optimal wire tangles with minimal layers, proves NP-hardness, and provides an exact algorithm with practical implementation and comparison to existing methods.

## Contribution

It introduces an NP-hardness proof for the minimal-layer tangle problem and presents an exact algorithm with complexity analysis and implementation.

## Key findings

- The problem is NP-hard.
- An exact algorithm with exponential complexity is provided.
- Implementation results compare favorably to existing algorithms.

## Abstract

We study the following combinatorial problem. Given a set of $n$ y-monotone wires, a tangle determines the order of the wires on a number of horizontal layers such that the orders of the wires on any two consecutive layers differ only in swaps of neighboring wires. Given a multiset $L$ of swaps (that is, unordered pairs of numbers between 1 and $n$) and an initial order of the wires, a tangle realizes $L$ if each pair of wires changes its order exactly as many times as specified by $L$. The aim is to find a tangle that realizes $L$ using the smallest number of layers. We show that this problem is NP-hard, and we give an algorithm that computes an optimal tangle for $n$ wires and a given list $L$ of swaps in $O((2|L|/n^2+1)^{n^2/2} \cdot \varphi^n \cdot n)$ time, where $\varphi \approx 1.618$ is the golden ratio. We can treat lists where every swap occurs at most once in $O(n!\varphi^n)$ time. We implemented the algorithm for the general case and compared it to an existing algorithm. Finally, we discuss feasibility for lists with a simple structure.

## Figures

3 figures with captions in the complete paper: https://tomesphere.com/paper/1901.06548/full.md

---
Source: https://tomesphere.com/paper/1901.06548