-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
-
Improve searching for visited boards using hashing
the current traverses the array visited containing boards O(n).This operation is done for every next move possible
let visited=[]; for(let board of visited) if(isBoardSame(board,child)) found=true;
this could be improved by hashing make visited a hash table,to implement it a unique key needs to be created for every board this can be done using creating string in sequence of the array
-
change priority to hamming distance from moves+hamming distance
this.priority=this.hamming();
change it to
this.priority=this.move+this.hamming();
start node would have 0 moves for every child moves =parent.moves+1
-
use Manhattan distance instead of hamming distance
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers