Skip to content

Stable ordered ancestors/descendants #21

@jeremybeard

Description

@jeremybeard

I'm looking to produce a list of the vertices of a DAG, where a vertex in the list is somewhere after all of its ancestors, but where the list doesn't change across calls. I can use getLeaves and getOrderedAncestors to fairly easily produce the list without walking the graph myself, but the list can change across calls because sibling vertices are not ordered.

Would a getStableOrderedAncestors and getStableOrderedDescendants make sense here? Analogous to sort.Sort and sort.Stable. The sibling vertices could perhaps be ordered by comparing IDs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions