But the edges are crossing a lot... Is there a kind of algorithm to sort the nodes to remove the crossing or I ask to much ?
What you are asking for is not trivial actually :-) There is the sugiyama layout which is exactly about that: minimizing edge crossing. I do not know how does it fit in your situation. Have you tried to order the elements of each layers, according to what there is in the above layer? I would guess this result in something reasonable.
Alexandre