PDF Publication Title:
Text from PDF Page: 172
150 6 ⋅ software The critical graph operation in Dijkstra’s algorithm is accessing the out- edges of an arbitrary vertex. The approach used in the dijkstra_slow imple- mentation above is to transpose the sparse matrix and work with the Matlab matrix structure directly. For each out-edges query, this approach involves extracting a column and using the find function to get the non-zeros.18 An alternative is to convert the sparse matrix into a compressed sparse row struc- ture on every call. Using this approach, we obtain even better performance. Elapsed time is 1.052805 seconds. In gaimc, then, we first convert any Matlab sparse matrix input to a com- pressed sparse row data structure for the graph operations. A support func- tion sparse_to_csr performs this simple conversion. All gaimc functions also accept a structure with the compressed sparse row arrays pre-computed. Another advantage of using our own compressed sparse row structure occurs when the graph has edge weights of 0. The Matlab sparse matrix structure removes such entries [Gilbert et al., 1992]. Based on this analysis, we offer some advice to optimize Matlab functions: • donotusefunctioncalls • evaluateperformanceofbuilt-inMatlabfunctions • questionperformanceassumptions. While just-in-time compiled Matlab code may not be as fast as optimized C or C++ code, it need not be slow. 6.4.3 Performance In the previous sections, we have reviewed how to implement a heap structure in Matlab, and optimized the performance of an algorithm using the heap. In this section, we compare the performance of gaimc to MatlabBGL. Writing native Matlab code does not offer the same performance as native C or C++ code and we evaluate gaimc by how much slower the routines are compared with their C++ Boost graph library counterparts. In our tests, we plot the slowdown ratio tgaimc s=, tMatlabBGL where tgaimc is the time of an operation in gaimc and tMatlabBGL is the time of an operation in MatlabBGL. Thus, a slowdown ratio around 1 implies that the routines took roughly the same amount of time. We evaluate the performance of 6 functions: 1. depthfirstsearch(dfs), 2. strongcomponents(scomponents), 18 Recall that Matlab stores sparse matrices using the compressed col- umn format [Gilbert et al., 1992] and thus we’d need to extract columns for efficiency.PDF Image | Instagram Cheat Sheet
PDF Search Title:
Instagram Cheat SheetOriginal File Name Searched:
pagerank-sensitivity-thesis-online.pdfDIY PDF Search: Google It | Yahoo | Bing
Cruise Ship Reviews | Luxury Resort | Jet | Yacht | and Travel Tech More Info
Cruising Review Topics and Articles More Info
Software based on Filemaker for the travel industry More Info
The Burgenstock Resort: Reviews on CruisingReview website... More Info
Resort Reviews: World Class resorts... More Info
The Riffelalp Resort: Reviews on CruisingReview website... More Info
CONTACT TEL: 608-238-6001 Email: greg@cruisingreview.com (Standard Web Page)