As described in class, in this project you will write and run a perhaps not-so-simple GA to solve the problem of designing a Fractional Flat Neighborhood Network (FFNN).
A FFNN is a special class of computer network design in which nodes are connected to switches in a pattern that allows as many as possible specified pairs of nodes to meet in at least one switch. In other words, the goal is to find a network design that covers as many as possible of the specified pairs. There are three constraints:
Constraint 1 is essentially the same constraint used in the standard graph covering problem: the maximum subset size. The second and third constraints are not part of the standard graph covering problem. If we were building a "universal" FNN and did not have the second constraint, the design problem would be precisely the (v,k,t)-covering design problem in which v is the node count, k is the number of ports per switch, and t is 2. In fact, you should browse some of the discussion at the La Jolla Covering Repository to get some insights as to how the SFNN design problem can be approached without using a GA. These are not bad starting points for how to make your GA "smarter."
The GA structure is entirely up to you. In fact, you need not code your GA from scratch; it is perfectly allowable for you to use an existing GA library or tool to create your GA... although I wouldn't recommend that.
The input to this program looks a lot like the input to your previous program... in fact, it can be identical. The only problem is that randomly-placed weights are much harder to cover than weights corresponding to common communication patterns in real parallel programs, so don't be surprized if your GA has trouble finding complete coverings for borderline cases. Then again, that's why you're doing an FFNN and not an SFNN: for an SFNN, you have to cover all specified pairs, not just as many as you can. The assignment input can be summarized as differing from the previous project in that:
The mkg.c program from the previous project can make reasonable input... but a different program is being created to generate better designs. For the moment, Tim Mattox has provided a version of his tool called mkpairs.c; it can be used to create the input specifications for this project. For example, to create the design specification for KASY0's network:
The run will give you some debugging output (to stderr) like:
Pattern Generated: 1D torus +/- 1 offsets Pattern Generated: 2D torus all of row and col ( 16, 8) Pattern Generated: 3D torus all of row and col ( 8, 4, 4) Pattern Generated: bit-reversal Pattern Generated: hypercube PairCt = 1536, Min = 23, Avg = 24.00, Max = 25, flags = 02010770
To design a network suitable for KASY0, you would use the resulting file, kasy0spec, as input and give command-line arguments telling your program that there are 3 NICs/node and 23 ports/switch.
Don't expect your design to match the one we used... that's highly unlikely. Your design doesn't even have to be as good for you to get full credit. You have have to have done something reasonable in the coding of the problem to be solved by a GA.
Every weighting table entry is worth some value between 0 and 1. The score of a particular network design is simply the sum of all the weighting pairs it covers. You want to find a wiring pattern for which this sum is maximized. If you find a wiring pattern that has the theoretically maximal value, you should stop immediately -- not continue the search for another generation.
As a minimum, your program should output the score for the best network design it found and the complete wiring pattern in the same format we have described all along: each line starts with the switch number followed by a colon and the list of node numbers that are connected to that switch. For example, KASY0's actual SFNN design is:
0: 0 15 16 31 32 47 48 63 64 79 80 95 96 111 112 120 121 122 123 124 125 126 127 1: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 24 40 56 72 88 104 120 2: 7 23 39 55 71 87 103 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 3: 2 10 18 26 33 34 35 37 42 43 44 45 46 50 58 66 74 82 90 98 106 114 122 4: 5 13 21 29 37 45 53 61 69 77 81 83 84 85 86 89 92 93 94 101 109 117 125 5: 1 9 17 25 33 41 49 57 64 65 67 68 70 73 75 76 78 81 89 97 105 113 121 6: 4 12 16 18 19 20 22 23 27 28 30 36 44 52 60 68 76 84 92 100 108 116 124 7: 3 11 19 27 35 43 51 59 67 75 83 91 96 98 99 102 103 104 107 109 110 115 123 8: 6 14 22 30 38 46 48 50 53 54 55 56 59 60 62 70 78 86 94 102 110 118 126 9: 32 36 38 39 40 41 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 10: 2 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 69 71 72 73 74 79 11: 64 65 66 67 68 69 70 71 72 74 75 76 77 78 79 80 82 87 88 90 91 93 95 12: 5 17 20 21 24 26 29 31 80 81 82 83 84 85 86 87 88 89 90 91 92 94 95 13: 7 8 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 100 101 105 111 14: 66 73 77 85 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 117 119 15: 49 51 52 54 57 58 61 62 63 65 93 97 99 106 107 108 113 114 115 116 118 119 127 16: 0 1 3 4 6 8 9 10 11 12 13 14 25 28 34 42
Although KASY0's design is given with nodes connected to each switch listed in increasing node number order, your listing need not order node numbers within each switch.
Here's a good approach: