output dot in cluster mode; fix edge connection bug