I have not asked about the knapsack problem using a genetic algorithm. the initialization I use this kind of chromosomes [1] = [weight] [profit], because his formula KP on chromosome evaluation weight x profit. nah after entry using roulete wheel selection. in to开发者_开发问答 p (a) = 0.04761/0.19761 = 0.24092; p (b) = 0.1/0.19761 = 0.50604; p (c) = 0.025/0.19761 = 0.12651. then setelag that generate random numbers, after the random numbers can be, how will the cross-over?
please explain, please help me
your chromosome structure is wrong. chromosome should present the solution all choices. Ex for knapsack, chromosome may be a set of selected objects index. then you calculate the whole weight.
精彩评论