• 沒有找到結果。

(a) average leader crossing counts

run = 1000, w = 800, h = 600

Algorithm

label count

5 6 7 8 9 10 15 20 25 50

Initial 8.07 12.22 16.97 22.56 29.53 36.94 86.65 156.62 248.27 1016.13

PCM-2 5.03 7.41 10.39 14.02 18.17 22.59 52.47 95.38 150.85 616.58

Greedy-SCM-s-2 3.32 4.99 6.94 9.39 12.30 15.27 36.46 66.80 106.44 447.65 BaryY-SCM-s-2 3.84 5.70 8.08 11.02 14.29 17.72 42.20 76.81 122.49 505.91 BaryRay-SCM-s-2 4.02 5.88 8.38 11.37 14.74 18.30 43.00 77.95 124.03 508.82 BaryRayEnhanced-SCM-s-2 3.84 5.70 8.08 11.02 14.29 17.72 42.20 76.81 122.49 505.91 LenMin-SCM-s-2 3.45 5.11 7.22 9.71 12.63 15.75 37.19 67.45 106.92 441.78

Optimal 3.32 4.60 6.36 8.52 11.14

(b) total execution time (s)

Algorithm

label count

5 6 7 8 9 10 15 20 25 50

PCM-2 0.09 0.08 0.07 0.19 0.17 1.09 1.04 0.90 1.16 2.02

Greedy-SCM-s-2 1.32 1.19 1.46 6.47 7.69 37.64 48.50 74.65 120.26 703.26

BaryY-SCM-s-2 0.10 0.07 0.07 0.24 0.23 1.13 1.05 1.11 1.45 2.35

BaryRay-SCM-s-2 0.14 0.22 0.10 0.27 0.26 1.47 1.48 1.49 1.85 2.69

BaryRayEnhanced-SCM-s-2 0.17 0.14 0.13 0.29 0.32 1.81 1.95 1.86 1.91 2.58 LenMin-SCM-s-2 0.68 0.42 0.42 1.82 2.49 14.74 22.99 31.35 52.23 140.28

Optimal 6.56 16.31 104.3 6143 53948

Besides the five algorithms mentioned above, we use the result of the PCM-2 problem and optimal case to compare. To generate the optimal result for the PCM-2 problem, we set all the x-coordinates of feature points to one, and solve it by the barycenter algorithm.

In PCM-2 case, only y-coordinates matter, so the result generated by barycenter algorithm is optimal, that has been proved by [5]. To generate the optimal result of simultaneous

calculate the crossing number for all possible label placements. It’s really time-consuming because there are total n! label placements for each test case.

In the case of boundary labeling with type-s leader, the x-coordinates of features mat-ter as well. For example, given 2 labels l1 and l2 as well as 2 features p1 and p2. Every label-feature pair is connected by a leader, l1 is the label of p1 and l2 is the label of p2. If the y-coordinate of p1is bigger than y-coordinate of p2and the y-coordinate of l1is smaller than y-coordinate of l2, there must exist a crossing of leaders in PCM-k, 2-layer 1-sided bipartite graph crossing minimization, and type-opo boundary labeling problems. How-ever, when it comes to type-s boundary labeling problem, intersection between leaders (l1,p1) and (l2,p2) is not inevitable in this situation.

Based on the relative relationship between feature p and coordinates of l1 and l2, we can divided p into three categories. The first category is that p is above both l1and l2. The second category is that p is in the middle of l1 and l2. The third category is that p is under both l1 and l2.

Table 3.2: The possibility of crossing-free in SCM-s-2 when there must a crossing for PCM-2

category of p1 category of p2 intersection is avoidable

1 1 ∨

Table 3.3: The possibility of crossing in SCM-s-2 when there must be no crossing for PCM-2

category of p1 category of p2 intersection may occur

1 1 ∨ four out of six cases that the intersection of 2 leaders can be avoided in SCM-s-2 according to the different x-coordinates of p1and p2. When l1y > l2y and p1y > p2y, there must be crossing-free in PCM-2, however there are only two out of six cases that the intersection of 2 leaders may occur in SCM-s-2 according to the different x-coordinates of p1and p2. Therefore, the average crossing number of optimal result is fewer than the result of PCM-2 in our experimental test cases.

Greedy-SCM-s-2 algorithm has the best performance among all parameters of feature point number and it costs more time than the other four algorithms (as shown in Figure 3.3). LenMin-SCM-s-2 algorithm performs next to it, but it has higher complexity than the complexity of Greedy-SCM-s-2 algorithm. Because the given number of feature points is not big enough, it seems Greedy-SCM-s-2 algorithm takes more time in the experiment owing to its complicated steps. BaryY-SCM-s-2 algorithm, which only considers the y-coordinates of features, is the fastest one (as shown in Figure 3.4). BaryRay-SCM-s-2 algorithm, which also considers the x-coordinates of features, is slower and does not outperform the others.

Figure 3.3: The experiment result of algorithms for SCM-s-2

Figure 3.4: The execution time of algorithms for SCM-s-2

Theorem 1. SCM-s-k is a NP-complete problem when k

≥ 4.

Proof. The problem is obviously in NP. Now we show the lower bound. The PCM-k problem can be reduced to type-s leader simultaneous boundary labeling. Since the PCM-k problem is NP-hard when PCM-k≥ 4 [5], so as this problem.

We show how to reduce PCM-k to our problem as following. Given a set of (full or partial) permutations π = 1, ..., πk} on a set of labels U = {l1, l2, ..., lnl}. First, we

construct a series of k images R1, R2, ..., Rk of which the height h is nl and the width w is 2. The number nl is equals to |U|, which means there are nl distinct labels in the series of images. The number np of distinct features points in the series of images is maxi∈{1,...,k}|πi|. The x-coordinates of these distinct nppoints p1, p2, ..., pnpare the same, i.e., they are on the same column. The y-coordinates of these distinct np points are 1 to np. Then for i = 1 to k, we build an image Ri for each permutation πi. If there are |ni| elements in πi, the feature point sets of Ri is Pi = {p1, p2, . . . , pni}, and the associated label of each point in Riis the same as πi.

For example in Figure 3.5, if the permutation π1 = (l1, l3, l2, l4, l5), we can build an image R1 of which the height h is 5 and the width w is 2. The point set of image R1 is P1 = {p1, p2, p3, p4, p5} and the coordinates of feature pi is (1, i). The label ordering of R1 is L1 = (l1, l3, l2, l4, l5), which means l1 is the associated label of p1 and l3 is the associated label of p2, and so on.

Figure 3.5: The example of how to build an image R1 by a permutation π1

If we can find a label placement, i.e., assign each label in L to a port in Y , which guarantee the sum of crossing number from image R1 to Rkis minimal, the order of the label placement according to y-coordinate is also the best permutation π such that the crossing number of π is minimal.

If the order of laand lb in permutation πi and the order of which in best permutation π is different, means the y-coordinate order of la and lb is different with their associated

feature points pa and pb. This condition must cause a crossing in both PCM-k and the type-s simultaneous boundary labeling problem.

Theorem 2. SLM-s-2 can be solved in O(n

3) time.

Proof. We transform the problem to Min-Weighted Bipartite Matching problem and solve it by the Hungarian Algorithm which can solve the Min-Weighted Bipartite Matching problem in O(n3) time. In SLM-s-2 problem, images R1, R2, and Y are given. The vertexs on one side of the bipartite graph are labels in L1 ∪ L2, and the vertexs on the other side are coordinates of label ports. The weight of edge (li, yi) is the sum of the Euclidean distance between the associated points of li and the port yi. Figure 3.6 is the graph of the weighted bipartite graph of this problem. The label placement of minimal total leader length criterion for a series of two images does not guarantee the minimal leader crossing number according to our experiment result of SCM-s-2.

Figure 3.6: The weighted bipartite graph of SML-s-2

Theorem 3. SLM-s-k (k

∈ N) can be solved in O(n3) time.

Proof. We transform the problem to Min-Weighted Bipartite Matching problem and solve it by the Hungarian Algorithm which can solve the Min-Weighted Bipartite Matching problem in O(n3) time. In SLM-s-k problem, images R1, R2, ..., Rk, and Y are given.

The vertexs on one side of the bipartite graph are labels in L1∪L2∪...∪Lkvertexs on the other side are label ports. The weight of edge (li, yi) is the sum of the Euclidean distance between the associated points of li and the port yi.

3.2 type-po leader

For SCM-po-2, The exact complexity of the problem or optimal algorithm are not known at this point. Therefore, we design some polynomial time heuristic algorithms to generate a type-po leader label placement of minimum number of crossings and compare their results with the optimal result.

In SCM-po-2, images R1, R2, and Y are given as input.

3.2.1. Sort-SCM-po-2

The first algorithm uses the concept of bubble sort. From i=1 to n, we swap the i-th label with i+1-th label if the crossing number is smaller after swapping in every iteration.

The iteration ends until the number of crossing is not reduced. The time complexity is O(n2).

Algorithm Sort-SCM-po-2 algorithm

相關文件