# Evolutionary Computation for Label Layout on Unused Space of Stacked Graphs

Authors: Alejandro Toledo; Kingkarn Sookhanaphibarn; Ruck Thawonmas; Frank Rinaldo
Journal: ISRN Artificial Intelligence
 (2012)

---

## Abstract

Placing numerous objects and their corresponding labels in the stacked graph visualization is a challenging problem. In the stacked graph, different combinations of initial parameters and filtering effects yield views with hidden information, illegible labels, and unused space. The result is a tool that does not take advantage on the unused space to reveal information to the user for further investigation. We present an automatic method for label layout on the unused space in a stacked graph. An evolutionary computation (EC) is used to optimize the best label position according to legibility requirements, as well as requirements for keeping semantic relationships between labels and their representative visual objects. A number of EC experiments, as well as a usability study on label legibility, show that our proposed solution looks promising, as compared to the traditional solutions.


---

## Body

## 1. Introduction

Designing effective information visualization systems with abundant associated labels is a difficult task, especially when the screen space is limited. Label layout is an essential task in the field of information visualization to identify the visualized data and different visual objects. The challenge is to find a global labeling solution without any overlapping of other labels. Since labels are used to explain the data, the solution is reduced not only to minimize the overlapping, but also to keep semantic relationships between labels and their corresponding visual objects. The label layout problem, which is proved to be NP-hard, has been extensively studied. In cartographic design, for instance, label legibility is the most important requirement [1].


## 2. Related Work

In this paper, we use and extend the stacked graph visualization as proposed in [2, 3], where a collection of job occupations is visualized using stripes representing occupation’s time series (Figure 1). Since the data values are normalized, the heights of individual stripes add up to the height of the overall graph; thus, there can be no spaces between the stripes because this would distort their sum. In the case of stacked graphs with many occupations, this may cause the individual stripes to be harder to read. The legibility of the data is, indeed, an unsolved design consideration of the stacked graph [4].Figure 1
Stacked graph view (left) showing 40 job occupation names starting with the prefix “A”, and TLV = 0 pixels. A number of labels are illegible due to either overlapping or small size. The solid line encloses the visualization area, and the dotted line the unused space. At the right, an increased section of the same view (top) with TLV = 12 pixels (some labels are hidden). The same section (bottom) can be seen with TLV = 0 (some labels are overlapped) and with their minimum font size increased three times.Colors have been used to distinguish stripes without using heavy borders [2]. Another proposed solution in [2] is to use a threshold for label visibility (TLV), which is the minimum width, in pixels, for a stripe to receive a label. However, in a previous experiment [5], we found that the TLV makes no significant improvement on data legibility. Moreover, as for the obtained results, the lack of labels on some of the stripes was the main reason they found on the stacked graph illegibility. In this work, we use the TLV to compare our proposed system with two versions of the traditional stacked graph.Maximizing the display of data content in a comprehensible way is a problem that has been addressed by many researchers. Li et al. [6] implemented a set of techniques in LifeLines, a visualization environment as applied to medical patient records. The authors presented algorithms and metrics based on map-oriented techniques.Text labels either overlay visual objects or placed outside (internal versus external labels). Works supporting the idea to use “call-outs”or “leaders” connecting external labels to visual objects can be found on hand-made illustrations, as in [7, 8], or for labeling server motherboards, as in [9].Works on aesthetic layouts to support the legibility of stacked graphs can be found in [4, 10]. Here, the author’s proposal is on the use of different shapes or stripes, as well as coloring. Hartman et al. [11] developed a similar idea with the use of external labels.Studies on labeling and label legibility have been conducted to support information visualizations. Talbot et al. [12] extended Wilkinsons optimization approach to produce labelings on axis in a two-dimensional graph. Luboschik et al. [13] present a labeling method using fast point-feature, to support information visualization systems. An interesting experiment on label readability can also be found in [14], where the authors investigated the readability of medication labels. The contributions of this paper are (i) a new component, based on evolutionary computation, for augmenting the readability of labels in the stacked graph visualization, (ii) an adjustment to the PMX crossover operator for permutation of label positions, (iii) an adjustment to the SWAP mutation operator for replacement of label positions, and (iv) a usability study on label legibility proving the effectiveness of our method.


## 3.  Evolutionary Computation Design

Using a grid layout, the visualization area is divided into a collection of equal partitions. The center point of each partition is the actual absolute position. Each partition has a unique identifier, and those not intersecting with the stacked area—in the unused space—are considered as the candidate partitions. Figure2 shows the partitions obtained from the stacked graph of Figure 1. A 5×8 grid layout (5 rows and 8 columns) was used; leading to 16 candidate partitions (circles colored blue). To support a more efficient solution encoding, candidate partitions are reindexed, for example, in Figure 2 from 0 to 15.Figure 2
Partition of the visualization area of the stacked graph of Figure1. Partitions in blue color correspond to the candidate partitions for label layout.


### 3.1. Chromosome Encoding

We encode a label layout design in one chromosome, using variable-length, fixed-order binary encoding. Given a set of illegible labelsL, and a set of candidate partitions P, a chromosome (Table 1) is produced using |L| genes. Under this representation, each gene consists of Γ|P| bits indicating the candidate partition for positioning the corresponding label. We define Γn using the following recurrence:(1)Γ0=0;Γn=γn+Γn-2γn.
Here, γn=⌊log2n⌋ denotes a locus encoding a partial gene evaluation.Table 1
Chromosome encoding.
Label 1…Label|L|Γ|P| bits…Γ|P|bitsThe evaluation of theith gene for the candidate label li∈L will then yield a partition, upon which positioning li on the unused space. Therefore, all partitions derived from the complete chromosome characterize a label layout for all selected illegible labels.As an example, consider two layouts represented by the following two chromosomes, where six labels are to be placed on the unused space of the stacked graph of Figure1, using the partitions of Figure 2:Chromosome A:000001100010100001111001Chromosome B:100101010110001100010010Our approach is similar to several proposed GAs for reordering or permutation problems. The most famous is the traveling salesman problem (TSP) in which a salesman wants to visit a number of cities while traveling the least possible distance. In the TSP, each city must be represented once and only once; and the fitness of the chromosome is related to the tour length, which in turn depends on the ordering of the cities. Our solution is comparable to the TSP in the encoding method, that is, we prefer partitions to be represented once and only once in the chromosome. This is because their repetitions would lead to overlapping, and thus infeasible solutions. Our label layout problem and TSP differ, however, in the number of encoded elements. In the TSP, all cities are represented in a chromosome, while our solution encodes only a subset of the candidate partitions. This will require an adjustment of the crossover and mutation operators designed for the TSP, which we describe later in the following sections.


### 3.2.  Fitness Function

We decided that the quality of label layout depends on the fitness of candidate partitions for the illegible labels. We enforce appropriate label arrangements on the unused space using the following criteria:F1: Minimize the overlapping between labels,F2: Maximize the correlation between the label order and the stripe order.The fitness value forF1 for individual i is inversely proportional to the number of labels with overlapping:
(2)F1(i)=1-overlapping(i),overlapping(i)=Φi|L|,
where Φi is the number of labels, of individual i, with overlapping. Here, two labels are overlapped if the intersection between their bounding boxes is greater than zero.The fitness value forF2 is proportional to the correlation between the label order and stripe order. For each individual i, we calculate two tuples. A tuple of partition positions (PP) is obtained from the absolute y-coordinates of the encoded partitions, and a tuple of stripe positions (SP) is the order of the L illegible labels under consideration in the current stacked graph. The two tuples are used to reward a correlation ratio between the label order and the stripe order using the following equation:(3)F2(i)=pc(PP,SP)+12,
where pc denotes the Pearson product moment correlation coefficient. Note that |PP|=|SP|=|L|. Finally, the total fitness value for indivual i is obtained as(4)fitnessi=w1F1(i)+w2F2(i),
where wx is a weighting ratio for criterion Fx.


### 3.3.  Genetic Algorithm and Genetic Operators

We used the following genetic algorithm.(1)
Create an initial population ofC chromosomes (generation 0)(2)
Evaluate the fitness of each chromosome(3)
Select the fittest chromosome(4)
Excluding the chromosome selected in step 3, selectC-1 parents from the current population via roulette wheel selector(5)
Choose at random a pair of parents for mating. Apply crossover operator(6)
Process each offspring by the mutation operator, and insert the new offspring into the new population(7)
Repeat steps 5 and 6 untilC-1 offsprings are created(8)
Replace the old population of chromosomes with the new population(9)
Add the chromosome selected in step 3 into the new population(10)
Evaluate the fitness of each chromosome in the new population(11)
Increase the generation number and go back to step 3 if this number is less than some upper bound.The above algorithm introduces concepts such as crossover and mutation operator. In this work we used the following four operators.(1) Single Point Crossover (C1).
The single point crossover operator is aimed at exchanging bit strings between two parent chromosomes. A random position between 1 and|L|-1 is chosen along the two parent chromosomes, where L is the chromosome’s length. Then, the chromosomes are cut at the selected position, and their end parts are exchanged to create two offspring. For instance, the two chromosomes of the previous section are selected to produce two offspring as follows.parentA: 06|2879offspringA′: 066312parentB: 95|6312offspringB′: 952879It should be noted that single-point crossover cannot guarantee representations with no repeated values.(2) Partially Matched Crossover, PMX, (C2).
PMX [15] arose in considering ways to tackle issues associated with the classic traveling salesman problem (TSP). Given two parents A and B, PMX randomly picks two crossover points. The offspring is then constructed in the following way. Starting with a copy of A, the positions between the crossover points are, one by one, set to the values of B in these positions. To keep the string a valid chromosome, the cities in this positions are not just overwritten. To set position p to city c, the city in position p and city c swap positions. Consider the example below of this encoding for the two tours A: 6,2,3,4,1,7,5 and B: 5,2,4,1,3,7,6.swap 4 and 1swap 3 and 4no changefirst offspring623|41̲7|5623̲14̲75624137̲5A′:6241375↑↑↑524|137|652413765241376623|417|562341756234175↓↓↓524̲|1̲37|6521̲43̲76523417̲6B′:5234176swap 4 and 1swap 1 and 3no changesecond offspringSince TSP chromosomes encode all cities, the city in positionp and city c can always be exchanged, for example, cities 1,3,7 and 4,1,7 could be found in the copies of A and B, respectively. In our domain, however, a partition in position p cannot always find its pair within the same parent. So, we propose to solve this by replacing such partition with the one in position p in the other parent. Consider the example below of this encoding for the two chromosomes A: 0,6,2,8,7,9 and B: 9,5,6,3,1,2.swap 6 and 2replace 8 with 3first offspring06̲|2̲8|790268̲79026379↑↑95|63|129563̲1206|28|790628̲79↓↓95|6̲3|12̲9523̲16952816swap 6 and 2replace 3 with 8second offspring(3) Simple Mutation (M1).
The bits of the two offspring generated by the crossover operator are then processed by the mutation operator. This operator is applied to each bit with a small probability (e.g., 0.001). When it is applied at a given position, the new bit value switches from 0 to 1 or from 1 to 0. Here, it should also be noted that the simple mutation operator cannot guarantee representations with no repeated    values.(4) Swap Mutation (M2).
Mutation operators for the TSP are aimed at randomly generating new permutation of cities. As opposed to the simple mutation operator, which introduces small perturbations into the chromosome, the permutation operators for the TSP often greatly modifies the original tour. One example is the swap mutation operator, where two cities are selected and swapped (i.e., their positions are exchanged). Since TSP chromosomes encode all cities, the selection of two of them is always possible. In our domain, however, there may be cases where this is not possible. Here, as part of our second adjustment, we propose to perform this selection by choosing one partition from the chromosome, and the other from the set of candidate partitionsP. The latter is randomly selected until a chromosome with no repeated values can be formed. Then, this partition replaces the one in the chromosome.


## 3.1. Chromosome Encoding

We encode a label layout design in one chromosome, using variable-length, fixed-order binary encoding. Given a set of illegible labelsL, and a set of candidate partitions P, a chromosome (Table 1) is produced using |L| genes. Under this representation, each gene consists of Γ|P| bits indicating the candidate partition for positioning the corresponding label. We define Γn using the following recurrence:(1)Γ0=0;Γn=γn+Γn-2γn.
Here, γn=⌊log2n⌋ denotes a locus encoding a partial gene evaluation.Table 1
Chromosome encoding.
Label 1…Label|L|Γ|P| bits…Γ|P|bitsThe evaluation of theith gene for the candidate label li∈L will then yield a partition, upon which positioning li on the unused space. Therefore, all partitions derived from the complete chromosome characterize a label layout for all selected illegible labels.As an example, consider two layouts represented by the following two chromosomes, where six labels are to be placed on the unused space of the stacked graph of Figure1, using the partitions of Figure 2:Chromosome A:000001100010100001111001Chromosome B:100101010110001100010010Our approach is similar to several proposed GAs for reordering or permutation problems. The most famous is the traveling salesman problem (TSP) in which a salesman wants to visit a number of cities while traveling the least possible distance. In the TSP, each city must be represented once and only once; and the fitness of the chromosome is related to the tour length, which in turn depends on the ordering of the cities. Our solution is comparable to the TSP in the encoding method, that is, we prefer partitions to be represented once and only once in the chromosome. This is because their repetitions would lead to overlapping, and thus infeasible solutions. Our label layout problem and TSP differ, however, in the number of encoded elements. In the TSP, all cities are represented in a chromosome, while our solution encodes only a subset of the candidate partitions. This will require an adjustment of the crossover and mutation operators designed for the TSP, which we describe later in the following sections.


## 3.2.  Fitness Function

We decided that the quality of label layout depends on the fitness of candidate partitions for the illegible labels. We enforce appropriate label arrangements on the unused space using the following criteria:F1: Minimize the overlapping between labels,F2: Maximize the correlation between the label order and the stripe order.The fitness value forF1 for individual i is inversely proportional to the number of labels with overlapping:
(2)F1(i)=1-overlapping(i),overlapping(i)=Φi|L|,
where Φi is the number of labels, of individual i, with overlapping. Here, two labels are overlapped if the intersection between their bounding boxes is greater than zero.The fitness value forF2 is proportional to the correlation between the label order and stripe order. For each individual i, we calculate two tuples. A tuple of partition positions (PP) is obtained from the absolute y-coordinates of the encoded partitions, and a tuple of stripe positions (SP) is the order of the L illegible labels under consideration in the current stacked graph. The two tuples are used to reward a correlation ratio between the label order and the stripe order using the following equation:(3)F2(i)=pc(PP,SP)+12,
where pc denotes the Pearson product moment correlation coefficient. Note that |PP|=|SP|=|L|. Finally, the total fitness value for indivual i is obtained as(4)fitnessi=w1F1(i)+w2F2(i),
where wx is a weighting ratio for criterion Fx.


## 3.3.  Genetic Algorithm and Genetic Operators

We used the following genetic algorithm.(1)
Create an initial population ofC chromosomes (generation 0)(2)
Evaluate the fitness of each chromosome(3)
Select the fittest chromosome(4)
Excluding the chromosome selected in step 3, selectC-1 parents from the current population via roulette wheel selector(5)
Choose at random a pair of parents for mating. Apply crossover operator(6)
Process each offspring by the mutation operator, and insert the new offspring into the new population(7)
Repeat steps 5 and 6 untilC-1 offsprings are created(8)
Replace the old population of chromosomes with the new population(9)
Add the chromosome selected in step 3 into the new population(10)
Evaluate the fitness of each chromosome in the new population(11)
Increase the generation number and go back to step 3 if this number is less than some upper bound.The above algorithm introduces concepts such as crossover and mutation operator. In this work we used the following four operators.(1) Single Point Crossover (C1).
The single point crossover operator is aimed at exchanging bit strings between two parent chromosomes. A random position between 1 and|L|-1 is chosen along the two parent chromosomes, where L is the chromosome’s length. Then, the chromosomes are cut at the selected position, and their end parts are exchanged to create two offspring. For instance, the two chromosomes of the previous section are selected to produce two offspring as follows.parentA: 06|2879offspringA′: 066312parentB: 95|6312offspringB′: 952879It should be noted that single-point crossover cannot guarantee representations with no repeated values.(2) Partially Matched Crossover, PMX, (C2).
PMX [15] arose in considering ways to tackle issues associated with the classic traveling salesman problem (TSP). Given two parents A and B, PMX randomly picks two crossover points. The offspring is then constructed in the following way. Starting with a copy of A, the positions between the crossover points are, one by one, set to the values of B in these positions. To keep the string a valid chromosome, the cities in this positions are not just overwritten. To set position p to city c, the city in position p and city c swap positions. Consider the example below of this encoding for the two tours A: 6,2,3,4,1,7,5 and B: 5,2,4,1,3,7,6.swap 4 and 1swap 3 and 4no changefirst offspring623|41̲7|5623̲14̲75624137̲5A′:6241375↑↑↑524|137|652413765241376623|417|562341756234175↓↓↓524̲|1̲37|6521̲43̲76523417̲6B′:5234176swap 4 and 1swap 1 and 3no changesecond offspringSince TSP chromosomes encode all cities, the city in positionp and city c can always be exchanged, for example, cities 1,3,7 and 4,1,7 could be found in the copies of A and B, respectively. In our domain, however, a partition in position p cannot always find its pair within the same parent. So, we propose to solve this by replacing such partition with the one in position p in the other parent. Consider the example below of this encoding for the two chromosomes A: 0,6,2,8,7,9 and B: 9,5,6,3,1,2.swap 6 and 2replace 8 with 3first offspring06̲|2̲8|790268̲79026379↑↑95|63|129563̲1206|28|790628̲79↓↓95|6̲3|12̲9523̲16952816swap 6 and 2replace 3 with 8second offspring(3) Simple Mutation (M1).
The bits of the two offspring generated by the crossover operator are then processed by the mutation operator. This operator is applied to each bit with a small probability (e.g., 0.001). When it is applied at a given position, the new bit value switches from 0 to 1 or from 1 to 0. Here, it should also be noted that the simple mutation operator cannot guarantee representations with no repeated    values.(4) Swap Mutation (M2).
Mutation operators for the TSP are aimed at randomly generating new permutation of cities. As opposed to the simple mutation operator, which introduces small perturbations into the chromosome, the permutation operators for the TSP often greatly modifies the original tour. One example is the swap mutation operator, where two cities are selected and swapped (i.e., their positions are exchanged). Since TSP chromosomes encode all cities, the selection of two of them is always possible. In our domain, however, there may be cases where this is not possible. Here, as part of our second adjustment, we propose to perform this selection by choosing one partition from the chromosome, and the other from the set of candidate partitionsP. The latter is randomly selected until a chromosome with no repeated values can be formed. Then, this partition replaces the one in the chromosome.


## 4. Experiments

Aiming at solving the overlapping problem among labels (w1=1,w2=0), our goal here was to compare the performance of the four combinations C1M1, C1M2, C2M1, and C2M2, all in terms of the time required to find a solution and the quality of the solution obtained. In order to be fair to the four operators, as well as to be thorough in our experiment, we compared the results among combinations using scaled problems through the use of different grid layout resolutions.


### 4.1.  Experimental Setup

We selected 25 illegible labels describing job occupation names from the view of Figure1. The illegibility criterion was based on font size, where the smaller the font size, the most illegible the label. These labels have different lengths and, thus, different bounding boxes. To improve their legibility, we increased by 40% the base minimum size of each label. We also used five different grid layouts for partitioning the visualization area, 10×10, 12×12, 14×14, 16×16, and 18×18; leading to 34, 49, 71, 97, and 134 candidate partitions, respectively. As for crossover operators, we used single point (C1) and the adjusted PMX crossover (C2), both using a crossover rate of 0.6. As for mutation operators, we used simple (M1) and the adjusted swap mutation (M2), both using a mutation rate of 1/|L|. Finally, we used the following five different values for C (population size): 25,50,75,100,125.All candidate partitions, genetic operators (C1, C2, M1, M2), and population sizes were combined to produce 100 types of parameter selections for running the genetic algorithm. We call each type a “configuration.” Thus, for this experiment, we have the configuration tuples (conf1,34,C1,M1,25),…, (conf4,34,C2,M2,25),…, and (conf100,134,C2,M2,125). To produce a fair comparison among configurations, we reuse populations and create new ones at given intervals. Since populations can be reused only for tuples with the same number of candidate partitions, a new random initial population is created when the configuration number is a multiple of 4, otherwise, it is reused. Finally, each configuration was run using 500 generations, and all reported values are the results of 10 independent runs.


### 4.2.  Results

Two metrics were used to measure the results.(1)
Quality of Solutions (QSn)QS1: Fitness value obtained at generation 500.QS2: Difference between QS1 and the initial fitness value.(2)
Convergence Speed (CSn)CS1: Best-fitness average of all generations [16](5)1T∑j=1Tft.CS2: Difference between CS1 and the initial fitness value.Since we have different initial fitness values (25 in total),QS2 and CS2 will let us know the quality and convergence speed, respectively, of the solutions with respect to the evolution of populations.In terms ofQS1, the best configuration was obtained from a grid layout of 14×14 (71 candidate partitions), population size C of 50 individuals, adjusted PMX crossover (C2), and adjusted SWAP mutation (M2); with a fitness average of QS1=0.944, as shown in Table 2.Table 2
Comparison of configurations C1M1, C1M2, C2M1, C2M2 on five different numbers of candidate partitions (left side) and five numbers of population sizes. The best result among candidate partitions is emphasized in boldface. For each candidate solution number, the first row corresponds to theQS1 measurement, the second to QS2, the third to CS1, and the last one to CS2.
255075100125C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2340.3600.6560.4200.6400.4040.6320.4720.6480.4240.6320.4840.6720.4760.6880.5040.6600.4840.6480.5040.6760.0400.3360.1000.3200.0440.2720.1120.2880.0240.2320.0840.2720.0040.2080.0240.1800.0040.1680.0240.1960.3590.5670.4180.5640.4010.5280.4690.5750.4240.5560.4820.5860.4750.6050.5020.5950.4830.5710.5010.6040.0390.2470.0980.2440.0410.1680.1090.2150.0240.1560.0820.1860.0050.1250.0220.1150.0030.0910.0210.124490.4120.6800.4480.6920.3960.7240.4560.7280.4400.7240.5120.7240.4600.6720.5160.7160.5000.6840.5440.7440.0520.3200.0880.3320.0360.3640.0960.3680.0400.3240.1120.3240.0200.2320.0760.2760.1000.2840.1440.3440.4110.5710.4460.5960.3950.5970.4540.6150.4390.6260.5100.6430.4570.5960.5140.6280.4980.5840.5400.6410.0510.2110.0860.2360.0350.2370.0940.2550.0390.2260.1100.2430.0170.1560.0740.1880.0980.1840.1400.241710.6000.8640.6560.8760.5760.8960.6320.9440.6160.9080.6680.9280.6520.8760.7120.9000.6200.8920.7520.9320.0800.3440.1360.3560.0160.3360.0720.3840.0560.3480.1080.3680.0280.1960.0320.2200.1000.3720.2320.4120.5980.7680.6540.7670.5750.8010.6310.8410.6150.7980.6660.8450.6480.7990.7080.8240.6180.8070.7460.8490.0780.2480.1340.2470.0150.2410.0710.2810.0550.2380.1060.2850.0320.1190.0280.1440.0980.2870.2260.329970.5200.8520.5840.8880.5720.8680.6000.9160.5800.8960.6360.8800.6120.8560.6360.9160.5800.8480.6880.8800.0800.4120.1440.4480.0520.3480.0800.3960.0200.3360.0760.3200.1320.3760.1560.4360.0200.2880.1280.3200.5180.7310.5810.7640.5700.7620.5980.8210.5790.7820.6340.7990.6070.7540.6320.8030.5780.7640.6810.8030.0780.2910.1410.3240.0500.2420.0780.3010.0190.2220.0740.2390.1270.2740.1520.3230.0180.2040.1210.2431340.4480.7440.4800.7480.4960.8280.5680.8400.5160.8320.5480.8440.5000.7720.5840.8040.5680.8120.6000.8320.0880.3840.1200.3880.0640.2680.0080.2800.0360.3520.0680.3640.0600.3320.1440.3640.0080.2520.0400.2720.4470.6430.4780.6620.4960.7350.5670.7200.5140.7200.5460.7270.4970.6620.5800.7060.5650.7030.5950.7240.0870.2830.1180.3020.0640.1750.0070.1600.0340.2400.0660.2470.0570.2220.1400.2660.0050.1430.0350.164In terms ofQS2, the best configuration was obtained from a grid layout of 16×16 (97 candidate partitions), population size C of 25 individuals, adjusted PMX crossover (C2), and adjusted SWAP mutation (M2); with an improvement of QS2=0.448.In terms of bothCS1 and CS2, the best configuration was obtained from a grid layout of 14×14 (71 candidate partitions), population size C of 125 individuals, adjusted PMX crossover (C2), and adjusted SWAP mutation (M2); with a convergence speed CS1=0.849 and CS2=0.329.Our results show that our proposed operators, in this domain, outperform the standard ones. Also, as from our observations of the second and the third best results, the combination C2M2 outperforms,99% of the time, the other two operators. Another observation is that our best results of C2M2 were concentrated on configurations sharing the grid layout 14×14 (71 candidate partitions). This suggests that our proposed method has no significant improvement by increasing the number of candidate partitions. Since we were also interested in the time required to obtain the best solution, we also observed the convergence speeds of our proposed method. Here, the convergence speed of the best QS1, CS1=0.841, is the third best convergence speed. Moreover, it has no significant difference with the best convergence speed CS1=0.849. This number is associated to the group of 71 candidate partitions (14×14) and was also obtained from the combination C2M2. In general, this can be explained by the variations in the number of individuals 50≤C≤125, which confirms previous results, such as those of De Jong test functions [16].Figure3 shows the performance comparison among C1M1, C2M2, C2M2, and C2M2. Best fitness value versus generation number is plotted for all configurations. The experiment has been repeated 10 times to plot average values, using different maximum generation numbers. Because of space limitations, the plots for only the best QS1, QS2, CS1, and CS2 are given.Performance comparison among C1M1, C1M2, C2M1, and C2M2. Best fitness value versus generation number is plotted for three configurations.
(a)(b)(c)(d)Figure4 shows contour plots, where the best results for the three variables (i) populations size, (ii) candidate partitions, and (iii) fitness value, are shown. It can be observed that where M2 is used, better fitness values are obtained, and also lower numbers of individuals are required, which suggests better computational performance. Moreover, where the combination C2M2 was used, the best fitness values were obtained.Performance comparison among C1M1, C1M2, C2M1, and C2M2 for three configurations for the three variables (i) population size, (ii) candidate partitions, and (iii) fitness value.
(a)(b)(c)(d)Figure5 shows stacked graph views produced by our genetic algorithm. Figure 5(a) show the result of experiment 3 d), as applied to Figure 1, where the weights w1=w2=0.5 was used. Figure 5(b) and Figure 5(c) show the results of views with prefixes “C” and “F”, respectively.Stacked graph views produced by our genetic algorithm. (a) view showing 25 job occupation names starting with the prefix “A”. This view was produced using the weight parametersw1=w2=0:5, that is, free from overlapping, and the order of labels are correlated with the order of stripes. Similarly, using w1=1; w2=0, (b) corresponds to a view with the prefix “C”, and (c) to a view with the prefix “F”.
(a)(b)(c)


## 4.1.  Experimental Setup

We selected 25 illegible labels describing job occupation names from the view of Figure1. The illegibility criterion was based on font size, where the smaller the font size, the most illegible the label. These labels have different lengths and, thus, different bounding boxes. To improve their legibility, we increased by 40% the base minimum size of each label. We also used five different grid layouts for partitioning the visualization area, 10×10, 12×12, 14×14, 16×16, and 18×18; leading to 34, 49, 71, 97, and 134 candidate partitions, respectively. As for crossover operators, we used single point (C1) and the adjusted PMX crossover (C2), both using a crossover rate of 0.6. As for mutation operators, we used simple (M1) and the adjusted swap mutation (M2), both using a mutation rate of 1/|L|. Finally, we used the following five different values for C (population size): 25,50,75,100,125.All candidate partitions, genetic operators (C1, C2, M1, M2), and population sizes were combined to produce 100 types of parameter selections for running the genetic algorithm. We call each type a “configuration.” Thus, for this experiment, we have the configuration tuples (conf1,34,C1,M1,25),…, (conf4,34,C2,M2,25),…, and (conf100,134,C2,M2,125). To produce a fair comparison among configurations, we reuse populations and create new ones at given intervals. Since populations can be reused only for tuples with the same number of candidate partitions, a new random initial population is created when the configuration number is a multiple of 4, otherwise, it is reused. Finally, each configuration was run using 500 generations, and all reported values are the results of 10 independent runs.


## 4.2.  Results

Two metrics were used to measure the results.(1)
Quality of Solutions (QSn)QS1: Fitness value obtained at generation 500.QS2: Difference between QS1 and the initial fitness value.(2)
Convergence Speed (CSn)CS1: Best-fitness average of all generations [16](5)1T∑j=1Tft.CS2: Difference between CS1 and the initial fitness value.Since we have different initial fitness values (25 in total),QS2 and CS2 will let us know the quality and convergence speed, respectively, of the solutions with respect to the evolution of populations.In terms ofQS1, the best configuration was obtained from a grid layout of 14×14 (71 candidate partitions), population size C of 50 individuals, adjusted PMX crossover (C2), and adjusted SWAP mutation (M2); with a fitness average of QS1=0.944, as shown in Table 2.Table 2
Comparison of configurations C1M1, C1M2, C2M1, C2M2 on five different numbers of candidate partitions (left side) and five numbers of population sizes. The best result among candidate partitions is emphasized in boldface. For each candidate solution number, the first row corresponds to theQS1 measurement, the second to QS2, the third to CS1, and the last one to CS2.
255075100125C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2C1M1C1M2C2M1C2M2340.3600.6560.4200.6400.4040.6320.4720.6480.4240.6320.4840.6720.4760.6880.5040.6600.4840.6480.5040.6760.0400.3360.1000.3200.0440.2720.1120.2880.0240.2320.0840.2720.0040.2080.0240.1800.0040.1680.0240.1960.3590.5670.4180.5640.4010.5280.4690.5750.4240.5560.4820.5860.4750.6050.5020.5950.4830.5710.5010.6040.0390.2470.0980.2440.0410.1680.1090.2150.0240.1560.0820.1860.0050.1250.0220.1150.0030.0910.0210.124490.4120.6800.4480.6920.3960.7240.4560.7280.4400.7240.5120.7240.4600.6720.5160.7160.5000.6840.5440.7440.0520.3200.0880.3320.0360.3640.0960.3680.0400.3240.1120.3240.0200.2320.0760.2760.1000.2840.1440.3440.4110.5710.4460.5960.3950.5970.4540.6150.4390.6260.5100.6430.4570.5960.5140.6280.4980.5840.5400.6410.0510.2110.0860.2360.0350.2370.0940.2550.0390.2260.1100.2430.0170.1560.0740.1880.0980.1840.1400.241710.6000.8640.6560.8760.5760.8960.6320.9440.6160.9080.6680.9280.6520.8760.7120.9000.6200.8920.7520.9320.0800.3440.1360.3560.0160.3360.0720.3840.0560.3480.1080.3680.0280.1960.0320.2200.1000.3720.2320.4120.5980.7680.6540.7670.5750.8010.6310.8410.6150.7980.6660.8450.6480.7990.7080.8240.6180.8070.7460.8490.0780.2480.1340.2470.0150.2410.0710.2810.0550.2380.1060.2850.0320.1190.0280.1440.0980.2870.2260.329970.5200.8520.5840.8880.5720.8680.6000.9160.5800.8960.6360.8800.6120.8560.6360.9160.5800.8480.6880.8800.0800.4120.1440.4480.0520.3480.0800.3960.0200.3360.0760.3200.1320.3760.1560.4360.0200.2880.1280.3200.5180.7310.5810.7640.5700.7620.5980.8210.5790.7820.6340.7990.6070.7540.6320.8030.5780.7640.6810.8030.0780.2910.1410.3240.0500.2420.0780.3010.0190.2220.0740.2390.1270.2740.1520.3230.0180.2040.1210.2431340.4480.7440.4800.7480.4960.8280.5680.8400.5160.8320.5480.8440.5000.7720.5840.8040.5680.8120.6000.8320.0880.3840.1200.3880.0640.2680.0080.2800.0360.3520.0680.3640.0600.3320.1440.3640.0080.2520.0400.2720.4470.6430.4780.6620.4960.7350.5670.7200.5140.7200.5460.7270.4970.6620.5800.7060.5650.7030.5950.7240.0870.2830.1180.3020.0640.1750.0070.1600.0340.2400.0660.2470.0570.2220.1400.2660.0050.1430.0350.164In terms ofQS2, the best configuration was obtained from a grid layout of 16×16 (97 candidate partitions), population size C of 25 individuals, adjusted PMX crossover (C2), and adjusted SWAP mutation (M2); with an improvement of QS2=0.448.In terms of bothCS1 and CS2, the best configuration was obtained from a grid layout of 14×14 (71 candidate partitions), population size C of 125 individuals, adjusted PMX crossover (C2), and adjusted SWAP mutation (M2); with a convergence speed CS1=0.849 and CS2=0.329.Our results show that our proposed operators, in this domain, outperform the standard ones. Also, as from our observations of the second and the third best results, the combination C2M2 outperforms,99% of the time, the other two operators. Another observation is that our best results of C2M2 were concentrated on configurations sharing the grid layout 14×14 (71 candidate partitions). This suggests that our proposed method has no significant improvement by increasing the number of candidate partitions. Since we were also interested in the time required to obtain the best solution, we also observed the convergence speeds of our proposed method. Here, the convergence speed of the best QS1, CS1=0.841, is the third best convergence speed. Moreover, it has no significant difference with the best convergence speed CS1=0.849. This number is associated to the group of 71 candidate partitions (14×14) and was also obtained from the combination C2M2. In general, this can be explained by the variations in the number of individuals 50≤C≤125, which confirms previous results, such as those of De Jong test functions [16].Figure3 shows the performance comparison among C1M1, C2M2, C2M2, and C2M2. Best fitness value versus generation number is plotted for all configurations. The experiment has been repeated 10 times to plot average values, using different maximum generation numbers. Because of space limitations, the plots for only the best QS1, QS2, CS1, and CS2 are given.Performance comparison among C1M1, C1M2, C2M1, and C2M2. Best fitness value versus generation number is plotted for three configurations.
(a)(b)(c)(d)Figure4 shows contour plots, where the best results for the three variables (i) populations size, (ii) candidate partitions, and (iii) fitness value, are shown. It can be observed that where M2 is used, better fitness values are obtained, and also lower numbers of individuals are required, which suggests better computational performance. Moreover, where the combination C2M2 was used, the best fitness values were obtained.Performance comparison among C1M1, C1M2, C2M1, and C2M2 for three configurations for the three variables (i) population size, (ii) candidate partitions, and (iii) fitness value.
(a)(b)(c)(d)Figure5 shows stacked graph views produced by our genetic algorithm. Figure 5(a) show the result of experiment 3 d), as applied to Figure 1, where the weights w1=w2=0.5 was used. Figure 5(b) and Figure 5(c) show the results of views with prefixes “C” and “F”, respectively.Stacked graph views produced by our genetic algorithm. (a) view showing 25 job occupation names starting with the prefix “A”. This view was produced using the weight parametersw1=w2=0:5, that is, free from overlapping, and the order of labels are correlated with the order of stripes. Similarly, using w1=1; w2=0, (b) corresponds to a view with the prefix “C”, and (c) to a view with the prefix “F”.
(a)(b)(c)


## 5. Usability Study

We conducted a usability study with 30 subjects to investigate the readability of labels using 9 views extracted from 3 different versions of the stacked graph visualization. Our goal here was to compare the performance of the three versions, all in terms of subject reading speeds, as well as subject accuracy.


### 5.1.  Subjects

Participants in this study were computer science students taking courses at our university and consisting of 23 undergraduate students and 7 graduate students with the average age of 22.17, ranging from 20 to 26 years old. All subjects were selected from a test on stacked graph usage using a questionnaire for visual tasks [17]. The scores obtained from the task were used to divide the subjects into three groups; where each group contains 4 subjects with high score, 3 with score average, and 3 with low score. To avoid bias from ordering effects, each subject group was tested using different version orderings.


### 5.2.  Material

The materials used were as follows.(I)
Three versions of the stacked graph visualization. One version (V1) with TLV = 12 (threshold for label visibility), another version (V2) with TLV = 0, and our proposed system (V3).(II)
Nine views obtained from the three aforementioned versions; three views from each version, from which the first group, view_a, corresponds to the views with prefix “A” Figure5(a), the second group, view_c, to the prefix “C” Figure 5(b), and the third group, view_f, to the prefix “F” Figure 5(c).(III)
Twenty five illegible labels for each prefix, with variations in their font size.


### 5.3. Design

The study was a 3 (stacked graph version) × 3 (version orderings) × 3 (view prefix) mixed-model design. The between-subject factor was version ordering (V1V2V3, V2V3V1, V3V1V2), and the within-subject factor was view prefix (view_a, view_c, view_f).


### 5.4. Procedure

We prepared a task involved in searching, using the features of the visualization system, for labels with different levels of legibility. Six labels, describing occupation names, were to be found using the mouse hovering feature of the stacked graph, where an information box was shown to the subjects while they were moving the mouse on the visualization area. For this experiment, subjects could see in the information box both the searched label and its corresponding population number; as shown in the views of Figure5. In the beginning, each participant was given a questionnaire containing the question “what is the population number for each of the following occupation names?” and six occupation names, sorted from easy to difficult in terms of legibility. Subjects had a limited time of one minute to write their answers.


### 5.5.  Results

A 3 (stacked graph version) × 3 (version ordering) × 3 (view prefix) mixed model analysis of variance was performed on the reading speed data and indicated significant main effects among stacked graph versions and view prefixes.Speed tests indicate that V1 and V2 required significantly more time to read than V3 (P<0.05). Similarly, subject error data indicated significant main effects among stacked graph versions. Accuracy tests indicated that more errors were committed with V1 and V2 than with V3 (P<0.05).A similar ANOVA of speed test indicated significant main effects among view prefixes when V2 is used (P<0.05), that is, with this version some views will require lower time to read, but with some views, longer time. Here, we hypothesize that subjects, on some views, were able to find answers even if labels were overlapped. On the other hand, the same test indicated that there are no significant differences among view prefixes when V1 and V3 are used (P<0.05). That is, if V1 is used, longer time will be required to find labels. If V3 is used, however, users will require significantly lower time to find them.Interestingly, a similar ANOVA of subject accuracy showed an equivalent result as those in the previous paragraph. Subject error data indicated significant main effects among view prefixes when V2 is used (P<0.05), that is, with this version, the accuracy of users in their findings will be moderately high only on some views. On the other hand, the same test indicated that there are no significant differences among view prefixes when V1 and V3 are used (P<0.05). That is, if V1 is used, the accuracy of users will always be low. If V3 is used, however, users will show significantly high accuracy. Figure 6 shows a comparison results of the conducted usability study.Comparison results of the conducted usability study with the three versions of the stacked graph visualization. Two different values for TLV (threshold for label visibility) are used in the three versions, as well as our proposed stacked graph with automatic label layout on unused space. The comparison among versions are shown for each view prefix.
(a)
Average time (in seconds) used to find labels(b)
Average number of assertions


## 5.1.  Subjects

Participants in this study were computer science students taking courses at our university and consisting of 23 undergraduate students and 7 graduate students with the average age of 22.17, ranging from 20 to 26 years old. All subjects were selected from a test on stacked graph usage using a questionnaire for visual tasks [17]. The scores obtained from the task were used to divide the subjects into three groups; where each group contains 4 subjects with high score, 3 with score average, and 3 with low score. To avoid bias from ordering effects, each subject group was tested using different version orderings.


## 5.2.  Material

The materials used were as follows.(I)
Three versions of the stacked graph visualization. One version (V1) with TLV = 12 (threshold for label visibility), another version (V2) with TLV = 0, and our proposed system (V3).(II)
Nine views obtained from the three aforementioned versions; three views from each version, from which the first group, view_a, corresponds to the views with prefix “A” Figure5(a), the second group, view_c, to the prefix “C” Figure 5(b), and the third group, view_f, to the prefix “F” Figure 5(c).(III)
Twenty five illegible labels for each prefix, with variations in their font size.


## 5.3. Design

The study was a 3 (stacked graph version) × 3 (version orderings) × 3 (view prefix) mixed-model design. The between-subject factor was version ordering (V1V2V3, V2V3V1, V3V1V2), and the within-subject factor was view prefix (view_a, view_c, view_f).


## 5.4. Procedure

We prepared a task involved in searching, using the features of the visualization system, for labels with different levels of legibility. Six labels, describing occupation names, were to be found using the mouse hovering feature of the stacked graph, where an information box was shown to the subjects while they were moving the mouse on the visualization area. For this experiment, subjects could see in the information box both the searched label and its corresponding population number; as shown in the views of Figure5. In the beginning, each participant was given a questionnaire containing the question “what is the population number for each of the following occupation names?” and six occupation names, sorted from easy to difficult in terms of legibility. Subjects had a limited time of one minute to write their answers.


## 5.5.  Results

A 3 (stacked graph version) × 3 (version ordering) × 3 (view prefix) mixed model analysis of variance was performed on the reading speed data and indicated significant main effects among stacked graph versions and view prefixes.Speed tests indicate that V1 and V2 required significantly more time to read than V3 (P<0.05). Similarly, subject error data indicated significant main effects among stacked graph versions. Accuracy tests indicated that more errors were committed with V1 and V2 than with V3 (P<0.05).A similar ANOVA of speed test indicated significant main effects among view prefixes when V2 is used (P<0.05), that is, with this version some views will require lower time to read, but with some views, longer time. Here, we hypothesize that subjects, on some views, were able to find answers even if labels were overlapped. On the other hand, the same test indicated that there are no significant differences among view prefixes when V1 and V3 are used (P<0.05). That is, if V1 is used, longer time will be required to find labels. If V3 is used, however, users will require significantly lower time to find them.Interestingly, a similar ANOVA of subject accuracy showed an equivalent result as those in the previous paragraph. Subject error data indicated significant main effects among view prefixes when V2 is used (P<0.05), that is, with this version, the accuracy of users in their findings will be moderately high only on some views. On the other hand, the same test indicated that there are no significant differences among view prefixes when V1 and V3 are used (P<0.05). That is, if V1 is used, the accuracy of users will always be low. If V3 is used, however, users will show significantly high accuracy. Figure 6 shows a comparison results of the conducted usability study.Comparison results of the conducted usability study with the three versions of the stacked graph visualization. Two different values for TLV (threshold for label visibility) are used in the three versions, as well as our proposed stacked graph with automatic label layout on unused space. The comparison among versions are shown for each view prefix.
(a)
Average time (in seconds) used to find labels(b)
Average number of assertions


## 6.  Conclusions

In this paper, we intended to highlight the stacked graph as an interesting object of study. We have suggested an evolutionary computation for label layout on the unused space, where a method for maximizing the display of labels is proposed. An important purpose is to improve the legibility of the stacked graph by revealing to the users more information for further analysis. We developed a genetic algorithm which computes two fitness functions, one for solving the overlapping problem, and the other for keeping order correlations among labels and their corresponding visual objects. Our algorithm was inspired by previous solutions for ordering and permutation problems. Here, however, we adjusted two standard genetic operators in order to solve a similar problem in the stacked graph.As for our usability study, our method proved to be successful. Our statistical analysis results, as well as our observations, showed that our stacked graph version outperformed the traditional ones. It is clear that solving the overlapping problem contributes to improve the legibility of the visualization, however, more investigation is needed to know how effective the correlation among labels and their visual objects are, as a semantic relationship, and useful for visual analysis tasks. For this, we believe that a different user experiment should be designed.



---

*Source: 139603-2012-03-21.xml*