10.07.2015 Views

Data Communications Networking Devices - 4th Ed.pdf

Data Communications Networking Devices - 4th Ed.pdf

Data Communications Networking Devices - 4th Ed.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.1 BRIDGES _____________________________________________________________________ 553or lengths of the links or tree edges differ, then different tree structures will havedifferent weights. Thus, the identi®cation of the minimum spanning tree requiresus to examine each of the spanning trees supported by a graph and identify thestructure that has the minimum length or weight.The identi®cation of the minimum spanning tree can be accomplished by listingall spanning trees and ®nding the minimum weight or length associated with thelist. This is a brute force method that always works but is not exactly ef®cient,especially when a graph becomes complex and can contain a signi®cant number oftrees. Afar better method is obtained by the use of an appropriate algorithm.Kruskal's algorithmThere are several popular algorithms developed for solving the minimum spanningtree of a graph. One of those algorithms is Kruskal's algorithm which is relativelyeasy to understand and will be used to illustrate the computation of a minimumspanning tree. Since we need weights or lengths assigned to each edge or link in agraph, let's revise the network graph previously shown in Figure 5.9 a) and addsome weights. Figure 5.10 illustrates the weighted graph.Figure 5.10A weighted network graphKruskal's algorithm can be expressed as follows:1. Sort the edges of the graph G) into increasing order by weight or length.2. Construct a subgraph S) of G and initially set it to the empty state.3. For each edge e) in sorted order, if the endpoints of the edges e) aredisconnected in S, add them to S.Using the graph shown in Figure 5.10, let's apply Kruskal's algorithm as follows:1. Sorting the edges of the graph into increasing order by weight or lengthproduces the following table:<strong>Ed</strong>geWeight/lengthA±C 1B±D 3C±B 4C±D 6A±B 8

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

Saved successfully!

Ooh no, something went wrong!