graph g { { rank="same"; 1; 2; } { rank="same"; 4; 3 [ style="invisible" ]; } 1 -- 2; 1 -- 3 [ style="invisible" ]; 1 -- 4 [ style="invisible" ]; 3 -- 2 [ style="invisible" ]; 2 -- 4; 2 -- 5; }