Linear diagrams are an effective way to visualize set-based data by representing elements as columns and sets as rows with one or more horizontal line segments, whose vertical overlaps with other rows indicate set intersections and their contained elements. The efficacy of linear diagrams heavily depends on having few line segments. The underlying minimization problem has already been explored heuristically, but its computational complexity has yet to be classified. In this paper, we show that minimizing line segments in linear diagrams is equivalent to a well-studied NP-hard problem, and extend the NP-hardness to a restricted setting. We develop new algorithms for computing linear diagrams with minimum number of line segments that build on a traveling salesperson (TSP) formulation and allow constraints on the element orders, namely, forcing two sets to be drawn as single line segments, giving weights to sets, and allowing hierarchical constraints via PQ-trees. We conduct an experimental evaluation and compare previous algorithms for minimizing line segments with our TSP formulation, showing that a state-of-the art TSP-solver can solve all considered instances optimally, most of them within few milliseconds.
翻译:线性图表是一种有效的方法,通过将元素作为纵列和成行以一个或多个水平线段表示成行来将基于定点的数据直观化,这些元素与其他行垂直重叠,表明定点交叉点及其包含的元素。线性图表的功效在很大程度上取决于几条线段。基本最小化问题已经进行了粗略的探讨,但其计算复杂性尚未分类。在本文中,我们表明,将线性图表中的线性部分最小化相当于一个经过仔细研究的NP-硬问题,并将NP-硬度扩大到一个受限制的设置。我们开发了新的算法,用于计算线性图的线性图,其最小数量以旅行销售人员(TSP)的公式为基础,并允许对元素顺序进行限制,即强迫将两套作为单线段绘制,给定分数,并允许通过PQ-树进行等级限制。我们进行了实验性评估,并将先前的算法与我们的TSP-S-sover的配方相比,显示一种状态的TSP-solver能够最优化地解析所有考虑的事例,多数在几毫秒内。