Algorithm Model ---- Octilinear backbones
5.1 Cross Minimization
5.1.1 Hypergraph with Fixed octilinear segment length
The meaning of the word “octilinear” is that the slope of each segment of an edge path is a multiple of 45 degree. An octilinear backbone is composed of two 45 degree segments and a straight line [3].
Figure 29: Illustration for octilinear backbone
Figure 29(a) shows that a horizontal backbone and two vertical segments; Figure 29(b) shows that two 45 degree segments connected with a horizontal backbone. This chapter discusses the hypergraph visualization that consists of horizontal backbones, vertical backbones and horizontal octilinear backbones. The reason why the hypergraph only contains the horizontal octilinear backbone is that the hyperedge may overlap each other if both octilinear backbones (vertical and horizontal) are used. And in the section 5.1, we want to minimize the crossing number with the constraints: single backbone in each gap, fixed order, and specified group.
In this section, every 45 degree segments’ length equals to √2 × (d), and the d is the distance between the gap and the node in the gap. The illustration is below.
33
Problem Description:
Crossing minimization for hypergraphs with fixed-order horizontal backbones, vertical backbones and octilinear horizontal backbones; and fixed octilinear length (HCM_fhbvbo_fol):
Given a hypergraph HG=(V, H), an integer k, and a total order among edges in HG, deciding whether there is a drawing of G such that the x,y coordinates of the |H|
backbones respect the total order and the total number of crossings is less than or equal to k.
Figure 30: Illustration for HCM_fhbvbo_fol
Theorem: HCM_fhbvbo_fol is solvable in O (|V|
2 ^2 × (|H|
2 )^2) time.
Proof: the algorithm is as same as the algorithm in section 4.1.1.
The minimal crossing number is the same as the one in section 4.1.1. Because the crosses that octilinear backbone cause is always same as the hypergraph drawing without octilinear backbones. No matter using octilinear backbones or not, the crossing number does not change; it will not increase or decrease. In the following, we will list all possible case.
Case 1: horizontal octilinear backbone CROSS horizontal backbone
Figure 31: Example for horizontal octilinear backbone CROSS horizontal backbone
34
Figure 31(a): because the length of the octilinear segment.
Figure 31(b): because the node’s position. (The black dotted line)
Case 2: horizontal octilinear backbone CROSS vertical backbone
Figure 32: Example for horizontal octilinear backbone CROSS vertical backbone Figure 32(a): because the node’s position.
Figure 32(b): because the node’s position.
If there are any cases that can reduce the crossing number, the minimal crossing might happen when using an octilinear backbone. If not, the minimal crossing number can also appear under the condition in Chapter 4.□
35
5.1.2 Hypergraph with Flexible octilinear segment length
In this section, the length of each 45 degree segment is flexible.
Figure 33: Example of flexible octilinear backbone
In Figure 33(a), the length can be at most √2 × 2.5 gap’s length, and it can be
√2 × 1.5 or √2 ∗ 0.5 gap’s length too. In figure (b), the length can be √2 × 1.5 or
√2 ∗ 0.5 gap’s length, because there exists a vertical segment needed to be connected with in the middle of the backbone. In these two figures, the other side’s drawing is identical to left side. (If the left is drawn in red form, the right side must be drawn in red form too).
Input: a set of n points and its fixed position, a set of e hyperedge and its fixed order, its specified type (vertical or horizontal or octilinear).
Constraint: single backbone in each gap, classify the backbones in advance.
Output: the hypergraph drawing with minimal crossing number.
The main idea is that the crossing number is fixed when the hyperedge’s order is appointed. When the k-th hyperedge is put in the g-th gap, the minimal crossing number right now will be the preceding minimal crossing number plus its own crossing number.
And, its own crossing number can be calculated while i hyperedges are placed in horizontal; j hyperedges are placed in vertical; and o horizontal hyperedges are octilinear.
36
However, the o horizontal hyperedges’ octilinear segment is flexible. When a hyperedge is given, the horizontal octilinear backbone may have several different lengths like the figure shown above. And, every option has impact on the crossing number. Generally, these can also be solved by a dynamic programming which is similar with the one in section 4.1.2.
The length of an octilinear horizontal backbone is decided by the dynamic programming, and the largest number of length possibilities is |V|.
Problem Description:
Crossing minimization for hypergraphs with fixed-order horizontal backbones, vertical backbones, and octilinear horizontal backbones; and flexible octilinear length (HCM_fhbvbo):
Given a hypergraph HG=(V, H), an integer k, and a total order among horizontal edges and vertical edges in H, deciding whether there is a drawing of HG such that the x coordinates and y coordinates of the |H| backbones respect the orders and the total number of crossings is less than or equal to k.
Theorem 1: HCM_fhbvbo is solvable in O (|V|
2^2×|𝐻|
2 ^2× |H|× L) time, where L is largest number of possibilities for each octilinear hyperedge’s length.
Proof: the algorithm is similar as the one in section 4.1.2.
A[l] [k] is minimal crossing numbers when the k-th backbone’s octilinear length is l.
A[k] is minimal crossing numbers as the one in section 4.1.1.
37
HCM_fhbvbo (){
for (k=0; k<n; k++) {
if the k-th backbone is octilinear, the possible length is l { Answer += MIN (A[l] [k])
} Else {
if the backbone is horizontal:
A (i) = SUM[i][g][j][G] = MINg’<g,G’<G (SUM[i-1][g’][j][G’]) +
∑𝑗𝑗′=0′=𝑗CROSS_M[i][g][j′][the gap from the min 𝑆𝑈𝑀] + CROSS_SAMEH[i][g]
if the backbone is vertical:
B (j) = SUM[i][g][j][G] = MING’<G.g’<g (SUM[i][g’][j-1][G’]) +
∑𝑖′=𝑖𝑖′=0CROSS_M[i′][the gap from the min 𝑆𝑈𝑀][j][G] + CROSS_SAMEV[j][G]
Answer += MIN (A (k) or B (k)) }
} }
38
5.2 Length Minimization
Problem Description:
Length minimization for hypergraphs with horizontal backbones, vertical backbones, and horizontal octilinear backbones (HLM_hbvbo):
Given a hypergraph HG = (V, H), an integer k, deciding whether there is a drawing of HG such that the total length is less than or equal to k.
Input: a set of n points and its fixed position, a set of e hyperedges which consist of fixed horizontal octilinear length backbones, ordinary horizontal backbones and vertical backbones with flexible order.
Constraint: single backbone in each gap, specified group.
Output: hypergraph drawing with the minimal total hyperedge length.
Theorem 1: HLM_hbvbo is solvable in O (|H|^4) time.
Proof: First, we consider the specified case which means the hyperedges are appointed to the one of the three types of backbones. Make every hyperedge be the node in set A, and make each gap be the node in set B. The problem can be transformed into a bipartite matching problem. The weight of the edge between the set A and the set B is calculated beforehand, and the value of the weight is the length while the hyperedge is put in the gap.
Figure 34: Bipartite matching for specified case
39
The red nodes in set B represent the horizontal gap, and the green nodes represent the vertical gap. In specified case, the edge is connected with according to their type.
As an octilinear type backbone, the length may less than the ordinary one. It is the only difference between the section 4.2 and this section.
Figure 35: Bipartite matching for unspecified case (fixed octilinear length) Secondly, if the types are not appointed in advance, the algorithm will force all horizontal backbones to become octilinear to make the total length minimal, and then solve it by the algorithm that solves Minimum Weight Perfect Bipartite Matching.
Lastly, if the length of octilinear segments is flexible, the weight of the edge of the matching will be multiple.
Figure 36: Example for flexible octilinear length
For instance, the length when the hyperedge is put in the appointed gap is different according to the color in Figure 36(a). However, the only thing we care about is the length; the minimal length is the ultimate goal. The algorithm will make optimized choice among these options. It will choose orange backbone in Figure 36(a), and choose red backbone in Figure 36(b). The subsequent processing is like the above.
40
The transformation is correct. It is observed that the length when a specific hyperedge is put in specific gap is fixed. The value will not change when other hyperedges are put in some gaps. Also, because the constraint here is that each gap can only accommodate one backbone, the problem can be transformed into the bipartite matching problem.□
41
5.3 Hyperedge Maximization
Input: 2 × (n + 1) gaps with n − 1 length, a set of e hyperedges which contain the horizontal octilinear backbones, ordinary horizontal backbones and vertical backbones.
Constraint: fixed octilinear length.
Output: an overlapping-free hypergraph drawing with maximal hyperedge number.
Problem Description:
Hyperedge maximization for hypergraphs with horizontal backbones and vertical backbones and fixed horizontal octilinear backbones (HHM_hbvbo_fol):
Given a hypergraph HG = (V, H), an integer k, deciding whether there is a drawing of HG such that the total number of hyperedges is larger than or equal to k.
Theorem 1: HHM_hbvbo_fol is solvable in O (|V|×|H|^2) time.
Proof: We firstly show that the situation that may increase the number of hyperedges in the following illustration.
Fixed length case: in the original drawings, the blue hyperedge and the orange hyperedge will overlap each other if they are placed in the same gap. The black segment is the place that the blue hyperedge’s backbone will occupy originally.
Figure 37: Example for Fixed length case
The algorithm can calculate the length of backbone when the type is already known. And the subsequent processing is like the algorithm in the second case of section 4.3. In the aspect of vertical gaps, it is all the same. In the aspect of horizontal gaps, the definition of the gradation on the gaps needs to change slightly, because the octilinear type’s length is different (less). Furthermore, the content of EXCLUDE_H must calculate according to the new gradation. Using the fixed octilinear length instead
42
of ordinary horizontal can obtain the optimal answer, because the number of hyperedges is decided by the length. If the length is minimal, it has less chance to overlap others.
43