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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |