<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 7, 2011, at 11:38 AM, Anna Zaks wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div>Second, on your comment on the approach I took. Even the current implementation of the recalculate function does not solely depend on GraphTraits. It also depends on Function::getEntryBlock or Function::front(), Function.size(), etc. Why do you think a clean implementation should only depend on GraphTraits?</div></blockquote><div><br></div><div><div>That is the general idea behind GraphTraits. Each class which represents a graph implements the traits interface. The graph algorithms (dominators is one of them) rely only on that interface. I am not sure why the current implementation of dominators relies directly on the Function class methods instead of using the traits. I suspect it was just the matter of someone not having the time to implement that..</div></div></div></div></span><br class="Apple-interchange-newline"></blockquote></div><br><div>I'm just catching up on this thread, but I agree 100% with Anna the we should have Dominators rely more on traits rather than specific methods in the graph object is the best way to do go. Essentially there is an abstraction violation here that doesn't make Dominators generic enough. What if we added a third kind of graph that we wanted to run Dominators on? Would it need to have the same exact methods as well? Having Dominators depend fully on trait classes gives users all the flexibility they need to adopt that algorithm to any graph data structure.</div></body></html>