layout todo multipl associ pair element need special case don overlap tfm self associ special case need let maze runner wai dest fig node sourc fig node point center right center right fig node sourc fig node yoffset sourc fig node height yoffset java lang math min self size yoffset fig poli fig underli fig fig add point center right right fig add point center right self size center right fig add point center right self size center right yoffset left fig add point center right center right yoffset fig set fill fig set self loop current edg set fig fig brute forc rectangular layout point center sourc sourc fig node center point center dest dest fig node center underli fig add point center sourc center sourc underli fig add point center sourc center dest center sourc center sourc underli fig add point center sourc center dest center sourc center dest underli fig add point center dest center dest underli fig set fill underli fig set self loop current edg set fig underli fig 