Compare commits
1 Commits
Submission
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4acdcdae4 |
@@ -169,16 +169,16 @@ The rest of this chapter will describes each of the algorithm and performance me
|
|||||||
\label{sec:linkbg}
|
\label{sec:linkbg}
|
||||||
D3 library, which will be described in section \ref{sec:des_d3}, have several different force models implemented for creating a force-directed graph. One of them is Link Force. In this brute-force method, a force is applied between the two nodes at the end of each link. The force pushes the nodes together or apart with varying strength, proportional to the error between the desired and current distance on the graph. Essentially, is the spring model with a custom spring-force calculation formula. An example of a graph produced by the D3 link force is shown in figure \ref{fig:bg_linkForce}. In MDS where the high-dimensional distance between every pair of nodes can be calculated, a link will be created to represent each pair, resulting in a complete graph.
|
D3 library, which will be described in section \ref{sec:des_d3}, have several different force models implemented for creating a force-directed graph. One of them is Link Force. In this brute-force method, a force is applied between the two nodes at the end of each link. The force pushes the nodes together or apart with varying strength, proportional to the error between the desired and current distance on the graph. Essentially, is the spring model with a custom spring-force calculation formula. An example of a graph produced by the D3 link force is shown in figure \ref{fig:bg_linkForce}. In MDS where the high-dimensional distance between every pair of nodes can be calculated, a link will be created to represent each pair, resulting in a complete graph.
|
||||||
|
|
||||||
\begin{figure}[h]
|
The Link Force algorithm is inefficient. In each time step (iteration), a calculation has to be done for each pair of nodes connected with a link. This means that for MDS with $N$ nodes, the algorithm will have to perform $N(N-1)$ force calculations per iteration, essentially $O(N^2)$. It is also believed that the number of iterations required to create a good layout is proportional to the size of the data set, hence the total time complexity of $O(N^3)$.
|
||||||
|
The model also cache the desired distance of each link in memory to improve speed across multiple iterations. While this greatly reduces the number of calls to the distance-calculating function, the memory complexity also increases to $O(N^2)$. Because JavaScript memory heap is limited, it runs out of memory when trying to process a complete graph of more than around three thousands points, depending on the features of the data.
|
||||||
|
|
||||||
|
\begin{figure}[ht]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[height=9.2cm]{d3-samples/d3-force.png}
|
\includegraphics[height=9.2cm]{d3-samples/d3-force.png}
|
||||||
\caption{An example of a graph produced by D3 Link Force.}
|
\caption{An example of a graph produced by D3 Link Force.}
|
||||||
\label{fig:bg_linkForce}
|
\label{fig:bg_linkForce}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
The Link Force algorithm is inefficient. In each time step (iteration), a calculation has to be done for each pair of nodes connected with a link. This means that for MDS with $N$ nodes, the algorithm will have to perform $N(N-1)$ force calculations per iteration, essentially $O(N^2)$. It is also believed that the number of iterations required to create a good layout is proportional to the size of the data set, hence the total time complexity of $O(N^3)$.
|
|
||||||
The model also cache the desired distance of each link in memory to improve speed across multiple iterations. While this greatly reduces the number of calls to the distance-calculating function, the memory complexity also increases to $O(N^2)$. Because JavaScript memory heap is limited, it runs out of memory when trying to process a complete graph of more than around three thousands data points, depending on the features of the data.
|
|
||||||
|
|
||||||
\section{Chalmers' 1996 algorithm}
|
\section{Chalmers' 1996 algorithm}
|
||||||
In 1996, Matthew Chalmers proposed a technique to reduce the time complexity down to $O(N^2)$, which is a massive improvement over link force's $O(N^3)$, potentially at the cost of accuracy. This is done by reducing the number of spring force calculations per iterations, using random samples\cite{Algo1996}.
|
In 1996, Matthew Chalmers proposed a technique to reduce the time complexity down to $O(N^2)$, which is a massive improvement over link force's $O(N^3)$, potentially at the cost of accuracy. This is done by reducing the number of spring force calculations per iterations, using random samples\cite{Algo1996}.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user