Algorithm Model --- Vertical and horizontal backbones
4.1 Crossings Minimization
4.1.1 Hypergraph with Specified backbone
In Chapter 4, the problem becomes more complex. There are vertical and horizontal backbones appearing at the same time. The backbone of a hyperedge can be vertical or horizontal, and the constraint the single gap can only accommodate one backbone is still exist. The aesthetic criterion discussed here is crossing number. The illustration of one hyperedge with a vertical backbone is in the following.
Figure 22: Illustration for vertical backbone
In this section, the order of hyperedges is fixed including the x-coordinate order and the y-coordinate order. Besides, hyperedges are split into two groups in advance.
Problem Description:
Crossing minimization for hypergraphs with fixed-order horizontal backbones, vertical backbones and hyperedges are split into two groups in advance (HCM_fhbvb_g):
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.
22
Input: Given a set of n points, and its fixed position; a set of e hyperedges which includes the horizontal type and vertical type.
Constraint: classify the backbones’ type in advance, single backbone in each gap.
Output: a hypergraph drawing with minimal crossings.
Theorem 1: HCM_fhbvb_g is solvable in O ( |V|
2 ^2 × (|H|
2 )^2) time.
The situation is more complicated than the situation in Chapter 3. The causes of crossings are four: two of these causes are caused by the same direction backbones, vertical and vertical, horizontal and horizontal; the other two causes are caused by the different direction backbones, and the illustration is below.
Figure 23: Example of crossings
The CROSS matrix records the crossing number that the i-th backbone is put in the g-th gap (horizontal) and the j-th backbone is put in the G-th gap (vertical). The SUM matrix records that the minimal crossing number when the i-th backbone is put in the g-th gap (horizontal) and the j-th backbone is put in the G-th gap (vertical) and the preceding (i-1) horizontal backbones and (j-1) vertical backbones are put already.
The value of CROSS matrix is similar with the one in section 3.1.1.
CROSS[i][g][j][G] = CROSS_SAMEH[i][g] + CROSS_SAMEV[j][G] (crossings caused by the same direction (like CROSS[i][g] in section 3.1.1)) +
CROSS_M[i][g][j][G] (crossings caused by the two hyperedges (the i-th backbone and the j-th backbone)).
23
SUM[i][g][j][G] = MINg’<g,G’<G (SUM[i-1][g’][j-1][G’]) +
∑𝑗𝑗′=0′=𝑗−1CROSS_M[i][g][j′][the gap from the min 𝑆𝑈𝑀] +
∑𝑖′=𝑖−1𝑖′=0 CROSS_M[i′][the gap from the min 𝑆𝑈𝑀][j][G] + CROSS[i][g][j][G]
Statement (1) is correct. The minimal crossing number can be divided into two parts. One part is fixed, and it contains crossings caused by the i-th hyperedge and the j-th hyperedge and crossings caused by the same direction backbones. The second part changes according to the gap’s order so that the algorithm can choose minimal crossing number, and it includes the crossing caused by the preceding (i-1) horizontal backbones and the preceding (j-1) vertical backbones, the crossings caused by the i-th backbone and the preceding (j-1) vertical backbones, and the crossings caused by the j-th backbone and the preceding (i-1) horizontal backbones. The main idea is that the causes of crossings are independent.
The algorithm can find optimal answers. The SUM table will always return the optimal solution. And, all value can be calculated by the pre-computed cells. The final answer will be shown in the
MINg,G SUM[the number of horizontal hyperedges][g][the number of vertical hyperedges][G].□
--- (1)
24
4.1.2 Hypergraph with Unspecified backbone
In this section, the only difference from the section 4.1.1 is that the hyperedges don’t be spilt in two groups in advance. Still, the hyperedges have specific order. For instance, the (i-1)-th hyperedge’s backbone is above the i-th hyperedge’s backbone; the (j-1)-th hyperedge’s backbone is on the j-th hyperedge’s backbone’s left.
Problem Description:
Crossing minimization for hypergraphs with fixed-order horizontal backbones and vertical backbones (HCM_fhbvb):
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.
Input: Given a set of n points, and its fixed position; a set of e hyperedges which includes the horizontal type and vertical type.
Constraint: single backbone in each gap.
Output: a hypergraph drawing with minimal crossings.
Theorem 1: HCM_fhbvb is solvable in O (|V|
2 ^2 × (|H|
2 )^2 × |H|) time.
The backbone being horizontal or vertical is decided by the dynamic programming.
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]
25
Backbones type assign () { for k = 0 to e do {
Answer += MIN (A (k) or B (k)) }
}
The proof is similar as the one in section 4.1.1.
26
4.2 Length Minimization
In this section, the aesthetic criteria discussed here is total length minimization, and there is a constraint that only one backbone is put in each gap no matter it is vertical or horizontal. The order of hyperedges is flexible and the degree of nodes can be not only one. The algorithm optimizing the length is below.
Length minimization for hypergraphs with horizontal backbones and vertical backbones (HLM_hbvb):
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.
Theorem 1: HLM_hbvb is solvable in O (|H|^4) time.
Proof: There are two cases, one is that the group is split in advance and the other doesn’t.
Specified case:
Figure 24: Bipartite matching for specified case
We transform our problem to a bipartite matching; the nodes in set A correspond to all hyperedge’s backbone; the red nodes in set B correspond to the gaps in horizontal and the green nodes correspond to the gaps in vertical. Because the group type is already known, the edge between two sets is connected from horizontal type backbone to the gaps in horizontal and vice versa. Each edge has weight which presents its length.
27
Unspecified case:
Figure 25: Bipartite matching for Unspecified case
The difference from the specific case is the edges between two sets. All edges are connected because we don’t know whether the backbone being vertical or horizontal is better. After the transformation, the problem becomes the Minimum Weight Perfect Bipartite Matching which can be solved in polynomial time.
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.□
28
4.3 Hyperedge Maximization
In this section, the purpose is to maximize the number of hyperedges on the hypergraph. In an ordinary situation, a hypergraph drawing can contain all hyperedges in the hyperedge set. Nevertheless, the hypergraph drawing will be filled with clutter.
As a result, it is discussed under the condition that the hypergraph must be overlapping –free.
Input: 2 × (n + 1) gaps with n − 1 length, a set of e hyperedges which contains half horizontal backbones and half vertical backbones.
Constraint: single backbone in each gap.
Output: an overlapping-free hypergraph drawing with maximal hyperedge number.
Figure 26: Illustration for HHM_hbvb
The simplest case is that only one backbone is put in each gap. The maximal number of hyperedge is 2 × (n + 1), because the backbone only can put in the gap and one hyperedge has one backbone. So the maximal number of hyperedges equals to the number of gap, 2 × (n + 1).
Input: 2 × (n + 1) gaps with n − 1 length, a set of e hyperedges which contains half horizontal backbones and half vertical backbones.
Constraint: classify the type of backbones of hyperedges in advance.
Output: an overlapping-free hypergraph drawing with maximal hyperedge number.
29
The more general case is that each gap can accommodate multiple backbones.
Given a hyperedge set of e hyperedges and 2 × (n + 1) gaps with n − 1 length, optimize the number of hyperedges and make their backbone do not have any overlapping in each gap. The algorithm is in the following.
The hyperedges are classified in advance, so separate them in the beginning. In the aspect of the horizontal backbones, put them into the horizontal gaps. It is means that the algorithm here is the same as the one in section 3.3; in the aspect of the vertical backbones, put them into the vertical gaps. The only difference from the algorithm in section 3.3 is that the space they occupied may not be the same. In other word, the length of a vertical hyperedge is different from the length of the horizontal hyperedges even that they are connected with same nodes. And, the length is an important factor that will impact the number of the hyperedge we can put in a hypergraph drawing.
Problem Description:
Hyperedge maximization for hypergraphs with horizontal backbones and vertical backbones (HHM_hbvb):
Given a hypergraph GH = (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.
Input: 2 × (n + 1) gaps with n − 1 length, a set of e hyperedges which contains half horizontal backbones and half vertical backbones.
Output: an overlapping-free hypergraph drawing with maximal hyperedge number.
Theorem: HHM_hbvb is solvable in O (|V|×|H|^2) time.
Proof: The outside iteration is from 0 to n. In iteration, there two gaps needed to be filled with, one is horizontal, and the other is vertical. Using two vectors to record the value that the number of backbones that cannot be put: EXCLUDE_H records that if the hyperedge is put in a horizontal gap, the number that other backbones cannot be put in the same gap; EXCLUDE_V records that if the hyperedge is put in a vertical gap, the number that other backbones cannot be put in the same gap. The algorithm will choose
30
the minimal value of both the EXCLUDE_H and EXCLUDE_V vector. These vector also save which backbones cannot be put. After picking the backbone, the backbones of the EXCLUDE_H or EXCLUDE_V will be deleted according to the direction the backbone was put. If the hyperedge is put already, record it.
For example: there are six nodes in a hypergraph, which are named A, B, C, D, E, F.
The order in the horizontal is A, B, C, D, E, F, and the order in the vertical is
Termination: when execute (6+1) times or until all hyperedges are put.
The greedy algorithm can find one optimal placement. Suppose there is an optimal solution. There are two situations that that the largest number of my greedy algorithm is less than optimal solution. Assume greedy algorithm picks the k-th hyperedge’s backbone to put in the horizontal gap.
31
Situation (1): the optimal solution picks the same backbone to the vertical gap.
Figure 27: Illustration for situation (1)
Because the optimal solution should have more hyperedges, the space originally for the k-th backbone must be filled with another backbone such as the orange line.
However, the EXCLUDE_H[orange line] must be less than EXCLUDE_H[black line].
The greedy algorithm should have picked the orange line instead of black line.
Situation (2): the optimal solution doesn’t pick the same backbone to the vertical gap nor horizontal gap.
Figure 28: Illustration for situation (2)
Because the optimal solution should have more hyperedges, the space originally for the k-th backbone must be filled with another backbone such as the orange line.
However, the EXCLUDE_H[orange line] must be less than EXCLUDE_H[k-th hyperedge]; EXCLUDE_V[orange line] must be less than EXCLUDE_V[k-th hyperedge]. The greedy algorithm should have picked the orange line instead of the k-th hyperedge. □
32