gants has asked for the wisdom of the Perl Monks concerning the following question:

hello everyone! I need a suggestion about maps programming with perl. Well, I did the map engine which must be depict multiply nodes. I made it by xml rendering, it's part I completely done, but have a question related environs nodes and them neighbors. Actually I divide them on the group's and compute radius for everyone, but radius depend of quantity neighbor nodes connected to the some node. I've got height & width some sheet by counting whole nodes while compute coordinates for everyone.
$x = (cos($arc)*$R+$xC); $y = (sin($arc)*$R+$yC); $xC += 1; $yC += 1;
but it's so stupid way so as get it. I need depict nodes and use whole space of my sheet and also group's of nodes should be nearly of them neighbors by group. i.e. if node A have five neighbors them must be founded on one circle radius distance of them root(A node), and so on for any other nodes. but how compute free space and grouping nodes(which neighbors of them neighbors) and gave them nearest coordinates.

Replies are listed 'Best First'.
Re: edge of polygon
by moritz (Cardinal) on Oct 14, 2009 at 10:45 UTC
Re: edge of polygon
by spx2 (Deacon) on Oct 14, 2009 at 11:37 UTC
Re: edge of polygon
by FloydATC (Deacon) on Oct 14, 2009 at 12:46 UTC
    Let me take a leap of faith here... If I understand your question correctly, you want to draw a map of network nodes or a similar tree-like structure.

    Calculating the optimal sector width for each child node is probably just a matter of guessing and adjusting until an acceptable solution is found. You may also want to play a little with other map-drawing software (I use Nagios and yED a lot) to see if any good ideas pop up.

    Just don't expect one generic algorithm to be perfectly for all data sets, I doubt that's even possible.

    -- Time flies when you don't know what you're doing