Figure 2. Diagram of the branch swapping and ancestor searching algorithms employed by StrataPhy. 2.1) StrataPhy begins by stepwise addition of taxa to build a starting cladogram. The list in the upper left portion of Figure 2.1 represents the random order in which taxa are added. Gray text represents taxa to be added, red text indicates the taxon currently being added, and black text represents taxa remaining to be added by the algorithm. Arrows indicate all the potential locations to which Taxon B could be added. Note that because stratocladistic searches necessarily search rooted trees, Taxon B can be added to the root of the cladogram below all other taxa. 2.2) A subclade is selected to be pruned from the cladogram (highlighted in blue). 2.3) The selected clade (now in light blue) is pruned from the rest of the cladogram. 2.4) The pruned clade is reattached to the original cladogram on a different branch. 2.5) Once attached, a new topology has been created, and the search for the optimal assignment of ancestors begins. The search will occur only if the new cladogram has a lower total debt than the debt ceiling (see text for full description). 2.6) The pruned subclade from step 2.3 is then reattached to all other possible branches, and the ancestor assignment search from step 2.5 is repeated. 2.7) After the subclade has been reattached to all possible branches, it is rerooted to produce a different set of cladistic relationships in the subclade (shown in green). 2.8) This new subclade is then reattached to every possible branch on the original cladogram (as in step 2.6), and each time the ancestor assignment routine from step 2.5 is repeated.