### stl Sets and Quartet Puzzling

Hi, I am in bioinformatics and I need to make phylogenetic trees by the quartet puzzling method. A quartet is a set of 4 taxons. I am given the list of taxons and a matrix of distances between them. I've figured out the general steps that I have to take but I don't know how to score branches of a set according to a tree split. A picture version of what I am describing is in the link: http://www.scribd.com/doc/89944887/119/PHYLOGENETIC-TREE-RECONSTRUCTION-USING-QUARTET-PUZZLING-349 page 384.

Generate all possible quartets and state the type according to minimum
distance and numerical order.

For each quartet, choose a random taxon E and generate all new possible
quartets from this with taxon E in it and get the type (1,2,3).

For each possible split according to the type for one possible quartet:
1: ij,kl i,jkl k,ijl l,ijk j,ikl
2: etc.
3: etc.
Add E to the side that has only one taxon from possible quartet and check
if the type is the same, using the taxa from the quartet on the other side.

For every split that is not the same type, add one penalty point for that
split. Do this for every possible quartet and add up the penalty points
on each split. Permanently pair taxon E according to the split with the
fewest penalty points.

Repeat this with a new random taxon F until a tree is generated. Do this
for all quartets.

So how do I score a split type? How do I navigate a set? Is there a better way than using a set for a tree?

Thanks.
I don't understand what you must achieve.

An std::set is a data container. It contains data elements and sorts them under the hood. It also discards duplicates, e.g. adding "Mary" to a set containing "John", "Mary" and "Paul" won't change the set.

You navigate an std::set the same way you navigate most other STL containers:
a for() loop with an iterator starting at begin() and ending at end().
http://cplusplus.com/reference/stl/set/begin/
Topic archived. No new replies allowed.