# Multivariate Network Layout Using Force-Directed Method with Attribute Constraints
## 3 Methods
### Evaluation Metrics  
This paper proposes two evaluation metrics to measure the clarity and discrimination of the attribute community in the layout results from two aspects.  
The first metric is the _average distance between nodes in attribute communities_ (ADIAC). This metric can measure the degree of cohesion of the attribute community. On the one hand, the index reflects the clustering degree of nodes within the attribute community. The smaller its value is, the higher the distinguishable degree of the community is. On the other hand, when the ADIAC tends to 0, it means that nodes are stacked towards the community center, which will cause serious node overlap and make it difficult to show the connection relationship between nodes. The formula of ADIAC is as follows:  
\[\text{ADIAC}=\frac{1}{m}\sum_{k=1}^{m}\frac{1}{n_{k}}\sum_{i\
eq j\
eq i,j\in C _{k}}\sqrt{\left(x_{i}^{*}-x_{j}^{*}\right)^{2}+\left(y_{i}^{*}-y_{j}^{*} \right)^{2}} \tag{45}\]  
where \(m\) is the number of all communities under the constraint of the attribute, \(C_{k}\) is the \(k\)-th attribute community, \(n_{k}\) is the number of nodes in \(C_{k}\), \(i\) and \(j\) are two different nodes in \(C_{k}\), \(x_{i}^{*}\) is the abscissa of node \(i\) after maximum and minimum normalization, and \(y_{i}^{*}\) is the ordinate. The formula for maximum and minimum normalization is as follows:  
\[x^{*}=\frac{x-x_{min}}{x_{max}-x_{min}} \tag{46}\]  
where \(x\) is the abscissa of the node in the layout result, \(x_{min}\) is the minimum value of the abscissa of all points, \(x_{max}\) is the maximum value of the abscissa of all points, \(x^{*}\) is the result of maximum and minimum normalization. Through the maximum and minimum normalization, the error interference of the size of the layout area on the evaluation result can be eliminated.  
The second metric is the _average distance between attribute communities_ (ADBAC), which can measure the degree of distinguishability of attribute communities. The larger the distance between attribute communities, the greater the degree of distinction between attribute communities, and the layout results are presented more clearly. When the value of the metric tends to 0, it means that the different attribute communities are very close to each other. At this time, different attribute communities overlap with each other, and it is difficult to distinguish the existence of attribute communities from the layout results. The formula of ADBAC is as follows:  
\[\text{ADBAC}=\frac{2}{m(m-1)}\sum_{i=1}^{m}\sum_{j=i+1}^{m}\sqrt{\left(\bar{x}_{ i}-\bar{x}_{j}\right)^{2}+\left(\bar{y}_{i}-\bar{y}_{j}\right)^{2}} \tag{47}\]  
where \(i\) and \(j\) are the \(i\)-th and \(j\)-th attribute communities respectively, \(\bar{x}_{i}\) is the abscissa of the centroid of the \(i\)-th attribute community, \(\bar{x}_{j}\) is the ordinate. The formula of \(\left(\bar{x},\bar{y}\right)\) is as follows:  
\[\left(\bar{x},\bar{y}\right)=\frac{\sum_{i}(x_{i}^{*},y_{i}^{*})}{n} \tag{48}\]  
where \((x_{i}^{*},y_{i}^{*})\) is the coordinate of the \(i\)-th node after the maximum and minimum normalization in a certain attribute community, and \(n\) is the number of nodes in this attribute community.