# Ch14 - Chapter 14 Solutions 1. Shortest path algorithm has...

This preview shows pages 1–3. Sign up to view the full content.

Chapter 14 Solutions 1. Shortest path algorithm has two main steps. A labeling correcting step and a determining the minimum of the corrected labels. Label Correcting Step: If (Label(I)+Distance(I,J)<=Label(J)) then Label(J) = label(I)+Distance(I,J) for all arcs out of node I. Find Minimum of Corrected Labels: Min = Large Number For I = 1 to Number of Nodes If (Label(I) is Not Permanent and Label(I) < Min) Min = Label(I) End For Both the steps will be carried for n times for a problem with n nodes. The first step will be conducted for all the arcs in the graph. The total number of possible arcs if all the n nodes are connected to each other. That is number of arcs are (n-1)^2. Thus the comparison will be done at most (n-1)^2. Hence the complexity is O(n2). The finding of the minimum valued node will be carried out at most n times, in which case the sink will be permanently labeled last. Each for execution will perform n operations. Thus this step has also has a complexity of O(n2). Since both the steps are of order (n2) the algorithm is of complexity O(n2). 2. The greedy algorithm for finding minimal spanning tree first sorts the arcs in ascending of arc cost. Then it adds the arc in spanning tree if there is not a path between from node and to node of the arc. If all the nodes are connected or (n-1) arcs are added to tree the algorithm terminates. The sorting algorithm is of order nlog(n)). After an arc is added the checking whether there is a path needs at most n operations. Since the number of arcs is at most n2 and the number of operations in the path checking is also n*n. Hence the algorithm is of order O(n2). In the worst case scenario the arc chosen last can be the one that completes tree. Hence theoretically it is not possible for this algorithm to be better than O(n2) in the worst case. 3. For the algorithm described in the worst case scenario each of the n numbers have to be compared with (n-1) numbers before we can arrive at an answer. Since in each step requires (n-1) comparison with n such steps are possible, the algorithm is of order O(n2). 4. Genetic Search: Given the flow and the cost between each pair of nodes in a network with n nodes, the p-Hub Location Problem (PHLP) turns a subset of

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
the n nodes into hubs and assigns each of the remaining n-p nodes to a single hub at the minimum cost possible.The main components that describe the implementation of GAs to the PHHP are given here: (1) Representation The data structure used to represent a population of individuals (solutions) is the array. Each individual is defined as a special kind of structure that has several pieces of information attached to it. The first piece of information is a string denoted by IND[i]=b1b2b3. ....bn, where the length of the string, n, corresponds to the total number of nodes in the network and bk represents node k. The value 1 indicates that node k is a hub and the value 0 indicates it is not. Make sure any random p positions are 1. Each string remains a feasible solution to the
This is the end of the preview. Sign up to access the rest of the document.

## This homework help was uploaded on 04/02/2008 for the course IEOR 160 taught by Professor Hochbaum during the Fall '07 term at Berkeley.

### Page1 / 11

Ch14 - Chapter 14 Solutions 1. Shortest path algorithm has...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online