How to force line do not cross node in sfdp

digraph {
layout="sfdp"

A->B

A->C

D->B

E->D

B->E

E->C

E->A

C->D

F->C

B->G

A->G

D->G

E->G

H->G

B->H

H->A

D->H

F->B

H->E

F->E

B->C

B->I

C->I

A->I

D->I

I->G
}

[dot]

digraph {
layout=“sfdp”

A->B

A->C

D->B

E->D

B->E

E->C

E->A

C->D

F->C

B->G

A->G

D->G

E->G

H->G

B->H

H->A

D->H

F->B

H->E

F->E

B->C

B->I

C->I

A->I

D->I

I->G
}

[/dot]

there is a line cross node G. how to avoid those situation?

Please provide the input file.

Provided in the main post now

Using the splines attribute will prevent the edges from crossing the node faces - see below.
*sfdp is arguably not the “best” layout engine for this graph. sfdp was designed to handle much larger graphs. It works, but neato and fdp are probably better suited for graphs of this size. neato in particular has the mode and model attributes that will give different layouts.

thanks, I will try splines

for fdp and neato, things look like worse.
neato

fdp

Actually, I was using circo before. Force node alignment by circle solves the problem of lines passing through nodes

just for fun (many lesser results not included)

thanks.
These nodes should not have an order, so I do not use dot layout.
I will check other layout.