Изменения

Перейти к: навигация, поиск
Псевдокод
}}
====Псевдокод===={||''Initialization:''||<math>P \leftarrow \emptyset </math><br/>'''Init_pop'''<premath>Discrete Space Hill Climbing Algorithm currentNode = startNode; loop do L = NEIGHBORS(currentNodeP);</math> nextEval = |-INF; nextNode = NULL;|''Main Loop:''||<math>x_1 \leftarrow </math>'''Rand_mem'''<math>(P)</math>,<math>x'_2 \leftarrow </math>'''Rand_mem'''<math>(P)</math><br/> for all <math>x in L '_1 \leftarrow </math>'''Mutate'''<math>(P)</math>,<math>x_2 \leftarrow </math>'''Mutate'''<math>(P)</math><br/> '''if '''<math>(EVALH(x_1,x'_1)+H(x_2,x'_2) > nextEvalH(x_1,x'_2)+H(x_2,x'_1))</math><br/> nextNode = :'''Swap'''<math>(x_1,x;'_2)</math><br/> nextEval = EVAL'''if''' <math>f(x'_1);> f(x_1)</math><br/>: <math>P \leftarrow P \cup x'_1 \setminus x_1</math><br/> '''if nextEval ''' <= EVALmath>f(currentNodex'_2) > f(x_2)</math><br/Return current node since no better neighbors exist> return currentNode;: <math>P \leftarrow P \cup x'_2 \setminus x_2</math> currentNode = nextNode;|-|''Termination:''||'''return Best'''<math>(P)</premath>|}
== Задачи ==
Анонимный участник

Навигация