## 5.407. two_layer_edge_crossing

Origin

Inspired by [HararySchwenk72].

Constraint

Arguments
 $\mathrm{\pi ½\pi ²\pi \pi Ύ\pi \pi }$ $\mathrm{\pi \pi \pi \pi }$ $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi }-\mathrm{\pi \pi \pi },\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$ $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi }-\mathrm{\pi \pi \pi },\mathrm{\pi \pi \pi }-\mathrm{\pi \pi \pi \pi }\right)$ $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi }-\mathrm{\pi \pi \pi },\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1}-\mathrm{\pi \pi \pi },\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}-\mathrm{\pi \pi \pi }\right)$
Restrictions
 $\mathrm{\pi ½\pi ²\pi \pi Ύ\pi \pi }\beta ₯0$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1},\left[\mathrm{\pi \pi },\mathrm{\pi \pi \pi }\right]\right)$ $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}.\mathrm{\pi \pi }\beta ₯1$ $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}.\mathrm{\pi \pi }\beta €|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}|$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1},\mathrm{\pi \pi }\right)$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1},\mathrm{\pi \pi \pi }\right)$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2},\left[\mathrm{\pi \pi },\mathrm{\pi \pi \pi }\right]\right)$ $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}.\mathrm{\pi \pi }\beta ₯1$ $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}.\mathrm{\pi \pi }\beta €|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}|$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2},\mathrm{\pi \pi }\right)$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2},\mathrm{\pi \pi \pi }\right)$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi },\left[\mathrm{\pi \pi },\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1},\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}\right]\right)$ $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi }\beta ₯1$ $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi }\beta €|\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }|$ $\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi }$$\left(\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi },\mathrm{\pi \pi }\right)$ $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1}\beta ₯1$ $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1}\beta €|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}|$ $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}\beta ₯1$ $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}\beta €|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}|$
Purpose

$\mathrm{\pi ½\pi ²\pi \pi Ύ\pi \pi }$ is the number of line segments intersections.

Example
$\left(\begin{array}{c}2,β©\mathrm{\pi \pi }-1\mathrm{\pi \pi \pi }-1,\mathrm{\pi \pi }-2\mathrm{\pi \pi \pi }-2βͺ,\hfill \\ β©\mathrm{\pi \pi }-1\mathrm{\pi \pi \pi }-3,\mathrm{\pi \pi }-2\mathrm{\pi \pi \pi }-1,\mathrm{\pi \pi }-3\mathrm{\pi \pi \pi }-2βͺ,\hfill \\ β©\begin{array}{ccc}\mathrm{\pi \pi }-1\hfill & \mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1}-2\hfill & \mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}-2,\hfill \\ \mathrm{\pi \pi }-2\hfill & \mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1}-2\hfill & \mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}-3,\hfill \\ \mathrm{\pi \pi }-3\hfill & \mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1}-1\hfill & \mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}-1\hfill \end{array}βͺ\hfill \end{array}\right)$

FigureΒ 5.407.1 provides a picture of the example, where one can see the two line segments intersections. Each line segment of FigureΒ 5.407.1 is labelled with its identifier and corresponds to an item of the $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }$ collection. The two vertices on top of FigureΒ 5.407.1 correspond to the items of the $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}$ collection, while the three other vertices are associated with the items of $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}$.

Typical
 $|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}|>1$ $|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}|>1$ $|\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }|\beta ₯|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}|$ $|\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }|\beta ₯|\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}|$
Symmetries
• Arguments are permutable w.r.t. permutation $\left(\mathrm{\pi ½\pi ²\pi \pi Ύ\pi \pi }\right)$ $\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1},\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}\right)$ $\left(\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }\right)$.

• Items of $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}$ are permutable.

• Items of $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}$ are permutable.

Arg. properties

Functional dependency: $\mathrm{\pi ½\pi ²\pi \pi Ύ\pi \pi }$ determined by $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1}$, $\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2}$ and $\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }$.

Remark

The two-layer edge crossing minimisation problem was proved to be NP-hard inΒ [GareyJohnson83].

Keywords
Derived Collection
$\mathrm{\pi \pi \pi }\left(\begin{array}{c}\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }_\mathrm{\pi ΄\pi \pi \pi \pi ΄\pi Ό\pi Έ\pi \pi Έ\pi ΄\pi }-\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{1}-\mathrm{\pi \pi \pi \pi },\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{2}-\mathrm{\pi \pi \pi \pi }\right),\hfill \\ \left[\begin{array}{c}\mathrm{\pi \pi \pi \pi }\left(\begin{array}{c}\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{1}-\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{1}\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{1},\mathrm{\pi \pi \pi },\mathrm{\pi \pi }\right),\hfill \\ \mathrm{\pi \pi \pi ’\pi \pi }\mathtt{2}-\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }.\mathrm{\pi \pi \pi \pi \pi \pi ‘}\mathtt{2}\left(\mathrm{\pi  \pi ΄\pi \pi \pi Έ\pi ²\pi ΄\pi }_\mathrm{\pi »\pi °\pi \pi ΄\pi }\mathtt{2},\mathrm{\pi \pi \pi },\mathrm{\pi \pi }\right)\hfill \end{array}\right)\hfill \end{array}\right]\hfill \end{array}\right)$
Arc input(s)

$\mathrm{\pi ΄\pi ³\pi Ά\pi ΄\pi }_\mathrm{\pi ΄\pi \pi \pi \pi ΄\pi Ό\pi Έ\pi \pi Έ\pi ΄\pi }$

Arc generator
$\mathrm{\pi Ά\pi Ώ\pi Ό\pi \pi \pi Έ}$$\left(<\right)\beta ¦\mathrm{\pi \pi \pi \pi \pi \pi \pi \pi \pi \pi }\left(\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1},\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}\right)$

Arc arity
Arc constraint(s)
$\beta \left(\begin{array}{c}\beta \left(\begin{array}{c}\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{1}<\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{1},\hfill \\ \mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{2}>\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{2}\hfill \end{array}\right),\hfill \\ \beta \left(\begin{array}{c}\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{1}>\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{1},\hfill \\ \mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{1}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{2}<\mathrm{\pi \pi \pi \pi \pi }_\mathrm{\pi \pi ‘\pi \pi \pi \pi \pi \pi \pi \pi \pi }\mathtt{2}.\mathrm{\pi \pi \pi ’\pi \pi }\mathtt{2}\hfill \end{array}\right)\hfill \end{array}\right)$
Graph property(ies)
$\mathrm{\pi \pi \pi \pi }$$=\mathrm{\pi ½\pi ²\pi \pi Ύ\pi \pi }$

Graph model

As usual for the two-layer edge crossing problem [HararySchwenk72],Β [DiBattistaEadesTamassiaTollis99], positions of the vertices on each layer are represented as a permutation of the vertices. We generate a derived collection that, for each edge, contains the position of its extremities on both layers. In the arc generator we use the restriction $<$ in order to generate a single arc for each pair of segments. This is required, since otherwise we would count more than once a line segments intersection.

PartsΒ (A) andΒ (B) of FigureΒ 5.407.2 respectively show the initial and final graph associated with the Example slot. Since we use the $\mathrm{\pi \pi \pi \pi }$ graph property, the arcs of the final graph are stressed in bold.