As described in class, in this project you will write and run a simple GA to solve the problem of partitioning a graph into two parts such that:
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.
The input to your program is simply:
5 0.000000 0.694844 0.389750 0.383836 0.000000 0.694844 0.000000 0.282904 0.000000 0.000000 0.389750 0.282904 0.000000 0.536894 0.000000 0.383836 0.000000 0.536894 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
This says, for example, that the arc from node 0 to node 1 has a weight of 0.694844 (as does the arc from node 1 to node 0). The partitioned weight sum is simply the sum of all weights that correspond to arcs between nodes in different parts. Thus, if nodes 0 and 1 are in different parts, that fact contributes 0.694844 to the sum twice, once for the arc in each direction.
You have been provided with a program that creates such a graph: mkg.c.
Your GA's output can be fairly verbose, but must include the list of node numbers in first part and the total cost of that partitioning.
The limit of 31 nodes is intended to simplify encoding using a single 32-bit int; using 31 instead of 32 bits neatly avoid the signed vs. unsigned shift issue. To count the 1 bits in 31-bits of int, you can use something like the code on the magic algorithms page.