0
我工作的管网优化,我代表的染色体为一串数字如下突变管道网络优化
例如
chromosome [1] = 3 4 7 2 8 9 6 5
,其中,每个数字代表以及并定义井之间的距离。因为一个染色体不能复制这些孔。例如
chromosome [1]' = 3 4 7 2 7 9 6 5 (not acceptable)
什么是可以处理这种表示的最佳突变?提前致谢。
我工作的管网优化,我代表的染色体为一串数字如下突变管道网络优化
例如
chromosome [1] = 3 4 7 2 8 9 6 5
,其中,每个数字代表以及并定义井之间的距离。因为一个染色体不能复制这些孔。例如
chromosome [1]' = 3 4 7 2 7 9 6 5 (not acceptable)
什么是可以处理这种表示的最佳突变?提前致谢。
不能说“最好”,但我用于类图问题的一个模型是:对于每个节点(井号),计算整个人口中相邻节点/井的集合。例如,
population = [[1,2,3,4], [1,2,3,5], [1,2,3,6], [1,2,6,5], [1,2,6,7]]
adjacencies = {
1 : [2] , #In the entire population, 1 is always only near 2
2 : [1, 3, 6] , #2 is adjacent to 1, 3, and 6 in various individuals
3 : [2, 4, 5, 6], #...etc...
4 : [3] ,
5 : [3, 6] ,
6 : [3, 2, 5, 7],
7 : [6]
}
choose_from_subset = [1,2,3,4,5,6,7] #At first, entire population
然后创建一个新的个人/网络:
choose_next_individual(adjacencies, choose_from_subset) :
Sort adjacencies by the size of their associated sets
From the choices in choose_from_subset, choose the well with the highest number of adjacent possibilities (e.g., either 3 or 6, both of which have 4 possibilities)
If there is a tie (as there is with 3 and 6), choose among them randomly (let's say "3")
Place the chosen well as the next element of the individual/network ([3])
fewerAdjacencies = Remove the chosen well from the set of adjacencies (see below)
new_choose_from_subset = adjacencies to your just-chosen well (i.e., 3 : [2,4,5,6])
Recurse -- choose_next_individual(fewerAdjacencies, new_choose_from_subset)
的想法是,具有大量的邻接节点已经成熟重组(因为人口没有收敛的,如,1-> 2),较低的“邻接计数”(但非零)意味着收敛,并且零邻接计数(基本上)是突变。
为了表明样品运行..
#Recurse: After removing "3" from the population
new_graph = [3]
new_choose_from_subset = [2,4,5,6] #from 3 : [2,4,5,6]
adjacencies = {
1: [2]
2: [1, 6] ,
4: [] ,
5: [6] ,
6: [2, 5, 7] ,
7: [6]
}
#Recurse: "6" has most adjacencies in new_choose_from_subset, so choose and remove
new_graph = [3, 6]
new_choose_from_subset = [2, 5,7]
adjacencies = {
1: [2]
2: [1] ,
4: [] ,
5: [] ,
7: []
}
#Recurse: Amongst [2,5,7], 2 has the most adjacencies
new_graph = [3, 6, 2]
new_choose_from_subset = [1]
adjacencies = {
1: []
4: [] ,
5: [] ,
7: []
]
#new_choose_from_subset contains only 1, so that's your next...
new_graph = [3,6,2,1]
new_choose_from_subset = []
adjacencies = {
4: [] ,
5: [] ,
7: []
]
#From here on out, you'd be choosing randomly between the rest, so you might end up with:
new_graph = [3, 6, 2, 1, 5, 7, 4]
完整性检查? 3->6
出现在原始1x中,6->2
出现2x,2->1
出现5x,1->5
出现0,5->7
出现0,7->4
出现0.因此,您保留了最常见的邻接关系(2-> 1)和另外两个“可能有意义”的邻接关系。否则,你在解决方案空间尝试新的邻接关系。
更新:最初我忘记了递归时的临界点,您选择了最连接的到刚刚选择的节点。这对保持高适应性链条至关重要!我已经更新了描述。
该问题是否可以归结为在连通图中查找[最小生成树](http://en.wikipedia.org/wiki/Minimum_spanning_tree)的问题? – Andreas