Skip to content

Deletion of joint subtrees in steinertree3 incomplete #3

@m-i-c-h-ael

Description

@m-i-c-h-ael

Hi,
I believe there is an issue with the merging of non-disjoint subtrees in the steinertree3 function in steinertree.R (lines 261 and following):
I encountered a case where there is no overlap between my trees with i=1 and j=2. So j is increased to 3. In this case there was an overlap between the i=1 and j=3 trees. When j reaches the end of the subtree list, i is increased. The problem is that the tree at i=1 is not the same anymore than the one that has been tested against j=2 (because it has been merged with other trees), so the new i=1 and j=2 trees may actually overlap. In my case, this lead to an empty list when calculating 'nsubtrees', which cased an error.
A solution may be to not increase i in a loop where something has been merged into the corresponding tree. My code is too complex to share here, but I hope the explanation makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions