# Similarity-Driven Edge Bundling: Data-Oriented Clutter Reduction in Graphs Layouts
## 3 Similarity-Driven Edge Bundling (SDEB)
### Graph Drawing
#### 3.2.2 Edge Bending  
The second task for drawing a graph is to bend the edges to create the bundles. In this process, for each edge \(e_{ij}\) in \(G\) we first search for the path \(p_{ij}=\{v_{i},v^{\prime}_{1},v^{\prime}_{2},\ldots,v_{j}\}\) in the _backbone_ that connects \(v_{i}\) and \(v_{j}\). Then, we bend \(e_{ij}\) towards \(p_{ij}\) considering its vertices as control points of a \(B\)-Spline curve.  
We apply filtering strategies to remove control points (intermediate vertices) to improve the visual representation and curvature of the resulting bundles. To perform this, the function \(\Phi(v^{\prime}_{k})\) determines if an intermediate vertex \(v^{\prime}_{k}\) should be used as a control point or not. The edge is then curved towards the path \(p^{\prime}_{ij}=\{v_{i},\ v^{\prime}_{k}\in I\ |\ \Phi(v^{\prime}_{k})\,v_{j}\}\subset p_{ij}\), in which \(I\) is the set of intermediate vertices in the path \(p_{ij}\). \(\Phi(v^{\prime}_{k})\) is defined as  
\[\Phi(v^{\prime}_{k})=\begin{cases}\text{{true}}&\text{if }\phi_{L}\leq L_{v^{ \prime}_{k}}\leq\phi_{U};\\ \text{{false}}&\text{otherwise}.\end{cases} \tag{3}\]  
where \(L_{v^{\prime}_{k}}\) is the level (considering the _backbone_ hierarchy) of each intermediate vertex \(v^{\prime}_{k}\), for instance, \(L_{v_{\text{{root}}}}=1\) since it is defined in the first STree algorithm iteration.  
This filtering avoids bundling edges towards less significant intermediate vertices (\(\phi_{L}\)), that is, vertices that most (or all) data vertices are connected to, for instance, the root and the vertices in its vicinity (the intermediate vertices created in the first splittings). On the other hand, intermediate vertices close to data vertices are more significant (\(\phi_{U}\)) because they aggregate few edges. Setting this boundary affects the level of clutter reduction and allows users to create multiple graph views.  
After filtering the control points, the edges' curvatures are controlled by moving the control points towards the straight lines connecting \(v_{i}\) and \(v_{j}\). This process is similar to the approach presented in [11]. However, instead of utilizing a constant value to control all edges' curvatures, values are calculated for each edge based on their path in the _backbone_. Given the position \(\hat{v}_{k}\) of the vertex \(v_{k}\in p_{ij}\), its transformed position is calculated as  
\[\hat{v}_{k}=f(p_{ij})\hat{v}_{k}+(1-f(p_{ij}))(\hat{v}_{i}+\frac{k}{|p_{ij}|}( \hat{v}_{j}-\hat{v}_{i})) \tag{4}\]  
where, \(\hat{v}_{i}\) and \(\hat{v}_{j}\) are the positions of the edge \(e_{ij}\) ending points, \(k\) is the index of \(v_{k}\) in \(p_{ij}\), and \(f(p_{ij})\) is a function that controls the bending defined as  
\[f(p_{ij})=\frac{\beta-\gamma}{1+e^{\frac{\alpha-d(\hat{v}_{i},\hat{v}_{j})}{ 00}}}+\gamma \tag{5}\]  
where, \(\Delta\) is the minimum size for edges to be bundled, \(\beta\) is the strength of curvature for bundled edges and \(\gamma\) is the strength of curvature for unbundled edges. In addition, \(d(\hat{v}_{i},\hat{v}_{j})\) is the original edge length (Euclidean distance in the visual space). Usually, \(\beta\) is set with a value close to 1, while \(\gamma\) is set with a value close to 0. Basically, this manipulation creates a function with a hard-step that works as an activation function. This function considers the size of each edge and determines if it should be placed in a bundle or drawn as a straight line. There is no definition for the best values of \(\alpha\) and \(\beta\), indeed they are parameters that users can change interactively.