What is a Heuristic Function

后端 未结 6 841
离开以前
离开以前 2021-01-02 10:29

Can someone explain in very simple words what it is. Also provide an example. So for example if u have to find the heuristic function of something how is it supposed to look

6条回答
  •  孤独总比滥情好
    2021-01-02 11:08

    From wiki

    A heuristic function, or simply a heuristic, is a function that ranks alternatives in search algorithms at each branching step based on available information to decide which branch to follow.

    I.e. in chess, a Heuristic Function can rule out possible moves that will lead to a worse position (or even loss) for a player and not further analyze the following moves since the result will not get any better.

    Doing so the function can search more moves in a shorter time period since it doesn't waste time looking at bad moves.

提交回复
热议问题