I would like to create a network graph with curved edges. To do this, I wrote this function:
edgeFun[pts_, e_] := Module[{controlPts}, controlPts = pts /. {a_, b_} :> {a, {a[[1]] + .1 b[[1]], a[[2]]}, {a[[1]] + 0.1 b[[1]], b[[2]]}, b}; BezierCurve[controlPts] ]; With no multiedges the edgeFun function works fine:
pts = {1 -> 2, 2 -> 3, 3 -> 1}; Graph[pts, VertexLabels -> Placed["Name", Center], EdgeShapeFunction -> edgeFun] 
But when I want to create a network with multiple edges (note 1 -> 2 and 2 -> 1, Mathematica complains and the graph is pinked out:
pts1 = {1 -> 2, 2 -> 3, 3 -> 1, 2 -> 1}; Graph[pts1, VertexLabels -> Placed["Name", Center], EdgeShapeFunction -> edgeFun] Part::partd: "Part specification 0.496922[[1]] is longer than depth of object"
Does anyone know how to solve this problem?



Graphis greating curved edges so those are not just{point1, point2}typeLines. At the end the problem is your replacement rule which is not well suited for those lists. $\endgroup$"EdgeLayout"that curves edges. $\endgroup$