python深度优先搜索传教士和野人_ai1 带回溯的深度优先策略:解决经典野人传教士过河问题的求解:三个修道士和三个野人过河 - 下载 - 搜珍网...

带回溯的深度优先策略:解决经典野人传教士过河问题的求解:三个修道士和三个野人过河,船一次最多只能载两个人,在任何时候修道士的人数不能少于野人人数,否则野人会吃掉修道士。找出六个人顺利过河的所有方案。

采用带回溯的深度优先搜索策略,共定义了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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值