13.07.2015 Views

Masters Thesis - TU Delft

Masters Thesis - TU Delft

Masters Thesis - TU Delft

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6.3.2 Region Growing 1.1 algorithmThe main difference, between the improved version and the original one lies in the change inthe comparison procedure. Rather then comparing in each outer loop, the degrees of freedom ofthe chosen Element with the Elements taken in the inner loop to see, whenever both Elementsare connected, we now remember each degree of freedom of Elements already included in thearray and compare them with the ones of the checked Element. This tightens up the wholeprocedure considerably, because in each call of the function we have already checked to see itif the Element is connected with any of the Elements from the area which are known at thistime.We also notice, that if an Element is connected with the area, then it is included to thearea, which means that the next Element which will be checked will be checked whenever itis also connected with the just included Element. Those two advantages makes this RegionGrowing algorithm a version which can and should be used instead of the first one.6.3.3 Region Growing 2.0 algorithmWe see that both algorithms do not use any information about the connectivity of the Elements,which implies that if we have two disjointed areas of the same material type, then whenwe "discover" the first one, we will always check all Elements from the second one, if theyare connected with it. This leads to the conclusion, that we will have plenty of unnecessaryfunction calls. Also if we manipulate the example used to show how many comparisons we needto perform, namely we would then change the enumeration, then we could end up again withthe same number.For that reason we decided to get more information about the Elements, to have a better algorithmfor recognition of the areas of the same material type. We receive information aboutthe neighbours of an Element. With this, we can now rewrite our algorithm to a form wherewe will not do any unnecessary calls function. Actually, our problem can now be seen, asfinding spanning trees in a graph, which is a well known problem in the Graph Theory and hasseveral algorithms for finding them. Because in our case each call of the function is regardedas the same in the sense of cost to perform it, we can easily choose for our problem the BFS(Breadth-first search) algorithm as the optimal tool.A spanning tree of a connected, undirected graph G, is a tree composed of its vertices. Formore information, see [15].We conclude this section with a table which shows the CPU time for each of the presentedalgorithms to find each area for Problem 6 [see Appendix 8.1]:AlgorithmVersion 1.0Version 1.1Version 2.0Time493.717990 seconds.5.24848 seconds0.673795 seconds.Table 6.1: CPU time for Region Growth AlgorithmsWe can find Matlab implementations of versions 1.1 and 2.0 in the Appendix (8.2).34

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!