Summer at DMP

The Summer Journal of a participant in DMP 2006

Monday, July 17, 2006

Blessed Progess

Alternate title: Reasons Why I am Awesome.

So the merging subproblem I talked about last time is completely solved, and implemented in code. I'm sure you're all dying to know the solution, so here it is: the trick is to use a hash table (thanks Bill!). Take each set of taxa in the leaves and add them to the hash table ( which in this case I implemented using a map.. an int associated with a list of ints). Let's say you have x.y, where x and y are two taxa. so you add y to list associated with x, and x to the list associated with y. Then, this beauty of a recursive function that I wrote takes care of the rest:

void merge(int starter, map > & my_map, vector & product) {
//check to see if starter is already in product.. if not, add it to product

if ( my_map[starter].empty() )
return;
else {
while ( !my_map[starter].empty() ) {
int new_starter = my_map[starter].front();
my_map[starter].pop_front();
merge(new_starter, my_map, product);
}
}
}

Isn't it pretty? And I set myself completely up for the next stage of the merge step: take these clusters and use something akin to the neighbor-joining approach to build up the entire tree. Then, after the entire tree is built, all I have to do is output the tree and I am DONE WITH CODING!!

Then.. I get to TEST my tree. And if it's better... wow. This is so cool. I am almost done! A big thanks to my friend Bill, who suggested the hash table idea. You are also totally awesome!

That's all for tonight. It's been a pretty late night at the lab, and I still have stuff due for tomorrow. Namely:


  • an abstract
  • the benchmarking graph for the 500 taxa


I also have these things to by the end of the week:

  • Finished code - thursday
  • Presentation - thursday
  • Benchmarking results for 854 taxa set - before thursday


All in all, a very busy week! Wish me luck!

0 Comments:

Post a Comment

<< Home