Fellow monks,
I'm looking for a solution of an visualisation problem. I want to print the clusters and machines in an computing environment to an overview page.
I have some 8-node clusters (one may grow soon to an 10-node cluster), much more 4-node and 2-node clusters and also standalone machines. We can assume even numbers of machines in the clusters.
I now want to create a printout which not distributes machines all over the printout, but groups the machines together, which are belonging to the same cluster.
c? ... cluster
m? ... machine
[|-] ... separates clusters
@ca = qw (ma mb mc md me mf mg mh); # 8-node cluster
@cb = qw (mi mj mk ml mm mn mo mp); # 8-node cluster
@cc = qw (mq mr ms mt); # 4-node cluster
@cd = qw (mu mv mw mx); # 4-node cluster
@ce = qw (my mz); # 2-node cluster
@cf = qw (m1 m2); # 2-node cluster
@cg = qw (m3 m4); # 2-node cluster
@ch = qw (m5); # standalone
@ci = qw (m6); # standalone
@cj = qw (m7); # standalone
@ck = qw (m8); # standalone
I don't want this, as this would be the easy solution :-)
(assumed a 10 columns output, should be configurable)
-----------------------------
|ma mb mc md me mf mg mh|mi mj
-----------------------------
mk ml mm mn mo mp|mq mr ms mt|
-----------------------------
|mu mv mw mx|my mz|m1 m2|m3 m4|
-----------------------------
|m5|m6|m7|m8|
-----------
What I'd like to have is this (or similar):
-----------------------------
|ma mb mc md|mi mj mk ml|mq mr|
| | | |
|me mf mg mh|mm mn mo mp|ms mt|
-----------------------------
|mu mv|my mz|m3 m4|m7|m8|
| |-----|-----|-----
|mw mx|m1 m2|m5|m6|
-----------------
My idea: take two lines per cluster, find the biggest clusters, that fit's into the current double line and fill the remaining columns with smaller clusters/standalone machines. Continue with the next two lines and fill in the remaining stuff. Any ideas about better algorithms (or even modules :-)) I could use?
Or some keywords to feed Google?
Thanks
Andreas
Update: fixed two times m1 in @cf
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.