tags:

views:

364

answers:

3

I want to draw a map some cities in a software that I am designing. I want to know the algorithm for placement of circular nodes on screen (so they dont overlap each other) Please explain in relation to JAVA GUI programming if possible

+1  A: 

In Java yEd has a nice library for it.

Martin K.
+1  A: 

Two circles don't overlap, if the sum of their two radii (radius) is less than the distance between their two centres.

  1. Place a circle A at point P1 with radius R1
  2. Place a circle B at point P2
  3. Calculate the distance D between P1 and P2
  4. The circles won't overlap of the radius of B is less than D minus R1.
ChrisW
A: 

Sorry for posting this question. A similar question has already been answered The links are:

http://stackoverflow.com/questions/518685/graph-drawing-algorithms-im-trying-to-render-finite-state-automata

http://stackoverflow.com/questions/69275/drawing-a-web-graph

avd
I take it that you want this question deleted.
ChrisW
No please dont remove the question. I have edited the question. Now my question is different
avd