1 / 82

Network Models

Network Models. Optimisation Methods. Basic Definitions. A graph or network is defined by two sets of symbols: nodes and arcs. A set (call it V ) of points, or vertices. The vertices of a graph or network are also called nodes .

clemens
Download Presentation

Network Models

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Network Models Optimisation Methods

  2. Basic Definitions • A graph or network is defined by two sets of symbols: nodes and arcs. • A set (call it V) of points, or vertices. The vertices of a graph or network are also called nodes. • An arc consists of an ordered pair of vertices and represents a possible direction of motion that may occur between vertices. • A sequence of arcs such that every arc has exactly one vertex in common with the previous are is called a chain.

  3. 1 4 2 3 Basic Definitions • A path is a chain in which the terminal node of each arc is identical to the initial node of next arc. • For example in the figure below: • (1,2)-(2,3)-(4,3) is a chain but not a path; • (1,2)-(2,3)-(3,4) is a chain and a path, which represents a way to travel from node 1 to node 4.

  4. Minimum Spanning Tree Problems • Suppose that each arc (i,j) in a network has a length associated with it and that arc (i,j) represents a way of connecting node i to node j. • In many applications it must be determined that the set of arcs in a network that connects all nodes such that the sum of the length of the arcs is minimized. Clearly, such a group of arcs contain no loop. • For a network with n nodes, a spanning tree is a group of n-1 arcs that connects all nodes of the network and contains no loops.

  5. Minimum Spanning Tree Problems • A spanning tree of minimum length in a network is a minimum spanning tree (MST). • The MST Algorithm may be used to find a minimum spanning tree. • Begin at any node i, and join node i to the node in the network (call it node j) that is closest to node i. • The two nodes i and j now form a connected set of nodes C={i,j}, and arc (i,j) will be in the minimum spanning tree. The remaining nodes in the network (call them Ć) are referred to as the unconnected set of nodes.

  6. Minimum Spanning Tree Algorithm • Now choose a member of C’ (call it n) that is closest to some node in C. Let m represent the node in C that is closest to n. Then the arc(m,n) will be in the minimum spanning tree. Now update C and C’. Since n is now connected to {i,j}, C now equals {i,j,n} and we must eliminate node n from C’. • Repeat this process until a minimum spanning tree is found. Ties for closest node and arc to be included in the minimum spanning tree may be broken arbitrarily.

  7. 1 1 2 2 2 6 5 4 3 2 4 4 3 5 Example 1: MST Algorithm • The State University campus has five computers. The distances between each pair of computers are given. • What is the minimum length of cable required to interconnect the computers? • Note that if two computers are not connected this is because of underground rock formations.

  8. 1 1 2 2 2 6 5 4 3 2 4 4 3 5 Example 1: Solution • We want to find the minimum spanning tree. • Iteration 1: Following the MST algorithm discussed before, arbitrarily choose node 1 to begin. The closest node is node 2. Now C={1,2}, Ć={3,4,5}, and arc(1,2) will be in the minimum spanning tree.

  9. 1 1 2 2 2 6 5 4 3 2 4 4 3 5 Ex. 1 – Solution continued • Iteration 2: Node 5 is closest to C. Since node 5 is two blocks from node 1 and node 2, we may include either arc(2,5) or arc(1,5) in the minimum spanning tree. We arbitrarily choose to include arc(2,5). Then C={1,2,5} and Ć={3,4}.

  10. 1 1 2 2 2 6 5 4 3 2 4 4 3 5 Ex. 1 – Solution continued • Iteration 3: Since node 3 is two blocks from node 5, we may include arc(5,3) in the minimum spanning tree. Now C={1,2,5,3} and Ć={4}.

  11. 1 1 2 2 2 6 5 4 3 2 4 4 3 5 Ex. 1 – Solution continued • Iteration 4: Node 5 is the closest node to node 4. Thus, we add arc(5,4) to the minimum spanning tree. • The minimum spanning tree consists of arcs(1,2), (2,5), (5,3), and (5,4). The length of the minimum spanning tree is 1+2+2+4=9 blocks.

  12. Example 2

  13. Example 2: Solution • Start by arbitrarily selecting node 1. • Since the nearest node is the third node at a distance of 2 (200 feet), connect node 1 to node 3. • Shown 2 slides hence. • Considering nodes 1 and 3, look for the next-nearest node. • This is node 4, which is the closest to node 3 with a distance of 2 (200 feet). • Once again, connect these nodes (3 slides hence).

  14. Ex. 2 – Solution continued

  15. Ex. 2 – Solution continued

  16. Ex. 2 – Solution continued

  17. Ex. 2 – Solution continued

  18. Ex. 2 – Solution continued • Nodes 1, 2, 4, and 6 are all connected to node 3. Node 2 is connected to node 5. • Node 6 is connected to node 8, and node 8 is connected to node 7. • All of the nodes are now connected. • The total distance is found by adding the distances for the arcs used in the spanning tree. • In this example, the distance is: 2 + 2 + 3 + 3 + 3 + 1 + 2 = 16 (or 1,600 feet).

  19. Shortest Path Problems • Assume that each arc in the network has a length associated with it. • The problem of finding the shortest path from node 1 to any other node in the network is called a shortest path problem.

  20. Dijkstra's Shortest Path Algorithm • Assuming that all arc lengths are non-negative, Dijkstra’s algorithm, can be used to find the shortest path from a node. • Finding the shortest path between node i and node j in a network may be viewed as a trans-shipment problem. • The trans-shipment problem can then easily be solved by using LINGO.

  21. Dijkstra's Shortest Path Algorithm • Find the nearest node to the origin (plant). Put the distance in a box by the node. • Find the next-nearest node to the origin (plant), and put the distance in a box by the node. In some cases, several paths will have to be checked to find the nearest node. • Repeat this process until you have gone through the entire network. The last distance at the ending node will be the distance of the shortest route.

  22. Example 3: Equipment Replacement • Assume that a new car (or machine) has been purchased for $12,000 at time 0. • The cost of maintaining the car during a year depends on the age of the car at the beginning of the year, as given in the table below.

  23. Ex. 3 - continued • In order to avoid the high maintenance cost associated with an older car, we may trade in the car and purchase a new car. • To simplify the computations we assume that at any time it costs $12,000 to purchase a new car. • The goal is to minimize the net cost incurred during the next five years.

  24. Example 3: Solution • This problem should be formulated as a shortest path problem. • The network will have six nodes. • Node i is the beginning of year i and for i<j, an arc (i,j) corresponds to purchasing a new car at the beginning of year i and keeping it until the beginning of year j. • The length of arc (i,j) (call it cij) is the total net cost incurred from year i to j.cij = maintenance cost incurred during years i,i+1,…,j-1+ cost of purchasing a car at the beginning of year i - trade-in value received at the beginning of year j

  25. c16=2+4+5+9+12+12-0=44 c23=2+12-7=7 c24=2+4+12-6=12 c25=2+4+5+12-2=21 c12=2+12-7=7c13=2+4+12-6=12c14=2+4+5+12-2=21c15=2+4+5+9+12-1=31 c45=2+12-7=7 c46=2+4+12-6=12 c56=2+12-7=7 c26=2+4+5+9+12-1=31 c34=2+12-7=7 c35=2+4+12-6=12 c36=2+4+5+12-2=21 Ex. 3 – Solution continued • Applying this formula to the information the problem yields

  26. 44 31 31 21 21 12 12 1 2 3 4 5 6 7 7 7 7 7 12 12 21 Ex. 3 – Solution continued • From the figure below we can see that both path 1-3-5-6 and 1-2-4-6 will give us the shortest path with a value of 31.

  27. Example: From Ray’s Plant to Warehouse For example, • Every day, Ray Design, Inc., must transport beds, chairs, and other furniture items from the factory to the warehouse. • This involves going through several cities. • Ray would like to find the route with the shortest distance. • The road network is shown on the next slide.

  28. 200 Plant 4 2 100 100 100 150 6 1 50 100 200 5 3 40 Warehouse Dijkstra's Shortest Path Algorithm Roads from Ray’s Plant to Warehouse:

  29. 200 Plant 4 2 100 100 100 150 6 1 50 100 200 5 3 40 Warehouse Dijkstra's Shortest Path Algorithm 100 • The nearest node to the plant is node 2, with a distance of 100 miles. • Thus, connect these two nodes. Ray Design: 1st Iteration

  30. 100 200 100 100 4 2 100 150 50 100 200 6 1 40 150 5 3 Dijkstra's Shortest Path Algorithm • The nearest node to the plant is node 3, with a distance of 50 miles. • Thus, connect these two nodes. Ray Design: 2nd Iteration

  31. 100 200 100 100 4 2 100 150 50 100 200 6 1 40 190 150 5 3 Dijkstra's Shortest Path Algorithm • The nearest node to the plant is node 5, with a distance of 40 miles. • Thus, connect these two nodes. Ray Design: 3rd Iteration

  32. 100 200 100 100 4 2 100 150 50 100 200 6 1 40 190 150 5 3 Dijkstra's Shortest Path Algorithm 290 Total Shortest Route = 100 + 50 + 40 + 100 = 290 miles. 4th and Final Iteration

  33. Dijkstra's Shortest Path Algorithm • Find shortest path from s to t. 2 24 3 9 s 18 14 6 2 6 4 19 30 11 5 15 5 6 16 20 t 7 44

  34. Dijkstra's Shortest Path Algorithm S = { } PQ = { s, 2, 3, 4, 5, 6, 7, t }   2 24 3 0 9 s 18  14 6 2 6  4  19 30 11 5 15 5 6 16 20 t 7 44  distance label 

  35. Dijkstra's Shortest Path Algorithm S = { } PQ = { s, 2, 3, 4, 5, 6, 7, t } delmin   2 24 3 0 9 s 18  14 6 2 6  4  19 30 11 5 15 5 6 16 20 t 7 44  distance label 

  36. Dijkstra's Shortest Path Algorithm S = { s } PQ = { 2, 3, 4, 5, 6, 7, t } decrease key   9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  4  19 30 11 5 15 5 6 16 20 t 7 44  distance label  15 X

  37. Dijkstra's Shortest Path Algorithm S = { s } PQ = { 2, 3, 4, 5, 6, 7, t } delmin   9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  4  19 30 11 5 15 5 6 16 20 t 7 44  distance label  15 X

  38. Dijkstra's Shortest Path Algorithm S = { s, 2 } PQ = { 3, 4, 5, 6, 7, t }   9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  4  19 30 11 5 15 5 6 16 20 t 7 44   15 X

  39. Dijkstra's Shortest Path Algorithm S = { s, 2 } PQ = { 3, 4, 5, 6, 7, t } decrease key  33 X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  4  19 30 11 5 15 5 6 16 20 t 7 44   15 X

  40. Dijkstra's Shortest Path Algorithm S = { s, 2 } PQ = { 3, 4, 5, 6, 7, t }  33 X  9 X 2 24 3 0 9 delmin s 18  14 X 14 6 2 6  4  19 30 11 5 15 5 6 16 20 t 7 44   15 X

  41. Dijkstra's Shortest Path Algorithm S = { s, 2, 6 } PQ = { 3, 4, 5, 7, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  44 4  X 19 30 11 5 15 5 6 16 20 t 7 44   15 X

  42. Dijkstra's Shortest Path Algorithm S = { s, 2, 6 } PQ = { 3, 4, 5, 7, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  44 4  X 19 30 11 5 15 5 6 16 20 t 7 44  delmin  15 X

  43. Dijkstra's Shortest Path Algorithm S = { s, 2, 6, 7 } PQ = { 3, 4, 5, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  35 44 X 4  X 19 30 11 5 15 5 6 16 20 t 7 44  59 X  15 X

  44. Dijkstra's Shortest Path Algorithm delmin S = { s, 2, 6, 7 } PQ = { 3, 4, 5, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  35 44 X 4  X 19 30 11 5 15 5 6 16 20 t 7 44  59 X  15 X

  45. Dijkstra's Shortest Path Algorithm S = { s, 2, 3, 6, 7 } PQ = { 4, 5, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  35 34 44 X X 4  X 19 30 11 5 15 5 6 16 20 t 7 44  51 59 X X  15 X

  46. Dijkstra's Shortest Path Algorithm S = { s, 2, 3, 6, 7 } PQ = { 4, 5, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  35 34 44 X X 4  X 19 30 11 5 15 5 6 16 delmin 20 t 7 44  51 59 X X  15 X

  47. Dijkstra's Shortest Path Algorithm S = { s, 2, 3, 5, 6, 7 } PQ = { 4, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  45 35 34 X 44 X X 4  X 19 30 11 5 15 5 6 16 20 t 7 44  50 51 59 X X X  15 X

  48. Dijkstra's Shortest Path Algorithm S = { s, 2, 3, 5, 6, 7 } PQ = { 4, t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  45 35 34 X 44 X X 4  X 19 30 11 5 delmin 15 5 6 16 20 t 7 44  50 51 59 X X X  15 X

  49. Dijkstra's Shortest Path Algorithm S = { s, 2, 3, 4, 5, 6, 7 } PQ = { t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  45 35 34 X 44 X X 4  X 19 30 11 5 15 5 6 16 20 t 7 44  50 51 59 X X X  15 X

  50. Dijkstra's Shortest Path Algorithm S = { s, 2, 3, 4, 5, 6, 7 } PQ = { t } 32  33 X X  9 X 2 24 3 0 9 s 18  14 X 14 6 2 6  45 35 34 X 44 X X 4  X 19 30 11 5 15 5 6 16 20 t 7 44  delmin 50 51 59 X X X  15 X

More Related