# A Simple Visualization Method for Three-Dimensional (3D) Network

Authors: Sangkwon Kim; Chaeyoung Lee; Jintae Park; Sungha Yoon; Yongho Choi; Junseok Kim
Journal: Discrete Dynamics in Nature and Society
 (2021)

---

## Abstract

The network is a concept that can be seen a lot in many areas of research. It is used to describe and interpret datasets in various fields such as social network, biological network, and metabolic regulation network. As a result, network diagrams appeared in various forms, and methods for visualizing the network information are being developed. In this article, we present a simple method with a weight of information data to visualize the network diagram for the three-dimensional (3D) network. The generic method of network visualization is a circular representation with many intersections. When dealing with a lot of data, the three-dimensional network graphics, which can be rotated, are easier to analyze than the two-dimensional (2D) network. The proposed algorithm focuses on visualizing three factors: the position and size of the nodes and the thickness of the edge between linked nodes. In the proposed method, an objective function is defined, which consists of two parts to locate the nodes: (i) a constraint for given distance, which is the weight of the relationship among all the data, and (ii) the mutual repulsive force among the given nodes. We apply the gradient descent method to minimize the objective function. The size of the nodes and the thickness of the edges are defined by using the weight of each node and the weight between other nodes associated with it, respectively. To demonstrate the performance of the proposed algorithm, the relationships of the characters in the two novels are visualized using 3D network diagram.


---

## Body

## 1. Introduction

The network is a vital concept to understand modern society structure and components of the society. The concept of the network has been applied not only to people but also to social network [1–7], biological network [8–12], metabolic regulation network [13], online social network [14, 15], sports social network [16, 17], structure of neural network [18–20], etc. As a result, the data for storing network information has become complex and diverse. In addition, the need to make complex data more recognizable has been essential, and efforts to meet such demands continue to this day. Therefore, a medium called a network diagram has emerged, which has become essential to understand network information. Network diagrams have appeared in various forms in two-dimensional (2D) and three-dimensional (3D) space. In addition, various methods and programs for drawing such diagrams or visualizing network information have appeared and developed.In 2D space, the classical algorithm to draw the network automatically is the force-directed algorithm using the straight edges as springs [21]. This algorithm draws aesthetic graphs using only the information of a given graph. Teja and Yemula [22] modified and improved the force-directed algorithm to solve the limitation of the algorithm. Another algorithm for drawing graphs is stress majorization [23], which is widely used. Recently, the authors in [24] proposed an improved stress majorization method. Moreover, this method has an advantage that there is no need to solve the optimization problem with constraints. However, it is not easy to grasp the network in 2D space, and there are needs for the network plot in 3D space.There are various tools and techniques for network visualization in 3D space. The author in [25] used a Java-based tool called CAVALIER (Communication and Activity VisuALIsation for the EnterRprise) to analyze the social network. In addition, the spring-embedding and alternative layout algorithm was introduced for network visualization. Ho et al. [26] studied the interactions between proteins in 3D diagrams. These visualizations help users to understand the biological process and relationships easily. In [27], the authors proposed a novel visualization tool named Arena3D that could address large scale and complex networks. They demonstrated the utility of Arena3D using network data relevant to Huntington disease. Paananen and Wong [28] presented a new visualization method based on real-time 3D force-directed graphs that can be used to discover new knowledge in the data. They also created and used a software tool which is called FORG3D. By using the given genomic data, they proved the functionality of FORG3D to visualize and explore unified genome-scale data. In [29], the authors developed the evidence network visualization algorithm with the exploration of covariate distribution for network meta-analysis (NMA) in 3D. This algorithm extended the z-axis to the generic 2D network to display the covariate bars for each trial, placing the covariate bars for each information data at the edge between the nodes involved.In this article, we present a simple method with weight of information data to visualize the network diagram for 3D, and the rotatable 3D network diagram can be obtained to analyze data more easily. While the proposed method is an extension of the method applied in 2D [30], it is further improved in terms of the simplicity of the algorithm. In general, the problem is solved in a regular structure [31–36]; however, we visualized the network using the importance of information and concept of distance in the unstructured place. Furthermore, the position of nodes is relocated by minimizing an objective function which consists of repulsive and attractive energies. The gradient descent method is applied to minimize the objective function. Therefore, an optimal network diagram to the given data is obtained. The proposed method has advantages over other methods for visualizing networks in terms of simplicity.The composition of this paper consists of the following order. Section2 describes the proposed algorithm in detail. In Section 3, to demonstrate the performance of the proposed algorithm, 3D network diagram visualizations of the relationship of characters in two novels are presented. Finally, conclusions are made in Section 4.


## 2. Numerical Algorithm

### 2.1. Simple Network Visualization Algorithm

The purpose of the proposed algorithm for network visualization in 3D is to find optimal node positionsX=X1,X2,…,XN which minimize the following objective function:(1)EX=12∑i<jNΨwijXi−Xj−dij2−γ∑i<jNXi−Xj,where wij is the normalized weight of the relationship between nodes Xi and Xj and Ψw is defined as Ψw=1 if w>0; otherwise, Ψw=0. In addition, γ is the strength parameter that keeps Xi and Xj away from each other. For the simplicity, 0≤wij≤1 is assumed. The distance function dij for wij can be used as follows [30]:(2)dij=dwij=1wijq,forwij>0,where q is a nonnegative constant, and then, dij≥1. Let Dmax and Dmin be the maximum and minimum distances, respectively. Then, by the definition of the normalized weight, Dmin=1, and for a given Dmax value, the nonnegative constant q is defined as follows:(3)q=−lnDmaxlnminW,where minW is the minimum positive value of wij, i.e.,(4)minW=min1≤i,j≤Nwij>0wij.For example, ifminW=0.5 and Dmax=3, then q is obtained approximately as follows:(5)q=−ln3ln0.5≈1.5850.Figure1 shows the distance function dij using given normalized weight wij and maximum distance Dmax values.Figure 1
Illustration of distance functiondij using the normalized weighting value wij of the relationship between nodes Xi and Xj. Here, q=−lnDmax/lnminW.LetX1n,X2n,…,XNn be the set of positions of given nodes at iteration n. Figure 2 shows the effect of the first term of the objective function E. There are two possible cases of forces at nodes Xin and Xjn: repulsive force when Xin−Xjn<dij and attractive force when Xin−Xjn>dij.Figure 2
Two possible forces at nodesXin and Xjn: (a) repulsive force when Xin−Xjn<dij and (b) attractive force Xin−Xjn<dij for the given dij value.
(a)(b)The second term of the objective functionE produces the mutual repulsive forces between Xin and Xjn, see Figure 3. The effect of this force places nodes with low weight outward in the network. In other words, nodes with small weights are positioned outside the main network diagram.Figure 3
Mutual repulsive force among nodes: (a) initial state, (b) middle state, and (c) equilibrium state.
(a)(b)(c)Then, we relocate the position of the node points as(6)Xin+1=Xin−Δt∂Ε∂XiXn,for1≤i≤N,where Δt is an artificial temporal step and ∂E/∂Xi is the differentiation of equation (1) with respect to Xi, i.e.,(7)∂E∂XiXn=∑j=1NΨwijXin−Xjn−dijXin−XjnXin−Xjn−γ∑j=1NXin−XjnXin−Xjn.Once the positions of the nodes are renewed, then the network diagram is plotted automatically. The iterative process will be terminated if the process reaches an equilibrium state, i.e.,(8)Xn+1−Xn2<tol,for n≥Nt and for some Nt. For example, let us consider four points X1, X2, X3, and X4. Furthermore, assume that the weighting matrix W between Xi and Xj is given as(9)W=0231202132011110.Let the matrixW be redefined by dividing all the elements of W by the largest value among the elements of the given W. That is,(10)W=02311323023131230131313130.We takeDmax=4 and get q=1.2619 because minW=1/3:(11)d12d13d13d21d23d13d31d32d13d41d42d43=1.671.04.01.671.674.01.01.674.04.04.04.0.LetX10=0,0,0, X20=1,0,0, X30=0,1,0, and X40=0,0,1 be the initial positions of four nodes, where the superscript 0 denotes the starting index. We use Δt=0.2, γ=0.01, and tol=0.001. In Figure 4, the node markers and edges are depicted by sphere and gray lines, respectively. Here, the red and blue spheres mean initial and after 1 iteration positions, respectively. Figure 4(a) shows the initial state consisting of four points with red spheres and gray edges of linked nodes using scaled W. Note that the values of each element of W are represented by the thickness of connecting lines in the diagram. In Figure 4(b), black arrows indicate the force direction acting on each node. The red arrows in Figure 4(c) are net force vectors F10,F20,F30, and F40. Using net force vectors, we update the positions of nodes as follows:(12)Xi1=Xi0+ΔtFi0,fori=1,2,3,and4.Figure 4
Schematic illustration of the proposed algorithm. (a) Initial state of four nodes. (b) Direction of forces acting on each node. (c) Net force direction of each point. (d) Position of four nodes after 1 iteration using the proposed method. Here, the normalized weight matrixW in equation (10) is used.
(a)(b)(c)(d)Figure4(d) shows the network diagrams after 1 iteration. The nodes are initially located in a tetrahedron, and the network diagram is drawn according to the given weights.So far we have only considered the positions of nodes, now we discuss the visualization of nodes and edges. In general, nodes and edges are visualized as unit sphere shape and straight lines with a fixed thickness. We visualize the size of the nodesSi and the thickness of edges Tij according to the weight W of each node as follows:(13)Si=s∑j=1Nwij,Tij=twij2+Ψwij,where s and t are positive constants. Characters with relatively high activity are indicated by larger nodes; meanwhile, relatively intimate relationships are depicted by thicker edges.


## 2.1. Simple Network Visualization Algorithm

The purpose of the proposed algorithm for network visualization in 3D is to find optimal node positionsX=X1,X2,…,XN which minimize the following objective function:(1)EX=12∑i<jNΨwijXi−Xj−dij2−γ∑i<jNXi−Xj,where wij is the normalized weight of the relationship between nodes Xi and Xj and Ψw is defined as Ψw=1 if w>0; otherwise, Ψw=0. In addition, γ is the strength parameter that keeps Xi and Xj away from each other. For the simplicity, 0≤wij≤1 is assumed. The distance function dij for wij can be used as follows [30]:(2)dij=dwij=1wijq,forwij>0,where q is a nonnegative constant, and then, dij≥1. Let Dmax and Dmin be the maximum and minimum distances, respectively. Then, by the definition of the normalized weight, Dmin=1, and for a given Dmax value, the nonnegative constant q is defined as follows:(3)q=−lnDmaxlnminW,where minW is the minimum positive value of wij, i.e.,(4)minW=min1≤i,j≤Nwij>0wij.For example, ifminW=0.5 and Dmax=3, then q is obtained approximately as follows:(5)q=−ln3ln0.5≈1.5850.Figure1 shows the distance function dij using given normalized weight wij and maximum distance Dmax values.Figure 1
Illustration of distance functiondij using the normalized weighting value wij of the relationship between nodes Xi and Xj. Here, q=−lnDmax/lnminW.LetX1n,X2n,…,XNn be the set of positions of given nodes at iteration n. Figure 2 shows the effect of the first term of the objective function E. There are two possible cases of forces at nodes Xin and Xjn: repulsive force when Xin−Xjn<dij and attractive force when Xin−Xjn>dij.Figure 2
Two possible forces at nodesXin and Xjn: (a) repulsive force when Xin−Xjn<dij and (b) attractive force Xin−Xjn<dij for the given dij value.
(a)(b)The second term of the objective functionE produces the mutual repulsive forces between Xin and Xjn, see Figure 3. The effect of this force places nodes with low weight outward in the network. In other words, nodes with small weights are positioned outside the main network diagram.Figure 3
Mutual repulsive force among nodes: (a) initial state, (b) middle state, and (c) equilibrium state.
(a)(b)(c)Then, we relocate the position of the node points as(6)Xin+1=Xin−Δt∂Ε∂XiXn,for1≤i≤N,where Δt is an artificial temporal step and ∂E/∂Xi is the differentiation of equation (1) with respect to Xi, i.e.,(7)∂E∂XiXn=∑j=1NΨwijXin−Xjn−dijXin−XjnXin−Xjn−γ∑j=1NXin−XjnXin−Xjn.Once the positions of the nodes are renewed, then the network diagram is plotted automatically. The iterative process will be terminated if the process reaches an equilibrium state, i.e.,(8)Xn+1−Xn2<tol,for n≥Nt and for some Nt. For example, let us consider four points X1, X2, X3, and X4. Furthermore, assume that the weighting matrix W between Xi and Xj is given as(9)W=0231202132011110.Let the matrixW be redefined by dividing all the elements of W by the largest value among the elements of the given W. That is,(10)W=02311323023131230131313130.We takeDmax=4 and get q=1.2619 because minW=1/3:(11)d12d13d13d21d23d13d31d32d13d41d42d43=1.671.04.01.671.674.01.01.674.04.04.04.0.LetX10=0,0,0, X20=1,0,0, X30=0,1,0, and X40=0,0,1 be the initial positions of four nodes, where the superscript 0 denotes the starting index. We use Δt=0.2, γ=0.01, and tol=0.001. In Figure 4, the node markers and edges are depicted by sphere and gray lines, respectively. Here, the red and blue spheres mean initial and after 1 iteration positions, respectively. Figure 4(a) shows the initial state consisting of four points with red spheres and gray edges of linked nodes using scaled W. Note that the values of each element of W are represented by the thickness of connecting lines in the diagram. In Figure 4(b), black arrows indicate the force direction acting on each node. The red arrows in Figure 4(c) are net force vectors F10,F20,F30, and F40. Using net force vectors, we update the positions of nodes as follows:(12)Xi1=Xi0+ΔtFi0,fori=1,2,3,and4.Figure 4
Schematic illustration of the proposed algorithm. (a) Initial state of four nodes. (b) Direction of forces acting on each node. (c) Net force direction of each point. (d) Position of four nodes after 1 iteration using the proposed method. Here, the normalized weight matrixW in equation (10) is used.
(a)(b)(c)(d)Figure4(d) shows the network diagrams after 1 iteration. The nodes are initially located in a tetrahedron, and the network diagram is drawn according to the given weights.So far we have only considered the positions of nodes, now we discuss the visualization of nodes and edges. In general, nodes and edges are visualized as unit sphere shape and straight lines with a fixed thickness. We visualize the size of the nodesSi and the thickness of edges Tij according to the weight W of each node as follows:(13)Si=s∑j=1Nwij,Tij=twij2+Ψwij,where s and t are positive constants. Characters with relatively high activity are indicated by larger nodes; meanwhile, relatively intimate relationships are depicted by thicker edges.


## 3. Numerical Results

Numerical simulations are conducted to demonstrate the performance of the proposed algorithm and to visualize the relationship examples of characters in two novels in the 3D network diagram. The first example is “The Venice Merchant” and the second example is “Romeo and Juliet,” which are William Shakespeare’s representative plays. The elements of the weighting matrix are set based on the number of conversations between the characters in each novel.In the first novel, letN=19 of the characters to make the weighting matrix W, which is provided in Appendix. Each element wij of W means the cumulative number of dialogues between characters Xi and Xj. The parameters are given as Δt=0.2, γ=0.01, Dmax=5, and tol=0.001. Then, q≈0.4363 is obtained. As shown in Figure 5, the motion of nodes and edges can be observed from the initial state where the nodes are randomly located until the optimal network diagram is found by applying the proposed algorithm repeatedly. The proposed algorithm for “The Venice Merchant” data reached the equilibrium state at 828 iterations.Figure 5
Snapshots of the process applying the proposed algorithm for “The Venice Merchant.” (a) Initial state of 19 nodes atn=0. (b) Intermediate state of nodes at n=10. (c) Intermediate state of nodes at n=400. (d) Equilibrium state of nodes at n=828.
(a)(b)(c)(d)Figure6 shows a diagram of the network in the equilibrium of the iterative algorithm for “The Venice Merchant” dataset. The equilibrium state means that all nodes are properly located according to the weights of a given network. Assortativity refers to the tendency of nodes in a network being connected with similar sized nodes. Therefore, highly assortativity networks are clearly shown to have a core periphery structure between nodes with large and small sizes. These characteristics mean that the basic structure of the interaction that makes up the story of the novel is centered on the main characters. Figure 6, therefore, shows that “The Venice Merchant” has a high assortativity, that is, a novel property that revolves around the main character. As the nodes move, we can confirm that the objective function E decreases, as shown in Figure 7.Figure 6
Magnified network plot of the equilibrium state from another directional view for “The Venice Merchant.” Large-sized nodes are linked together with thicker lines, and small-sized nodes are linked with thinner lines and located around the large-sized nodes.Figure 7
Temporal evolution of the objective functionE with respect to the iteration of the algorithm for “The Venice Merchant” case.As a second example, letN=26 of the characters to set the weighting matrix W which is based on the number of conversations between 26 characters in “Romeo and Juliet.” This data is provided in Appendix. The parameters are given as Dmax=5 and tol=0.001, and then, the value of q is about 0.3652. In addition, time step Δt=0.2 and γ=0.01 are used. Figure 8 shows the process of finding the optimal network plot by applying the proposed algorithm. The proposed algorithm for “Romeo and Juliet” data reached the equilibrium state at 617 iterations.Figure 8
Snapshots of the process applying the proposed algorithm for “Romeo and Juliet.” (a) Initial state of 26 nodes atn=0. (b) Intermediate state of nodes at n=25. (c) Intermediate state of nodes at n=310. (d) Equilibrium state of nodes at n=617.
(a)(b)(c)(d)Figure9 shows the network plot of the equilibrium state of the iterative algorithm for the “Romeo and Juliet” dataset. From the results, we can quickly and easily grasp the relationship among characters and see the high assortativity. Furthermore, we can confirm that the objective function E decreases and converges during the process of finding the optimal position for all nodes. Figure 10 depicts the decreasing of the objective function.Figure 9
Magnified network plot of the equilibrium state from another directional view for “Romeo and Juliet.” Large-sized nodes are linked together with thicker lines, and small-sized nodes are linked with thinner lines and located around the large-sized nodes.Figure 10
Temporal evolution of the objective functionE with respect to the iteration of the algorithm for the “Romeo and Juliet” case.


## 4. Conclusion

We proposed a simple method for 3D network diagrams in this article. The proposed method had the advantage of being drawn only with information from a given network. We used the distance function based on the network information and objective function. To minimize the proposed objective function, we used the gradient descent method and confirmed the energy dissipation. According to the given relationship, the network diagrams own various characteristics: (i) different sizes of nodes and (ii) different thickness of edges. Through specific examples, we have known that these features help us to grasp network information at a glance. Furthermore, our algorithm is simple to understand and implement. Finally, the MATLAB source code of our algorithm is provided for the interested readers to try.Social distancing and contact tracing can contribute to curbing the spread of the COVID-19 virus. Research on SARS-COV-2 transmission control strategies in actual social networks using GPS or mobile data is actively being conducted. In future works, we plan to use the proposed algorithm to present a contact network diagram. Using this diagram, we can visualize the contact network for the dynamics of the COVID-19 spreading.



---

*Source: 1426212-2021-05-27.xml*