From: Erik V. <eri...@hc...> - 2006-07-07 22:06:08
|
> >I guess it's mostly a matter of words. > >To me, the Track, Junction and Station objects *are* the > connectivity graph. > >Our difference then is, as it seems to me, that you restrict > the cloning > >to those Track, Junction and Station objects, not including > >the parent tile itself. Not much saving, I would think. > > > >Or does your graph consist of entirely different objects? > > > > > If you use them as the connectivity graph, then you wind up pointing > into Junction objects in other Tile objects, which means the Junction > objects have to have a reference the parent Station or Tile object > (which complicates a common superclass). Another problem is > maintiaining multiple connectivity graphs -- as mentioned in > the first > message you really want to have different types of > connectivity graphs > for tile laying, token placement, and route calculations. For the > latter, you also need to have different connectivity graphs for each > company. > > What I am proposing is a triangular (since the edges are > bi-directional) > 2-D bitvector which encodes connectivity between all the > things you want > to care about. That would be maintained totally outside the data > structure for the tiles, which would be immutable once loaded > from the > database. You could have as many different connectivity > graphs as you > like without a problem. > > Even if you don't want to do it with a bitvector, I think you > still want > to have the connectivity graph outside the tile data structure. I was under the impression, that your pseudocode would work with the track/junction objects themselves, without need for separate structures (a.k.a. different connectivity graphs). Which would mean, that for different purposes you would have different algorithms working with the same data structure (which indeed is how I would do it). Did I misunderstand that? For the rest, I'm totally out of graph and bitvector theory, so this way it'll have to be you who implements all this (or someone of equal math education level). My study was chemistry.... Erik. |