From: Richard Whitehouse Date: Tue, 17 May 2011 13:31:58 +0000 (+0100) Subject: Enumerate list properly X-Git-Url: https://git.richardwhiuk.com/?a=commitdiff_plain;h=7f73b794506f7482504d94db6a3535d77449380b;p=ii-diss.git Enumerate list properly --- diff --git a/implementation.tex b/implementation.tex index 851312f..3ca31a3 100644 --- a/implementation.tex +++ b/implementation.tex @@ -138,15 +138,19 @@ The spanning tree algorithm is implemented using a priority queue and two maps. The algorithm executes in the following way. -* The root bridge with the smallest MAC address (in my implementation, this is always numbered 0, as switch MAC address are assigned increasing from 00:00:00:00:00:00) is chosen. +\begin{enumerate} -* The bridge is marked as part of the tree, and each of its links are added to the queue with the cost of traversing the link as the weight. +\item The root bridge with the smallest MAC address (in my implementation, this is always numbered 0, as switch MAC address are assigned increasing from 00:00:00:00:00:00) is chosen. -* The first link is then removed from the queue. If the bridge it points to is already in the tree, then it is discarded. +\item The bridge is marked as part of the tree, and each of its links are added to the queue with the cost of traversing the link as the weight. -* Otherwise, the node it points to is added to the tree, and all that bridge's links are added to the end of the queue, with the weight being the cost of traversal from the root bridge. +\item The first link is then removed from the queue. If the bridge it points to is already in the tree, then it is discarded. -* The next links is removed from the queue and the algorithm repeats. The algorithm terminates when either there are no more links on the queue, or all the bridges are part of the map. +\item Otherwise, the node it points to is added to the tree, and all that bridge's links are added to the end of the queue, with the weight being the cost of traversal from the root bridge. + +\item The next links is removed from the queue and the algorithm repeats. The algorithm terminates when either there are no more links on the queue, or all the bridges are part of the map. + +\end{enumerate} The algorithm assumes that all the nodes are connected, and that all links are bidrectional, which is the case is the networks I am testing. In the case I am testing the priority queue is also replacable by a normal queue under the condition that all the links have equal cost traversal, which is also the case.