Coder Social home page Coder Social logo

算法询问 about cube HOT 6 OPEN

rockcarry avatar rockcarry commented on July 18, 2024
算法询问

from cube.

Comments (6)

rockcarry avatar rockcarry commented on July 18, 2024

search 函数就是广度优先搜索

from cube.

26273 avatar 26273 commented on July 18, 2024

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

from cube.

26273 avatar 26273 commented on July 18, 2024

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

from cube.

rockcarry avatar rockcarry commented on July 18, 2024

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

from cube.

rockcarry avatar rockcarry commented on July 18, 2024

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

from cube.

rockcarry avatar rockcarry commented on July 18, 2024

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

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

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

from cube.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.