# FORCE DIRECTED NETWORK (SPRING ALGORITHM) GRAPH VIEWER

The objective of this project is to visualize a network (large networks of >2000 nodes) in a way that the distance of a node from the rest of the network is determined by the number of nodes it is connected to => the more neighbors a node has the larger is its distance from the network. The component must allow zooming in/out, selection by the number of neighbors, coloring by various thresholds and other graph-related features.

## Introduction

Force Directed Network is obtained by using the Force-directed graph drawing algorithms(SPRING ALGORITHM). This algorithm is mainly based on the forces assigned among the set of nodes and edges of a graph.The forces can be either atractive which is used to attract pairs of endpoints of the graph's edges towards each other or repulsive which is used to seperate all pairs of nodes.In equilibrium states for this system of forces,the edges tend to have uniform length(using spring forces) and the nodes which are not connected by any edge tend to be drawn further apart(due to electrical repulsion).

## Mockups

### Functionality

• Zoom in and Zoom out of the graph.
• Distance of a node from the rest of the network is determined by the number of nodes it is connected to.
• Selection by the number of neighbors
• Coloring by various thresholds
• Dividing the whole network into module based on the modularity.
• Applying filters.
• Defining the layout of your choice.
• Exporting the visualisation as an image.

### Features

• Import from Text format
• Export to image
• Visualization Using FORCE DIRECTED NETWORK

## Application Design

• Fancy Libraries
• d3.js
• jQuery
• JavaScript InfoVis Toolkit

## Data

The input data should be in tsv format

## First Week(21.11.2014 - 27.11.2014)

• Got to know what and how force directed graph works
• Deciding on the libraries to be used for the implementation
• Understood how spring layout works.

## Second Week(28.11.2014 - 4.12.2014)

• Explored about cytoscape and went through the list of issues sent by Max.
• Started working on web workers.
• Got Clarified the doubts related to web workers from Max's implementation.
• Started exploring about benchmark.js and parallel.js

## Third Week(5.12.2014 - 12.12.2014)

• Did parallization using circle layout with the web workers implementation

Github repository: https://github.com/Ahsanzia/FDG

• Started working on the web worker implementation for spread layout

## Fourth Week(13.12.2014 - 18.12.2014)

Report, work on Spread Layout Algorithm. Some functions parallelized if possible.

• Worked on visualization of 2000 nodes and corresponding edges using different features:
• Different layouts
• Zooming enabled and disabled
• Calculating the time for rendering of the layout.

The following visualizations use spread layout.

Fig1.1:Intial Layout of the Page
Fig1.2:TIme taken to visualize 200 nodes: 349ms
Fig1.3:TIme taken to visualize 400 nodes: 572ms
Fig1.4:TIme taken to visualize 600 nodes: 998ms
Fig1.5:TIme taken to visualize 800 nodes: 1263ms
Fig1.6:TIme taken to visualize 1000 nodes: 1975ms
Fig1.7:TIme taken to visualize 1200 nodes: 2425ms
Fig1.8:TIme taken to visualize 1400 nodes: 3127ms
Fig1.9:TIme taken to visualize 1600 nodes: 3846ms
Fig1.10:TIme taken to visualize 1800 nodes: 4840ms
Fig1.11:TIme taken to visualize 2000 nodes: 5988ms
Fig1.12:TIme taken to visualize 2200 nodes: 7069 ms
Fig1.13:TIme taken to visualize 2400 nodes: 8547ms
Fig1.14:TIme taken to visualize 2600 nodes: 9350ms
Fig1.15:TIme taken to visualize 2800 nodes: 10992ms
Fig1.16:TIme taken to visualize 3000 nodes: 11705ms

The following graph shows the relationship between the nodes and time taken to visualize it.

Fig1.17:Graph showing relatioship between nodes and the corresponding time taken to visualize it

## Fifth Week(19.12.2014 - 29.12 .2014)

• Implemented the web workers for the springy layout.
• Working on the benchmarking of the springy layout