Q about Genetic programming
I have an assignment for uni, that goes as follows:
You have a given communications network (a list of servers, and connections between them), your task is to disable it. A network is disabeled when there is no pair of connected servers. Disable the network by removing the least amount of servers.
Now, I've made all of the backbone work on this, defined all the data structures, and came up with a naive algorithm that doesn't guarrantee a solution that is close to optimum (just remove the server with the most connections). Our teacher gave us a tip to look up genetic programming, as that is a neat way to get a solution that is pretty close to optimum. So, I looked up a few tutorials on the matter, and got to coding. The problem is, my algorithm hits a sort of threshold that it just can't stump over and keeps looping indefinately. I've implemented all the necessary operators (crossover, mutation, roulette selection for "breeding" etc.), so I'm kinda stumped. The encoding I used is an array of booleans, each representing one server (true = server working, false = server destroyed), and my fitness function is defined as num. of connections/num. of active servers, so once I hit 0, I found a solution. From what I understand of genetic programming, the purpouse of mutation is avoiding getting stuck in some local optimum, but that's exactely what's happenning. So before I paste any code up, I'd like to ask if anyone here has any experience with this matter (I'm looking at you JosAH! :D) who'd be willing to read a few lines of code.