Skip to content

Add method for removing redundant nodes#571

Open
arcondello wants to merge 27 commits into
dwavesystems:mainfrom
arcondello:feature/node-equality-and-successor-transfer
Open

Add method for removing redundant nodes#571
arcondello wants to merge 27 commits into
dwavesystems:mainfrom
arcondello:feature/node-equality-and-successor-transfer

Conversation

@arcondello

Copy link
Copy Markdown
Member

Closes #563

AI Generation Disclosure

No AI used.

@arcondello arcondello added the enhancement New feature or request label Jun 24, 2026
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch 2 times, most recently from 4dab596 to a8040b8 Compare June 24, 2026 18:09
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from a8040b8 to 82cc356 Compare June 24, 2026 18:14
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 56195c1 to 57638a8 Compare June 24, 2026 18:18
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 39fb39d to 055fe62 Compare July 2, 2026 17:35
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from ee71c02 to 770a9cb Compare July 3, 2026 17:05
double max() const override;

using ArrayOutputMixin::shape;
using ArrayOutputMixin<EqualityMixin<ArrayNode, BinaryOpNode<BinaryOp>>>::shape;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the commit message for 5b213bc

This requires some fiddling, see
https://isocpp.org/wiki/faq/templates#nondependent-name-lookup-members
for the why.

@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 261d2d6 to 98e4bd0 Compare July 3, 2026 18:09
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 98e4bd0 to 47e1be7 Compare July 3, 2026 18:14
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 90386b6 to cd107a0 Compare July 6, 2026 16:43
virtual bool equal_to(const Derived& rhs) const = 0;
};

/// Overload for EqualityMixin that does not require a class-specific equal_to()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A doubt I have is whether these two overloads are different enough that they should actually be given different names 🤔

@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 42a0edd to f7a75d1 Compare July 8, 2026 17:33
Comment thread dwave/optimization/src/nodes/lp.cpp Outdated
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 4e887e4 to f643bca Compare July 9, 2026 22:40
@arcondello arcondello marked this pull request as ready for review July 10, 2026 17:45
@arcondello

arcondello commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

As a note: I didn't try to be inclusive about the asserts in the replace_predecessor_() method. That way lies madness so I just went with some sanity checks.

Comment thread tests/cpp/test_graph.cpp Outdated
@arcondello arcondello requested a review from fastbodin July 10, 2026 18:27
@arcondello arcondello force-pushed the feature/node-equality-and-successor-transfer branch from 212caf4 to d0dd3d3 Compare July 10, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add methods to support the removal of redundant nodes

1 participant