# An Investigation into Healthcare-Data Patterns
## 3 Investigation Methodology
### Force Directed Visualisation Algorithm  
Force directed visualisation algorithms are regularly employed in a network visualisation setting. As such, the following visualisation algorithms are employed in this paper; ForceAtlas2 [24], Yifan Fu [25] and Fruchterman-Reingold [26]. Both are force directed placement algorithms allowing the display complex graph structures, by sorting and placing nodes into structured topologies satisfying several visual requirements such as even distribution, symmetry, non-overlapping edges and minimising distance between close nodes. ForceAtlas2, for example, is a force directed layout algorithm, simulating a physical system in order to specialise a network [24]. Nodes repulse one another and edges attract nodes, which ultimately creates a balanced state and allows for a visual representation of data structure. This enables data communities with denser relations to appear as groups of nodes. Yifan Fu is a graph drawing algorithm combining a multilevel approach, to overcome local minimums, and the Barnes-Hut octree technique, to approximate short and long-range forces [25]. Yifan Hu uses the repulsive forces on one node from a cluster of distant nodes. The algorithm uses a spring-electrical model to calculate both the attraction and repulsion forces to visually demonstrate the component nodes within a hospital network structure. The repulsive force is global and proportional to the inverse of the (physical) distance between vertices. The attractive force (the spring force) is only between neighboring vertices [25]. The effect of this is that one node may be attracted to two other nodes, but those nodes may be repelling each other. This leads to a stretching effect. The repulsion \(F_{r}\) formula is mathematically defined as:  
\[F_{r}=\frac{k}{d^{2}} \tag{1}\]  
Here, \(d\) represents the distance between the two nodes, while the attraction \(F_{a}\) formula is expressed as:  
\[F_{a}=-k\cdot d \tag{2}\]  
Typically, this multilevel approach has three levels as presented Algorithm 1 below;```
1) Coarsest Graph Layout, which is as modelled as follows: if(n(i+1)< MinSizeorm(i+1)/n1>p){ *xI: randominitiallyout *xI = ForceDirectedAlgorithm(Gl,xI,tol)  * returnxI}
2) The Coarsening Phase, calculated as outlined: \(\text{setuptherint}\times\text{n(i+1)}\text{prolongationmatrix}\text{P1}\) \(\text{G(i+1)}=\text{P(iT)}\text{GPI}\) \(\text{x(i+1)}=\text{MultilevelLayout(G(i+1),tol)}\) and 3) the Prolongation and Refinement Phase, where prolongation is employed to acquire initial layout: \(\text{xI}=\text{Ptx(i+1)}\) \(\text{refinement:xI}=\text{ForceDirectedAlgorithm(Gl,xI,tol)}\)
```

**Algorithm 1** [PERSON] Multilevel algorithm

The starting point is the original graph, \(G_{0}=G\) and \(n^{i}=\mid V^{i}\mid\) is the coefficient for the number of vertices in the \(i\)th level graph, represented as \(G^{i}\). \(x^{i}\) is defined as the coordinate vector for the vertices in \(V^{i}\). \(G^{i}\) is represented by a symmetric matrix \(G^{i}\), where all entries of the matrix act as the edge weights. \(G_{i+1}\) to \(G_{i}\) is the continuation operator, also represented by a matrix \(\text{P}^{i}\), of dimension \(n^{i}*n^{i+1}\). Fruchterman-Reingold is an algorithm which produces undirected graphs through distributing vertices evenly, making edge lengths uniform and reflecting symmetry [26]. Furthermore, the following two principles are adhered to. Firstly, that vertices connected by an edge should be drawn near each other, and secondly, that vertices should not be drawn too close to each other [26]. In addition to these criteria, the Fruchterman-Reingold algorithm adds even vertex distribution and treats vertices as atomic particles or celestial bodies, exerting attractive and repulsive force from one another [27]. In other words, the algorithm distributes vertices evenly, makes edge lengths uniform and reflects symmetry by placing spring-like attractive forces on each edge, and letting the system stabilise.