Skip to content

kirstywilliams/quadtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuadTree

The QuadTree herein was implemented as part of a graph drawing project back in August, 2012. A description can be found on my Blog: Quadtrees for Space Decomposition.

1. Usage

The QuadTree is generic so has a wide range of possible usage. Although, it was developed to be used as a component of the FADE drawing algorithm for the deconstruction of a graph on a 2D plane.

Example:

//initialises the QuadTree with the graph bounds, and sets as root node
QuadTree tree = new Quadtree(bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY());

//assigns each vertex to the node containing its coordinates
//continually increasing the size of the assigned node
//if node exceeds a size of 4, node is recursively split.
for(Vertex v : V)
	 tree.put(v.getX(), v.getY(), v);

2. Authors