Given a graph whose edges have defined lengths, how can I draw it on a plane? In general, this cannot be done faithfully. The edge lengths could easily fail the triangle inequality, but even if they do satisfy the traingle inequality it could still be impossible. Instead of going for a perfect solution, how could we approximate a solution?

The idea implemented here is to think of each edge as a spring, whose natural length is the given edge length. Then applying Hooke's law, we can allow the system to relax until a stable configuration is found. Move the slider to the right to watch the springs relax. I should also mention that since some nodes may have way more edges than others, the force on each node has been divided by the number of edges it has.

The Indiana button below brings up a travel-time map of Indiana, which came from AAA. Go ahead and have a look at it after being deformed in this way. Can you identify which Indiana city is really more of an Illinois city? Can you tell where the traffic is clearly terrible?

Nodes: (x,y)

Node Prescale:

Edges: (vertex,vertex,length)

This was created by Alden Bradford on November 17th, 2018. This is most likely nowhere close to the best way to solve this problem. Revised November 21. Revised December 2.