Skip to content

Tutorial on edge_diffs / incremental algorithms #233

@hyanwong

Description

@hyanwong

There's a lot of idioms and complicated code when implementing incremental algorithms, for example, that use the edge_diffs() iterator. For example it's a common idiom to iterate jointly over trees and edges diffs:

for tree, diffs in zip(ts.trees(), ts.edge_diffs()):
    ...

When going through the edge diffs, it is also often useful to keep track of which nodes come in and out of the tree (and hence maintain a list of "active" nodes). For example, I think this is what I need for tskit-dev/tskit#2718. I've done this sort of thing before, but forgotten the code that I used to do it. A tutorial might be a good place to put example code for people to modify. I assume it would be linked to from the "Fundamental operations" tute mentioned in #203

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions