In my master's thesis, I was generating component graphs from source code.
One issue I had was the generated graphs were suuuuper ugly due to the connections between components overlapping in a non-optimal way. Turns out, untangling graphs is a NP-HARD problem. I got around it by using a spring-repulsion simulation, where connections between components pulled them together but components repelled other components when they got close. It wasn't a perfect solution, but it got me 90% of the way!
It's such a powerful technique and it's so simple to implement! I used the same technique for putting a bunch of icons on a map and making sure they were as close as possible to their target position without overlapping.