Creating an auto-layout algorithm for graphs