How to speed up my code?
Show older comments
Hi all,
I have written a BFS (path planning) algorithm and although it works perfectly fine with small grids (e.g. 20x20) when the grid gets larger (e.g. 150x250) due to the matrix representation I have used, the size of the adjacency matrix* becomes enormous (37901x37901) which as expected takes forever (over 10 hours) to find the path from initial node to goal node. I am using MATLAB 2016a and it is running on Nvidia GeForce 840M.
Question 1: Could it be quicker if I run it on my Intel Processor (Intel Core i7-4510U CPU@ 2.00GHz, 2601MHz, 2 Cores, 4 Logical Processors)?
Question 2: As C++ is a more efficient language, if I generate a C++ from my MATLAB code using MATLAB Coder, whould it speed up the process? If yes, by how much (approximately)?
*Adjacency matrix is the matrix that stores the connection information between nodes.
Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!