Network Models
Network Models
CH # 6
Minimal spanning tree
• The minimal spanning tree algorithm deals with linking the nodes of a
network, directly or indirectly, using the shortest total length of
connecting branches. A typical application occurs in the construction of
paved roads that link several rural towns. The road between two towns
may pass through one or more other towns. The most economical design
of the road system calls for minimizing the total miles of paved roads, a
result that is achieved by implementing the minimal spanning tree
algorithm.
Let N = {I, 2, .. " n} be the set of nodes of the network and define
• CK = Set of nodes that have been permanently connected at iteration k
• Ck = Set of nodes as yet to be connected permanently after iteration k
Step O. Set Co = Φ and Co = N.
• Step 1. Start with any node i in the unconnected set Co and set C1 =
{i}, which renders. C1 = N - {i}. Set k = 2.
• Example 6.2-1: Midwest TV Cable Company is in the process
of providing cable service to five new housing development areas.
Figure 6.6 depicts possible TV linkages among the five areas. The
cable miles are shown on each arc. Determine the most economical
cable network.
• Cj = {I}, C = {2, 3, 4, 5, 6}
• In intermodal transportation, loaded truck trailers are Shipped
between railroad terminals on special flatbed carts. Figure 6.8
shows the location of the main railroad terminals in the United
States and the existing railroad tracks. The objective is to decide
which tracks should be "revitalized" to handle the intermodal traffic
SHORTEST-ROUTE PROBLEM
• The shortest-route problem determines the shortest route between
a source and destination in a transportation network.
Shortest-Route Algorithms:
1. Dijkstra's algorithm.
2. Floyd's algorithm.
Dijkstra's algorithm is designed to determine the shortest routes
between the source node and every other node in the network.
Floyd's algorithm is more general because it allows the
determination of the shortest route between any two nodes in the
network.
Dijkstra's Algorithm
Let the node at which we are starting be called the initial node. Let the distance of
node Y be the distance from the initial node to Y.
1. Assign to every node a tentative distance value: set it to zero for our initial node and to
infinity for all other nodes.
2. Set the initial node as Permanent. Mark all other nodes Temporary. Create a set of all the
Temporary nodes called the Temporary set.
3. For the Permanent node, consider all of its Temporary neighbours and calculate
their tentative distances. Compare the newly calculated tentative distance to the
Permanent assigned value and assign the smaller one. For example, if the Permanent
node A is marked with a distance of 6, and the edge connecting it with a neighbour B has
length 2, then the distance to B (through A) will be 6 + 2 = 8. If B was previously marked
with a distance greater than 8 then change it to 8. Otherwise, keep the Permanent value.
4. When we are done considering all of the neighbours of the Permanent node, mark the
Permanent node as visited and remove it from the Temporary set. A visited node will
never be checked again.
5. If the destination node has been marked visited (when planning a route between two
specific nodes) or if the smallest tentative distance among the nodes in the Temporary
set is infinity (when planning a complete traversal; occurs when there is no connection
between the initial node and remaining Temporary nodes), then stop. The algorithm has
finished.
6. Otherwise, select the Temporary node that is marked with the smallest tentative
distance, set it as the new "Permanent node", and go back to step 3.