in packages/cdk-graph/src/core/graph.ts [1743:1775]
protected _mutateReconcileLinks(): void {
this._preMutate();
const links = this.links;
for (const a of links) {
if (a.isDestroyed) continue;
if (a.isClosed && a.edgeType !== EdgeTypeEnum.CUSTOM) {
a.mutateDestroy();
continue;
}
for (const b of links) {
if (a === b || b.isDestroyed) continue;
if (a.isEquivalent(b)) {
a.mutateConsume(b);
}
}
}
const reverseLinks = this.reverseLinks;
for (const a of reverseLinks) {
if (a.isDestroyed) continue;
if (a.isClosed && a.edgeType !== EdgeTypeEnum.CUSTOM) {
a.mutateDestroy();
continue;
}
for (const b of reverseLinks) {
if (a === b || b.isDestroyed) continue;
if (a.isEquivalent(b)) {
a.mutateConsume(b);
}
}
}
}