Boost C++ Libraries: Ticket #735: Fruchterman-Reingold grid performance can be improved https://svn.boost.org/trac10/ticket/735 <pre class="wiki">Jens Müller schrieb: I have the code at home, so I'll send it this afternoon. It's attached ... Please test if it's faster for you, too ... Index: fruchterman_reingold.hpp =========================================== ======================== RCS file: /cvsroot/boost/boost/boost/graph/ fruchterman_reingold.hpp,v retrieving revision 1.11 diff -r1.11 fruchterman_reingold.hpp 134c134 &lt; std::size_t adj_start_row = row == 0? 0 : row - 1; --- /* std::size_t adj_start_row = row == 0? 0 : row - 1; 147a148,201 } */ // Alternative 1: std::size_t adj_start_row = row == 0? 0 : row - 1; std::size_t adj_end_row = row == rows - 1? row : row + 1; std::size_t adj_start_column = column == 0? 0 : column - 1; std::size_t adj_end_column = column == columns - 1? column : column + 1; for (std::size_t other_row = adj_start_row; other_row &lt;= adj_end_row; ++other_row) for (std::size_t other_column = adj_start_column; other_column &lt;= adj_end_column; ++other_column) if ((other_row &lt;= row &amp;&amp; other_column &lt;= column &amp;&amp; (other_row != row || other_column != column)) || (other_column == column+1 &amp;&amp; other_row == row - 1)) { // Repulse vertices in this bucket bucket_t&amp; other_bucket = buckets[other_row * columns + other_column]; for (v = other_bucket.begin(); v != other_bucket.end(); ++v) { apply_force(*u, *v); apply_force(*v, *u); } } // Alternative 2: /* if (row != 0) { std::size_t other_row = row - 1; if (column != 0) { std::size_t other_column = column - 1; // field 1 bucket_t&amp; other_bucket = buckets[other_row * columns + other_column]; for (v = other_bucket.begin(); v != other_bucket.end(); ++v) { apply_force(*u, *v); apply_force(*v, *u); } } // field 2 bucket_t&amp; other_bucket = buckets[other_row * columns + column]; for (v = other_bucket.begin(); v != other_bucket.end(); ++v) { apply_force(*u, *v); apply_force(*v, *u); } if (column != columns - 1) { // field 3 std::size_t other_column = column + 1; bucket_t&amp; other_bucket = buckets[other_row * columns + column]; for (v = other_bucket.begin(); v != other_bucket.end(); ++v) { apply_force(*u, *v); apply_force(*v, *u); } 148a203,215 } if (column != 0) { std::size_t other_column = column - 1; // field 4 bucket_t&amp; other_bucket = buckets[row * columns + other_column]; for (v = other_bucket.begin(); v != other_bucket.end(); ++v) { apply_force(*u, *v); apply_force(*v, *u); } } */ _______________________________________________ Unsubscribe &amp; other changes: http://lists.boost.org/mailman/ listinfo.cgi/boost </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/735 Trac 1.4.3 Marshall Clow Thu, 12 Jul 2007 15:14:59 GMT owner, status changed; severity set https://svn.boost.org/trac10/ticket/735#comment:1 https://svn.boost.org/trac10/ticket/735#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">doug_gregor</span> </li> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Optimization</span> </li> </ul> <p> Assigned to "doug_gregor" instead of nonexistent user "dgregor" </p> Ticket Douglas Gregor Tue, 29 Apr 2008 18:28:07 GMT owner, description changed https://svn.boost.org/trac10/ticket/735#comment:2 https://svn.boost.org/trac10/ticket/735#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">doug_gregor</span> to <span class="trac-author">Douglas Gregor</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/735?action=diff&amp;version=2">diff</a>) </li> </ul> Ticket Jeremiah Willcock Tue, 07 Apr 2009 16:04:59 GMT owner, status changed https://svn.boost.org/trac10/ticket/735#comment:3 https://svn.boost.org/trac10/ticket/735#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Jeremiah Willcock</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Does this issue still apply to the current version of Boost? If so, could I please get a unified diff for your patch? </p> Ticket Jeremiah Willcock Sat, 23 May 2009 16:31:48 GMT type changed; milestone set https://svn.boost.org/trac10/ticket/735#comment:4 https://svn.boost.org/trac10/ticket/735#comment:4 <ul> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>milestone</strong> → <span class="trac-field-new">Boost 1.40.0</span> </li> </ul> <p> I need a new version of the patch to apply before I can do anything with this bug. </p> Ticket Jeremiah Willcock Tue, 09 Jun 2009 14:49:23 GMT status, resolution changed https://svn.boost.org/trac10/ticket/735#comment:5 https://svn.boost.org/trac10/ticket/735#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fixed</span> </li> </ul> <p> This has already been applied. </p> Ticket