Skip to content

Possible issue in search.ipynb #1124

@gobber

Description

@gobber

Hello everyone.

First, I would like to say thank you for AIMA, it is really a good library. However, I guess there is an issue in search.ipynb. In TSP problem example, the condition in hill_climbing should not it be:

if problem.value(neighbor.state) >= problem.value(current.state):

instead of:

if problem.value(neighbor.state) <= problem.value(current.state):

Because, the TSP_problem.value() method is negative (inverted path cost) and you use argmax, then I conclude that you should consider a best neighbor one that is greater then the current. Am I wrong? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions