|
-
July 13th, 2012, 05:46 AM
#1
organizing nodes connected with lines in 2d space
Hello,
I need to do the following. I have some nodes, which i display into a graph (using x,y coordinates). Nodes have specific width. Nodes, are connected to each other using straight lines, so it is like i.e. putting rectangles into a 2d space, while these boxes are connected to each other with lines. I am looking for an algorithm which i should implement, that would find the best possition {x,y} for the boxes so that:
1. Boxes are alligned, i mean if BoxA,Box B are put one next to another, y to be exactly the same...
2. Boxes connected to each other are as close as possible.
3. Lines connecting boxes do not pass above boxes
4. Where possible, lines are not crossing each other.
These rules are on the top of my head.. The general idea is that i wish this graph of nodes/lines, to be presented in a relativelly nice way to user... My current implementation is putting these nodes, randomly and the result is not nice. Anyone can point me to the correct direction to search. Even if this is a keyword in google that will put me in the right track would be helpfull because anything i found up to now was not much of a help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|