Skip to content

Add methods to support the removal of redundant nodes #563

Description

@arcondello

#41 and #161 added the ability to remove unused nodes from the Graph. The logical next step is the ability to remove redundant nodes. This would require two things:

  1. We need some method to test whether two nodes are equal (or maybe equivalent?), that is that they will always be guaranteed to take the same value. We could also replace the Cython-level function.
  2. We need a method to transfer successors from one node to another. So probably something like Graph::transfer_successors(Node* from_ptr, Node* to_ptr) which uses Node::replace_predecessor(...). We need the latter because some nodes keep redundant pointers.

With those two in place, we can check for equality, and in that case transfer the successors. Having done that as much as possible, we then run the Graph::remove_redundant_nodes() function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    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