Boost C++ Libraries: Ticket #8317: Edge coloring https://svn.boost.org/trac10/ticket/8317 <p> Currently there is no edge coloring algorithm in boost. While it is possible to color line graph it is suboptimal as: </p> <ul><li>It uses in worst case 2d-1 colors where d is maximum degree of graph </li><li>It requires additional bookkeeping (creation of line graph, storing edge numbering, etc). </li></ul><p> The attached patch allows to color in-place using at most d+1 colors. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8317 Trac 1.4.3 uzytkownik2@… Wed, 20 Mar 2013 17:24:28 GMT attachment set https://svn.boost.org/trac10/ticket/8317 https://svn.boost.org/trac10/ticket/8317 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-Added-edge-coloring-algorithm.patch</span> </li> </ul> <p> Patch adding edge coloring </p> Ticket Jeremiah Willcock Thu, 23 May 2013 04:08:11 GMT <link>https://svn.boost.org/trac10/ticket/8317#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8317#comment:1</guid> <description> <p> This code looks nice, and I'll put it into Boost.Graph when it is ready. Could you please write a documentation page for it and a simple test program? Also, here are some suggested changes to the code: </p> <ul><li>Please remove the <code>boost::</code> qualifications on calls such as <code>out_edges</code>, <code>put</code>, etc. on generic types passed in by the user. The code needs to use argument-dependent lookup for those functions so that the user can define them in other namespaces. Uses of traits classes still need the namespaces, though. </li></ul><ul><li>Instead of <code>BOOST_FOREACH</code>, you can use <code>BGL_FORALL_...</code> from <code>&lt;boost/graph/iteration_macros.hpp&gt;</code> (don't worry about undefining the macros at the end of your file like some of the other parts of Boost.Graph do). </li></ul><ul><li>It appears that Phoenix is used once in the code. Wouldn't it be easier (and likely run faster) to use a manually-written function object? It seems like it would be short and quick to write. </li></ul> </description> <category>Ticket</category> </item> <item> <author>Maciej Piechotka <uzytkownik2@…></author> <pubDate>Sun, 09 Jun 2013 13:22:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8317#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8317#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8317#comment:1" title="Comment 1">jewillco</a>: </p> <blockquote class="citation"> <p> This code looks nice, and I'll put it into Boost.Graph when it is ready. Could you please write a documentation page for it and a simple test program? Also, here are some suggested changes to the code: </p> </blockquote> <p> Ok. I'll alter the code in a month when I'll have time to do it. </p> <p> For anyone interested in using the code before it is upstreamed - there is small error in patch and graph is passed by value instead of by reference resulting in bad performance for large graphs AND crashing when run on subgraph. Changing ph::val(g) to ph::ref(g) should fix the issue. </p> </description> <category>Ticket</category> </item> <item> <author>Maciej Piechotka <uzytkownik2@…></author> <pubDate>Mon, 15 Jul 2013 19:08:14 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8317 https://svn.boost.org/trac10/ticket/8317 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-Added-edge-coloring-algorithm.2.patch</span> </li> </ul> <p> 0001-Added-edge-coloring-algorithm.patch </p> Ticket Maciej Piechotka <uzytkownik2@…> Mon, 15 Jul 2013 19:11:45 GMT <link>https://svn.boost.org/trac10/ticket/8317#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8317#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8317#comment:1" title="Comment 1">jewillco</a>: </p> <blockquote class="citation"> <p> This code looks nice, and I'll put it into Boost.Graph when it is ready. Could you please write a documentation page for it and a simple test program? </p> </blockquote> <p> Done. </p> <blockquote class="citation"> <p> Also, here are some suggested changes to the code: </p> <ul><li>Please remove the <code>boost::</code> qualifications on calls such as <code>out_edges</code>, <code>put</code>, etc. on generic types passed in by the user. The code needs to use argument-dependent lookup for those functions so that the user can define them in other namespaces. Uses of traits classes still need the namespaces, though. </li></ul></blockquote> <p> Corrected. I didn't thought C++ is capable of 'namespace'-polymorphism. </p> <blockquote class="citation"> <ul><li>Instead of <code>BOOST_FOREACH</code>, you can use <code>BGL_FORALL_...</code> from <code>&lt;boost/graph/iteration_macros.hpp&gt;</code> (don't worry about undefining the macros at the end of your file like some of the other parts of Boost.Graph do). </li></ul></blockquote> <p> Done. </p> <blockquote class="citation"> <ul><li>It appears that Phoenix is used once in the code. Wouldn't it be easier (and likely run faster) to use a manually-written function object? It seems like it would be short and quick to write. </li></ul></blockquote> <p> Done. I would be surprised if there was a significant overhead due to creation of Phoenix objects on modern compilers with optimization turned on but I guess it was also to eliminate the dependency. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Sat, 31 Aug 2013 19:44:09 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8317#comment:4 https://svn.boost.org/trac10/ticket/8317#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85534" title="Added edge coloring code from Maciej Piechotka; fixes #8317">[85534]</a>) Added edge coloring code from Maciej Piechotka; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8317" title="#8317: Patches: Edge coloring (closed: fixed)">#8317</a> </p> Ticket Jeremiah Willcock Sat, 31 Aug 2013 19:45:04 GMT <link>https://svn.boost.org/trac10/ticket/8317#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8317#comment:5</guid> <description> <p> I added your code to the Boost trunk (with some fixes for Boost Inspection Tool warnings). Could you please write a test case (even something simple like testing on a random graph and making sure the result is a valid coloring)? Thank you. </p> </description> <category>Ticket</category> </item> <item> <author>Maciej Piechotka <uzytkownik2@…></author> <pubDate>Sat, 31 Aug 2013 19:48:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8317#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8317#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8317#comment:5" title="Comment 5">jewillco</a>: </p> <blockquote class="citation"> <p> I added your code to the Boost trunk (with some fixes for Boost Inspection Tool warnings). Could you please write a test case (even something simple like testing on a random graph and making sure the result is a valid coloring)? Thank you. </p> </blockquote> <p> Thanks. What's wrong with libs/graph/example/edge_coloring.cpp from patch (and changeset)? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Sat, 31 Aug 2013 20:12:26 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8317#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8317#comment:7</guid> <description> <p> It wasn't labeled as a test case, so I didn't know to put it into that directory. Also, it does not appear to do any validation of its results, so it would be hard to tell if your code broke at some point in the future. </p> </description> <category>Ticket</category> </item> <item> <author>Maciej Piechotka <uzytkownik2@…></author> <pubDate>Sat, 31 Aug 2013 20:14:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8317#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8317#comment:8</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/8317#comment:7" title="Comment 7">jewillco</a>: </p> <blockquote class="citation"> <p> It wasn't labeled as a test case, so I didn't know to put it into that directory. Also, it does not appear to do any validation of its results, so it would be hard to tell if your code broke at some point in the future. </p> </blockquote> <p> Ups. Sorry - it's a bit late and I read 'example' instead of 'test case'. I will try to adopt it to test withing week. </p> </description> <category>Ticket</category> </item> <item> <author>uzytkownik2@…</author> <pubDate>Sun, 29 Sep 2013 12:32:14 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/8317 https://svn.boost.org/trac10/ticket/8317 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-Add-tests-for-edge-coloring.patch</span> </li> </ul> <p> Tests for edge coloring </p> Ticket