Skip to content

Modify for making the code readable  #4574

@Miltonbhowmick

Description

@Miltonbhowmick

Sharing Knowledge

In the a_star algorithm, 47th line makes less readable code from my point of view.
f = g + heuristic[init[0]][init[0]]

Moreover, Does heuristic[init[0]][init[0]] not be heuristic[init[0]][init[1]] ?

Two variables x and y have been already initialized by init[0] and init[1]. Doesn't it seem good to read if we make 47th line as below?
f = g + heuristic[x][y]

PR: 2318424

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