Skip to content

random_constrained_tree() samples only the strict-reading corner of the legal topologies #121

Description

@ms609

Follow-up to #54, which loosened constraint enforcement to the documented
free-taxa contract. random_constrained_tree() (src/ts_wagner.cpp, the
RANDOM_TREE start strategy) still applies the strict reading when it builds a
start tree.

It reads cd.split_tips only. Every tip the constraint does not name is
collected as a root-level item, so it is placed outside every constrained
group, and each "together" group comes out as an exact clade.

Every tree it returns is compliant — strict implies loose — so this is not a
soundness bug. It is a sampling bug: most of the compliant topologies are
unreachable at every seed.

Exhaustively, on 6 taxa with one constraint character ({c,d} together,
{a,b} apart, {e,f} coded ?): 35 of the 105 unrooted binary trees are
compliant, and the generator can produce only 15 of them. The other 20 are
never drawn, whatever the seed.

Expected: a free taxon may sit on either side of every constraint edge, so a
random constrained start tree should be able to place it inside a constrained
group as readily as outside one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressBeing fixed; claiming comment names the branchsev:medP2: wrong on edge input / search quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions