Skip to content

Implementation of spring embeders algorithm for drawing cross-free , planar graphs using properties of Physics.

Notifications You must be signed in to change notification settings

emilywotruba/force-directed-graph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Force-Directed-Graph-Drawing

Some of the most flexible algorithms for calculating layouts of simple undirected graphs belong to a class known as force-directed algorithms.
Also known as spring embedders,
such algorithms calculate the layout of a graph using only information contained within
the structure of the graph itself, rather than relying on domain-specific knowledge.
Graphs drawn with these algorithms tend to be aesthetically pleasing, exhibit symmetries, and tend to produce crossing-free layouts for planar graphs

alt text

The file Graph2.py , implements the following preliminary algorithm for force directed graph drawing :

algorithm SPRING(G:graph);
place vertices of G in random locations;
repeat M times
calculate the force on each vertex;
move the vertex c4 ∗ (force on vertex)
draw graph on CRT or plotter.

Attractive Force is computed by using : Hooke's Law
Repulsive Forces are computed by using : Coulomb's Law

Outputs

alt text

alt text

About

Implementation of spring embeders algorithm for drawing cross-free , planar graphs using properties of Physics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%