ai1

所属分类:数值算法/人工智能
开发工具:Visual C++
文件大小:3KB
下载次数:23
上传日期:2010-01-14 10:46:03
上 传 者shine1270
说明:  带回溯的深度优先策略:解决经典野人传教士过河问题的求解:三个修道士和三个野人过河,船一次最多只能载两个人,在任何时候修道士的人数不能少于野人人数,否则野人会吃掉修道士。找出六个人顺利过河的所有方案。 采用带回溯的深度优先搜索策略,共定义了7种合法操作{2,0,0},{1,0,0},{1,1,0},{0,1,0},{0,2,0},{0,1,1},{1,0,1}代表上船的人数,根据船所在位置决定在状态上是加或者减操作。扩展结点时按顺序应用操作,知道回溯到初始状态且所有操作用完,程序结束。
(With a backtracking depth-first strategy: to solve the classic problem solving Savage missionaries across the river: three monks and three Savage across the river, the ship only contained a maximum of two people, the number of monks at any time not less than the number of Savage Otherwise, Savage will eat monks. Smoothly across the river to find six people to all programs. Used with a backtracking depth-first search strategy, a total of seven kinds of legal action defined (2,0,0), (1,0,0), (1,1,0), (0,1,0), (0 , 2,0), (0,1,1), (1,0,1) represents the number of people on board, according to vessel location decision is plus or minus state operation. Extension junction point, application and operation in order to know back to the initial state and all the operations used up, the process has been completed.)

文件列表:
ai1.txt (12617, 2010-01-02)

近期下载者

相关文件


收藏者