Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

算法询问 #1

Open
26273 opened this issue Dec 22, 2021 · 6 comments
Open

算法询问 #1

26273 opened this issue Dec 22, 2021 · 6 comments

Comments

@26273
Copy link

26273 commented Dec 22, 2021

你好,请问广度优先搜索的算法体现在哪,我没有看懂 @rockcarry

@rockcarry
Copy link
Owner

search 函数就是广度优先搜索

@26273
Copy link
Author

26273 commented Dec 23, 2021

你好,请问search函数有更为详细的注释吗,一些变量如start,opnum,cutval之类的我不知道他的含义 @rockcarry

@26273
Copy link
Author

26273 commented Dec 23, 2021

请问评估函数是newstate和newvalue吗 @rockcarry

@rockcarry
Copy link
Owner

cube_check_state 是评估函数吧。代码写太久了,我也不太记得了。你先研究下。

@rockcarry
Copy link
Owner

rockcarry commented Feb 8, 2022

newstate = cube_check_state(newcube, 0 ); // 计算当前状态
newvalue = cube_check_state(newcube, state); // 这个是评估函数

@rockcarry
Copy link
Owner

rockcarry commented Feb 8, 2022

search 函数就是广度优先搜索,open 表示先进先出,因此广度优先。没有 close 表,因为搜索的空间太大,实测加上 close 表并判断扩展出的节点是否存在于 close 表中,耗时反而大大增加。

为了提高搜索,采用了分步搜索的方法,同时对4个连续相同的 op 进行剪枝,对评估值下降非常严重的扩展节点进行剪枝

后面我会增加一些注释到代码里面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants