Drawing Random Graphs
Posted by Kaya Kupferschmidt • Monday, January 31. 2005 • Category: ProgrammingSo I tried to implement my own drawing routine, the picture gives you an idea of my last results. This picture was produced with the following idea: Given any graph, I first assign a random 2d position to each node. Of course this will look even more awfully than the Maple plots. But then I interpret all edges as springs with a naturla length proportional to the least number of edges of both nodes which are connected by the edge. Then I run a relaxation algorithm which at each step takes one random node and applies the forces to that node induced by the springs. In order to spread all outgoing edges of a given node, I also apply some repulsion force induced by all indirect neighbors (taking into account all other nodes for repulsion would slow the algorithm down far too much).
Unfortunately I am still not satisfied with the result, I have some more ideas which could improve this model, but Maple would not be the language of choice for an implementation, so either I will implement my ideas in C++ or I will try to find a totally new approach to the problem.
The problem itself is very interesting and has many aspects - this starts with the simple question which graphical representation is the best for a given question concerning a random graph. There is no such thing like "the" correct solution, it is also a matter of aesthetic considerations.
Kaya



