A Simple Visualization Method for Three-Dimensional (3D) Network
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.
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 , 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 . This algorithm draws aesthetic graphs using only the information of a given graph. Teja and Yemula  modified and improved the force-directed algorithm to solve the limitation of the algorithm. Another algorithm for drawing graphs is stress majorization , which is widely used. Recently, the authors in  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  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.  studied the interactions between proteins in 3D diagrams. These visualizations help users to understand the biological process and relationships easily. In , 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  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 , 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 , 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. Section 2 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 positions which minimize the following objective function:where is the normalized weight of the relationship between nodes and and is defined as if ; otherwise, . In addition, is the strength parameter that keeps and away from each other. For the simplicity, is assumed. The distance function for can be used as follows :where is a nonnegative constant, and then, . Let and be the maximum and minimum distances, respectively. Then, by the definition of the normalized weight, , and for a given value, the nonnegative constant is defined as follows:where is the minimum positive value of , i.e.,
For example, if and , then is obtained approximately as follows:
Figure 1 shows the distance function using given normalized weight and maximum distance values.
Let be the set of positions of given nodes at iteration . Figure 2 shows the effect of the first term of the objective function . There are two possible cases of forces at nodes and : repulsive force when and attractive force when .
The second term of the objective function produces the mutual repulsive forces between and , 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.
Then, we relocate the position of the node points aswhere is an artificial temporal step and is the differentiation of equation (1) with respect to , i.e.,
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.,for and for some . For example, let us consider four points , , , and . Furthermore, assume that the weighting matrix between and is given as
Let the matrix be redefined by dividing all the elements of by the largest value among the elements of the given . That is,
We take and get because :
Let , , , and be the initial positions of four nodes, where the superscript 0 denotes the starting index. We use , , and . 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 . Note that the values of each element of 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 , and . Using net force vectors, we update the positions of nodes as follows:
Figure 4(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 nodes and the thickness of edges according to the weight of each node as follows:where and 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, let of the characters to make the weighting matrix , which is provided in Appendix. Each element of means the cumulative number of dialogues between characters and . The parameters are given as , , , and . Then, 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 6 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 decreases, as shown in Figure 7.
As a second example, let of the characters to set the weighting matrix 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 and , and then, the value of is about 0.3652. In addition, time step and 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 9 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 decreases and converges during the process of finding the optimal position for all nodes. Figure 10 depicts the decreasing of the objective function.
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.
In this appendix, we provide the MATLAB source codes of the proposed algorithm for novel data as “The Merchant of Venice” and “Romeo and Juliet,” and Table 1 describes each character name and corresponding node number. The source code is available on the following website: http://elie.Korea.ac.kr/∼cfdkim/codes/.
Here, the weights of each novel data were presented as and in the source code.
clear; flag = 1; if flag = = 1 = ; else if flag = = 2 = ; end = W/max (max(W)); minW = min(min(W(W > 0))); N = size(W,1); lbD = 1; ubD = 5; q = −log (ubD)/log(minW); rand(“seed”,3773); t1 = rand(N,1); t2 = rand(N,1); xy = ubD [sin(pi t1) cos (2 pi t2), sin (pi t1) sin (2 pi t2), cos (pi t1)]; for i = 1:N for j = 1:N if W(i, j) > 0 d (i, j) = 1/W(i, j)^q; end end end dt = 0.2; gam = 0.01; tol = 0.001; error = 2tol; n = 0; while error ≥ tol n = n + 1; F = zeros(N, 3); for i = 1 : N for j = i + 1 : N if W(i, j) > 0 vt = xy (i, :)-xy (j, :); F (i, :) = F(i, :) - (norm(vt)-d(i, j)) vt/norm (vt); F (j, :) = F(j, :) + (norm(vt)-d(i, j)) vt/norm (vt); end end end for i = 1:N for j = 1:N if j∼ = i vt = xy (i, :)-xy(j, :); F(i, :) = F(i, :) + gamvt/norm(vt); end end end xy = xy + dtF; error = norm(dtF)/sqrt(N); if mod(n, 30) = = 0 \Vert error < tol DrawNetwork(xy, W); pause(0.1) end end function DrawNetwork(xy,W) n = 20; x = linspace(−1.1, 1.1, n); y = x; z = x; [xx, yy, zz] = meshgrid(x, y, z); u(1:n, 1:n, 1:n) = 0; for i = 1:n for j = 1:n for k = 1:n u(i, j, k) = 1-sqrt(x(i)^2y(j)^2z(k)^2); end end end N = length (xy); clf; for i = 1 : N s = 0.2sum (W(i,:))^0.5 + 0.1; isosurface (sxx + xy(i,1),syy + xy(i,2),szz + xy(i,3),u,0); hold on end camlight; lighting phong; for i = 1:N for j = i+1:N if W(i, j) > 0.4 plot3 (xy ([i, j], 1), xy ([i, j], 2), xy ([i, j], 3), “r”, “linewidth,” 15W (i, j)^2 + 1); elseif W (i, j) > 0 plot3 (xy ([i, j], 1), xy ([i, j], 2), xy ([i, j], 3), “b”, “linewidth”, 15W(i, j)^2 + 1); end end end for i = 1:N s = 0.2sum (W(i , :))^0.5 + 0.4; a = 0.15; b = 0; text (xy(i, 1)-a,xy(i, 2)-b, xy (i, 3) + s, num2str (i), “fontsize,”10); end axis off; axis image; end
We have released the code and data of this paper in the Appendix and the corresponding author’s homepage.
Conflicts of Interest
The authors declare that they have no conflicts of interest.
The corresponding author (J.S. Kim) expresses thanks for the support from the BK21 FOUR Program.
S. Marcus, M. Moy, and T. Coffman, “Social network analysis,” Mining Graph Data, pp. 443–467, 2007.View at: Google Scholar
Z. Sabir, M. A. Z. Raja, H. A. Wahab, G. C. Altamirano, Y.-D. Zhang, and D.-N. Le, “Integrated intelligence of neuro-evolution with sequential quadratic programming for second-order Lane-Emden pantograph models,” Mathematics and Computers in Simulation, vol. 188, pp. 87–101, 2021.View at: Publisher Site | Google Scholar
P. Eades, “A heuristic for graph drawing,” Congruent Number, vol. 42, pp. 149–160, 1984.View at: Google Scholar
S. C. Teja and P. K. Yemula, “Power network layout generation using force directed graph technique,” in Proceedings of the 2014 Eighteenth National Power Systems Conference (NPSC) IEEE, pp. 1–6, Guwahati, India, 2014.View at: Google Scholar
E. R. Gansner, Y. Koren, and S. North, “Graph drawing by stress majorization,” in Proceedings of the International Symposium on Graph Drawing, pp. 239–250, New York, NY, USA, 2004.View at: Google Scholar
Y. Wang, Y. Wang, Y. Sun et al., “Revisiting stress majorization as a unified framework for interactive constrained graph visualization,” IEEE Transactions on Visualization and Computer Graphics, vol. 24, no. 1, pp. 489–499, 2017.View at: Google Scholar
A. Dekker, “Visualisation of social networks using CAVALIER,” ACM, vol. 16, pp. 49–55, 2001.View at: Google Scholar
E. Ilhan and I. O. Kıymaz, “A generalization of truncated M-fractional derivative and applications to fractional differential equations,” Applied Mathematics and Nonlinear Sciences, vol. 5, no. 1, pp. 171–188, 2020.View at: Google Scholar
E. I. Eskitasçıoglu, M. B. Aktas, and H. M. Baskonus, “New complex and hyperbolic forms for Ablowitz–Kaup–Newell–Segur wave equation with fourth order,” Applied Mathematics and Nonlinear Sciences, vol. 4, no. 1, pp. 105–112, 2019.View at: Google Scholar
H. Duru, O. Tasbozan, and A. K. de Griñó, “New analytical solutions of conformable time fractional bad and good modified Boussinesq equations,” Applied Mathematics and Nonlinear Sciences, vol. 5, no. 1, pp. 447–454, 2020.View at: Google Scholar
H. Duru, A. Kurt, and O. Tasbozan, “New travelling wave solutions for KdV6 equation using sub equation method,” Applied Mathematics and Nonlinear Sciences, vol. 5, no. 1, pp. 455–460, 2020.View at: Google Scholar