Assignment 1 information

Announcements

Assignment information


Generating the adjacency graph

In class we talked about two approaches to building the adjacency graph:

I suggested that the first approach is easier, but I am not so sure now after a student pointed me to some web pages on "tesseral addressing" and after an idea I had last night (which I'll describe here).

"Tesseral addressing" can be used to label the cells in a quadtree decomposition. You can find some information (and examples) on this at:

Here's the idea I came up with for generating the adjacency graph after the quadtree has already been generated. It's somewhat similar to the Tesseral addressing idea. Assume that the starting cell of the decomposition has its origin at the lower left (southwest) corner and is scaled (nonuniformly) so that the rectangle is one unit long on each side. Label the height and width of each cell with a fraction of the form A / B.

The interpretation of this fraction would be that the respective dimension of the cell takes up A/B to (A+1)/B of the original cell. For example, suppose you decompose the original cell into four smaller cells. The upper left (i.e. northwest) cell would have the fractions 0/2 for X and 1/2 for Y. This means that the cell contains X coordinates from 0/2 to 1/2, and Y coordinates from 1/2 to 2/2. Suppose you subdivide this cell into four smaller subrectangles. The lower right (i.e. southeast) cell would have the fractions 1/4 for X and 2/4 for Y, meaning that it contains X coordinates from 1/2 to 2/4 and Y coordinates from 2/4 to 3/4. It's of course important not to reduce the fractions because the denominator tells you how small the cell is (or how deep it is in the quadtree.

Finding the neighbors of a given cell would involve determining the appropriate fractions for a cell (of the same size) to the north, south, east, or west. For example for the cell where X=1/4 and Y=2/4, the neighbor(s) to the east would have X=2/4 and Y=2/4. You can then search the quadtree for the neighbors based on these "coordinates". There could be three cases:

CGAL

CGAL is a library of computational geomtery algorithms and representations. The CGAL documentation is a little hard to understand, so I'll describe the things I think you need to know on this page. If I've not mentioned something you think you need, let me know!

Basic classes and member functions

The cgaldefs.h file provided in the support code simplifies using CGAL by including the header files you need and using typedefs to simplify the names of types used in the support code. The following types are defined in this header file. The declarations I show for describing member functions are not the actual declarations which are actually defined in complicated templates, but they should tell you what you need to know (arguments, return type, etc.)

Algorithms

Documentation

whuang@cs.rpi.edu; email