Is it possible to draw a curved edge between two vertexes of a graph? [duplicate]

This question already has an answer here:

The following code generates a graph.

LayeredGraphPlot[
{{"i" -> "m", 1}, {"i" -> "...", 1}, {"i" -> "n", 1}, {"m" -> "j", 2}, {"..." -> "j", 2}, {"n" -> "j", 2}},
DirectedEdges -> True,
VertexLabeling -> True,
PlotStyle -> {FontSize -> 14},
EdgeRenderingFunction -> (Switch[#3, 1, {Dashed, Arrow[#1, .1]}, 2, {Arrow[#1, .1]}] &)] My question is that is it possible to draw curves between "i" and each of "m", "...", "n" instead of straight lines, like the red curve below? Thank you. marked as duplicate by kglr plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 9 '15 at 0:59

You can construct a BezierCurve by adding two control points to the list of vertex coordinates for the two vertices (p[] and p[]) incident to an edge.

In the following function bC with three arguments ({t1,t2,t3}), the two additional points are obtained by taking two points on the line joining the two vertex coordinates, t1 p[] + (1-t1) p[] and t2 p[] + (1-t2) p[] where 0<= t1, t2 <=1, and adding to these points {0,t3} or {t3,0} to ensure that the resulting four points are not collinear. The default values for the three arguments are {t1,t2,t3}= {1/3,2/3,1/3}.

ClearAll[bC]
bC[t1_:(1/3),t2_:(2/3), t3_:(1/3)]:= With[{p=#},
BezierCurve[{p[],
t1 p[]+(1-t1)p[]+If[p[[1,1]]==p[[2,1]],{t3,0},{0,t3}],
t2 p[]+(1-t2)p[]-If[p[[1,1]]==p[[2,1]],{t3,0},{0,t3}],
p[]}]]&;

LayeredGraphPlot[ {{"i" -> "m", 1}, {"i" -> "...", 1}, {"i" -> "n", 1},
{"m" -> "j", 2}, {"..." -> "j", 2}, {"n" -> "j", 2}},
DirectedEdges -> True, VertexLabeling -> True,
PlotStyle -> {FontSize -> 14},
EdgeRenderingFunction -> (Switch[#3, 1, {Dashed,Arrow[bC[][#],.1]}, 2, {Arrow[#1, .1]}] &)] • Why did you reopen this question, please? – Mr.Wizard Apr 8 '15 at 23:00
• @Mr.Wizard, I was puzzling over why this q/a was reopened and appeared with a "modified by kguler" tag. I must have inadvertently clicked the reopen button. Sorry. – kglr Apr 8 '15 at 23:16
• That's okay. It just surprised me as I didn't see any precipitating comments or recent edits. Why don't you close it now? I think this was the previous duplicate if I am reading the timeline correctly. – Mr.Wizard Apr 9 '15 at 0:57
• Mr.Wizard, how come my accidental click made the previous close votes and links disappear? – kglr Apr 9 '15 at 1:01
• You have the Gold tag badge for plotting (and list-manipulation) which gives you moderator-like single vote power to close (and apparently reopen) duplicates in this tag. Use it wisely. :-) (Possible duplicate: comments are automatically deleted when the close occurs.) – Mr.Wizard Apr 9 '15 at 1:22