<div class="gmail_quote">On Wed, Nov 16, 2011 at 9:10 AM, Victor Campos <span dir="ltr"><<a href="mailto:victorsc@dcc.ufmg.br">victorsc@dcc.ufmg.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear guys,<br><br>    I am implementing Nuutila's algorithm to find the strongly connected<br>components of the dependence graph of a program.</blockquote><div><br></div><div>Why? LLVM has fully generic graph algorithms that are quite efficient. Look at <a href="http://llvm.org/doxygen/SCCIterator_8h_source.html">http://llvm.org/doxygen/SCCIterator_8h_source.html</a> and some of its users to see how this works. In essence, you provide a GraphTraits specialization for whatever datastructure you have, and the SCC building logic provides the rest.</div>
<div><br></div><div>The result of the SCC iterator is that you can iterate cleanly over all the SCCs in yoru graph, bottom up. At each SCC you get a vector of nodes in the SCC.</div><div><br></div><div>If you have performance problems with these generic algorithms, then by all means lets discuss it here, but I don't think the solution should initially be to implement your own algorithm... But maybe I don't understand what you're actually trying to do. Is your use case not served by these generic libraries?</div>
</div>