I'm trying to model a composite object that consists of one or more shapes. For simplicity, I'll assume the shapes are all rectangles. A composite might look like this (forgive my poor ASCII art):
+---+-------+---+ | | 2 | 5 | | +-------+---+ | 1 | 3 | | | +-------+ 6 | | | 4 | | +---+-------+---+
Wikipedia pointed me to graph theory, which I just barely remember from college, and it seems like an adjacency list would be a good way to model the relationships between all these shapes.
My question is, can I indicate left, right, top, and bottom relationships in an adjacency list? It isn't enough to say 1 is adjacent to 2; I need to say 1 is left of 2 (and 3 is above 4, etc.).