Boost C++ Libraries: Ticket #9935: Support edge multiplicity in brandes_betweenness_centrality https://svn.boost.org/trac10/ticket/9935 <p> There are several possible variations to the Brandes algorithm for the calculation of the betweenness centrality. Several of them were compiled by Brandes himself on his paper <a class="ext-link" href="http://www.inf.uni-konstanz.de/algo/publications/b-vspbc-08.pdf"><span class="icon">​</span>On variants of shortest-path betweenness centrality and their generic computation</a>. </p> <p> I need to compute one of these variations, in particular the one which considers edge multiplicities, understood as an edge property representing the frequency or the amount of times a relationship happens. This variation introduces a quite small change in the algorithm, as explained in the section 3.8, algorithm 11 of the referenced paper. </p> <p> I was thinking of introducing this functionality in the graph library. I roughly know where and what should be added or modified (namely <code>&lt;boost/graph/betweenness_centrality.hpp&gt;</code> and <code>&lt;boost/graph/distributed/betweenness_centrality.hpp&gt;</code>), although I have never made modifications to any Boost library, so I would probably need some advice. Basically, I consider three options: </p> <ul><li>Adding a third version of the algorithm, parallel to the Dijkstra and the unweighted version (which would not consider weights). </li><li>Add two versions of the algorithm, one based on the Dijsktra version (considering weights) and another based on the unweighted version. </li><li>Modify both existing implementations of the algorithm, adding an optional map holding the edge multiplicity with a constant value of one by default. </li></ul><p> However, I don't know if there is interest in adding this kind of feature to the library, or if it is too specific to be considered useful. Another option would be to expose some interface to be able to inject your own variation of the algorithm from your application, but that would be way more complex to develop, use and document, and probably there would always be uncovered cases. </p> <p> Just for the record, there is actually a way to make computation with the current implementation, if the edge multiplicities are integers (which is not always true), simply replacing each edge with a number of parallel edges equal to its multiplicity (if the current implementation works for multigraphs, which I think is the case). However, this obviously increases (potentially a lot) the time and space complexity of the already CPU-intensive betweenness calculation. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9935 Trac 1.4.3 Javier Dehesa <javidcf@…> Wed, 23 Apr 2014 12:11:45 GMT <link>https://svn.boost.org/trac10/ticket/9935#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9935#comment:1</guid> <description> <p> While implementing this feature I've realized that the only possible way to introduce a multiplicity parameter without breaking the current API would be as an extra optional parameter in the weighted version of the algorithm - although multiplicities could be considered in weighted or unweighted graphs. The problem is that if we add a new optional parameter to the unweighted signature, it would be impossible to tell if the new parameter is intended to be used as a weight property map or a multiplicity property map. Even breaking the API I can't think of an easy and clean way to work it out. </p> <p> So I guess that this feature could be implemented only in the weighted version, which by the way is a generalization of the unweighted case, so it's not that bad, you could just use a static_property_map with value 1 as weight. </p> </description> <category>Ticket</category> </item> <item> <author>Javier Dehesa <javidcf@…></author> <pubDate>Fri, 25 Apr 2014 08:06:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9935#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9935#comment:2</guid> <description> <p> Funny enough, after some hours thinking about why my implementation wasn't giving the expected results, I've found out that there was mistake in the referenced algorithm of the referenced paper, as mentioned in the <a class="ext-link" href="http://www.inf.uni-konstanz.de/~brandes/publications/"><span class="icon">​</span>publications page of Ulrik Brandes</a>. Seriously though, in 140 publications there are just 2 mistakes, what were the odds? </p> <p> Anyway, I'll fix that and put a pull request for it. </p> </description> <category>Ticket</category> </item> <item> <author>Javier Dehesa <javidcf@…></author> <pubDate>Fri, 25 Apr 2014 09:13:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9935#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9935#comment:3</guid> <description> <p> I've just put a <a class="ext-link" href="https://github.com/boostorg/graph/pull/6"><span class="icon">​</span>pull request on GitHub</a> for this ticket. </p> </description> <category>Ticket</category> </item> </channel> </rss>