Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm wondering if anyone has implemented edge bundled graph plotting?

http://www.win.tue.nl/~dholten/papers/forcebundles_eurovis.pdf

share|improve this question
4  
While the paper is nice, can you expound upon it in your question? Links are fragile, so the more information that you add to your question, the longer they will remain relevant. –  rcollyer May 8 '12 at 0:44
    
Looks like a really intricate application of the EdgeRenderingFunction option to GraphPlot. –  Verbeia May 8 '12 at 1:27
1  
@Verbeia it looks like more than that to me. It bundles edges that go in similar directions together, increasing their relative weight, and they peal off from the bundle near their nodes. (Fig. 8 is a good one to look at to see this.) This reduces the visual complexity of network. –  rcollyer May 8 '12 at 2:03
add comment

1 Answer

CommunityGraphPlot has this feature implemented internally:

g = ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}];
CommunityGraphPlot[g]

Mathematica graphics

The information about bundling is calculated by CommunityGraphPlot (i.e. it is not supplied with the example data), though unfortunately there are no documented options available to finetune the bundling (but see below), only the region (CommunityRegionStyle) and boundary styles (CommunityBoundaryStyle).

Though one can extract from the community graph the BezierCurve that generates the bundled edges (with low opacity EdgeStyle by default), it will contain references to vertex coordinates like DynamicLocation["VertexID$1", Automatic, Center]. Unfortunate again that due to the dynamical nature of a CommunityGraphPlot, ordinary Graph functions like VertexList or PropertyValue[{g, 1}, VertexCoordinates] will fail, so there is no easy way to extract the real vertex coordinates which otherwise could have been matched with the various "VertexID$1" references.

The method to find communities can be customized with FindGraphCommunities.

Undocumented functionality

You have to dig deep to ultimately find any bundling-related code in GraphComputation`GraphCommunitiesPlotDump`communitiesPlot. It accepts the following internal options (above default ones):

 "EdgeLayout" -> Automatic
 "CommunityEdgeWeight" -> Automatic
 "CommunityRegionFunction" -> Automatic

If "EdgeLayout" has the value "DividedEdgeBundling", the following suboptions are available to control the bundling process (with their defaults):

"CoulombConstant" -> 4.5
"VelocityDamping" -> 1
"SmoothEdge" -> True

Examining its internal usage and a bit of experimentation yielded the following results:

SetProperty[g, {GraphLayout -> {"EdgeLayout" -> {"DividedEdgeBundling",
      "CoulombConstant" -> 5, "VelocityDamping" -> .6, "SmoothEdge" -> True},
    "VertexLayout" -> {Automatic}}}]

Mathematica graphics

SetProperty[g, {GraphLayout -> {"EdgeLayout" -> {"DividedEdgeBundling", 
      "CoulombConstant" -> 100, "VelocityDamping" -> .5, "SmoothEdge" -> False}}}]

Mathematica graphics

SetProperty[g, {
  GraphLayout -> {"EdgeLayout" -> {"DividedEdgeBundling", 
      "CoulombConstant" -> 44, "VelocityDamping" -> .87, "SmoothEdge" -> False}}}]

Mathematica graphics

SetProperty[g, {
  GraphLayout -> {"EdgeLayout" -> {"DividedEdgeBundling", 
      "CoulombConstant" -> 100, "VelocityDamping" -> .5, "SmoothEdge" -> False},
    "VertexLayout" -> {"SpringEmbedding", "EdgeWeighted" -> True,
       "Multilevel" -> False}}}]

Mathematica graphics

For larger graphs it really helps to use transparent edges:

sm = SocialMediaData["Facebook", "FriendNetwork"];
{
 SetProperty[sm, {ImageSize -> 300, GraphLayout -> {"EdgeLayout" -> None}}],
 SetProperty[sm,
  {ImageSize -> 300, EdgeStyle -> Opacity@.1,
   GraphLayout -> {"EdgeLayout" -> {"DividedEdgeBundling", 
       "CoulombConstant" -> 500, "VelocityDamping" -> .5, "SmoothEdge" -> False}}}]
 }

Mathematica graphics

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.