Implement an efficient search system with Artificial Intelligent search algorithms (greedy best-first search and A* search) for path search engine in C++, consuming only 0.01% of searching time and memory usage as compared with another approach with breadth-first search.
Searching by bfs ...
Minimum steps: 5, Total steps: 1118480
Time taken by breadth first search: 15530117 microseconds
Searching by A* search ...
Minimum steps: 5, Total steps: 96
Time taken by A* search: 1668 microseconds
Optimal path:
Array 0 :
0 0 0 0
0 0 0 1
0 1 0 1
0 1 0 0
Array 1 :
0 1 0 0
0 0 0 1
0 0 0 1
0 1 0 0
Array 2 :
0 1 0 1
0 0 0 1
0 0 0 0
0 1 0 0
Array 3 :
1 0 1 0
0 0 0 1
0 0 0 0
0 1 0 0
Array 4 :
1 1 1 0
0 0 0 1
0 0 0 0
0 0 0 0
Array 5 :
1 1 1 1
0 0 0 0
0 0 0 0
0 0 0 0