Well, in a half an hour I have to go to some boring 3h meeting and have to have something to think about. If you want, you can think about it, too. And here goes the challenge:

Let's say we have 8 machines, each communicates with every other one. Amount of data, which is exchanged between every two machines is defined (

perl -le "for$x(0..7){for$y($x+1..7){$f[$x][$y]=$f[$y][$x]=int rand 10 +0}} $f[$_][$_]='-' for 0..7; print join' ', @$_ for @f"
):

 - 38 72 79 58 88 59 33
38  - 70 71 27 47 77 14
72 70  - 90 42 63 56 90
79 71 90  - 60 57 21 95
58 27 42 60  - 28 33 52
88 47 63 57 28  - 11 85
59 77 56 21 33 11  - 59
33 14 90 95 52 85 59  -

Now, we have to find such division of these 8 machines into two groups of 4 machines, that exchange of data between these two groups is minimal.

Original problem was, as my friend gave it to me, for 64 machines, and then result: two 32-machines groups had to be divided further to 4 16-machines groups, etc.

Brute force algorithm (C++) had problems even with 8 machines, now, after 6 years it should be little better. But it's not about brute force, is it? As I remember, we did something heuristic, we didn't found optimal solution. But as I have 6 years more experience and a meeting will be long, and nothing better to do, let's find some solution :)

Update 2009-03-12 08:47 GMT: "Divide" challenge app added


In reply to "Divide" challenge by grizzley

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.