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

An important paper is "Force-Directed Edge Bundling for Graph Visualization" by Danny Holten and Jarke J. van Wijk.

  • 4
    $\begingroup$ 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. $\endgroup$
    – rcollyer
    May 8, 2012 at 0:44
  • $\begingroup$ Looks like a really intricate application of the EdgeRenderingFunction option to GraphPlot. $\endgroup$
    – Verbeia
    May 8, 2012 at 1:27
  • 1
    $\begingroup$ @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. $\endgroup$
    – rcollyer
    May 8, 2012 at 2:03

1 Answer 1


CommunityGraphPlot has this feature implemented internally:

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

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}}],
  {ImageSize -> 300, EdgeStyle -> [email protected],
   GraphLayout -> {"EdgeLayout" -> {"DividedEdgeBundling", 
       "CoulombConstant" -> 500, "VelocityDamping" -> .5, "SmoothEdge" -> False}}}]

Mathematica graphics

  • $\begingroup$ Unfortunately this doesn't work in M10, I don't quite have enough time to spelunk what's changed but I'll come back if possible soon with a comment - your bio say's your on M9 still $\endgroup$ Jul 21, 2014 at 9:37
  • $\begingroup$ @Martin I'm on v10 now and it still works exactly the same way (though it generates slightly different graphs for the last example due to changes in my Facebook account). Could you please specify where the discrepancy is at your end? $\endgroup$ Jul 21, 2014 at 11:34
  • $\begingroup$ I get this i.imgur.com/dLq6XPa.png in a clean kernel, which is slightly odd. $\endgroup$ Jul 21, 2014 at 13:06
  • $\begingroup$ @Martin It seems like something is set prior to plotting with e.g. SetOptions[Graph, ...] or similar. You're missing vertex shapes as well. Is this the result when you start with a fresh kernel? $\endgroup$ Jul 21, 2014 at 13:29
  • 4
    $\begingroup$ More complete sub-option list found in v10: {"NewForce","Connectivity","Compatibility","SmoothEdge","Threshold","SpringConstant","CoulombConstant","CoulombDecay","VelocityDamping","LaneWidth"}. $\endgroup$
    – Silvia
    Feb 3, 2015 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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