How to link vertices properly?

Hi,

I search a methode to link vertices properly.

I simply linked the vertices in index order with Bmesh.
bm.edges.new((bm.verts[vertex_index - 1], bm.verts[vertex_index]))
But the result is not perfect.

Is there a trick for that ? Or should I code a function wich link each vertex with the more closeth vertex ?