Function createEdge