Presentation is loading. Please wait.

Presentation is loading. Please wait.

Network Models.

Similar presentations


Presentation on theme: "Network Models."— Presentation transcript:

1 Network Models

2 The Shortest Path Model
For a given network find the path of minimum distance, time, or cost from a starting point, the start node, to a destination, the terminal node. Problem definition There are n nodes, beginning with start node 1 and ending with terminal node n. Bi-directional arcs connect connected nodes i and j with nonnegative distances, dij Find the path of minimum total distance that connects node 1 to node n.

3 FAIRWAY VAN LINES Determine the shortest route from Seattle to El Paso over the following network of highways.

4 Seattle Butte Boise Cheyenne Portland Salt Lake City Bakersfield
1 Seattle 2 Butte 599 497 Boise 691 180 420 3 4 Cheyenne 345 432 5 Portland 6 440 Salt Lake City 893 Bakersfield Las Vegas 432 621 554 7 280 8 577 Albuquerque 290 9 10 116 Tucson 500 11 Phoenix 314 268 Comment In case some arcs are bi-directional, create two directed arcs in two opposite directions, between the same two nodes. 12 403 El Paso

5 FAIRWAY VAN LINES – The Linear Programming Model
Decision variables Objective = Minimize S dijXij

6 2 Subject to the following constraints: Butte Seattle 1 Boise 3 4
599 2 497 Boise 180 3 4 345 Salt Lake City 432 Portland 6 [The number of highways traveled out of Seattle (the start node)] = 1 X12 + X13 + X14 = 1 In a similar manner: [The number of highways traveled into El Paso (terminal node)] = 1 X9,12 + X10,12 + X11,12 = 1 [The number of highways used to travel into a city] = [The number of highways traveled leaving the city]. For example, in Boise (node 4): X14 + X34 = X46. Non-negativity constraints

7 FAIRWAY VAN LINES – spreadsheet

8 FAIRWAY VAN LINES – The Network Model
The Dijkstra’s algorithm: Find the shortest distance from the “START” to each other node, in the order of the closest nodes to the “START”. Once the shortest route to the m closest node is determined, the (m+1) closest can be easily determined. This algorithm finds the shortest route from the start to all the nodes in the network.

9 An illustration of the Dijkstra’s algorithm
(See mathematical formulation of the algorithm in Supplement CD 5).

10 SLC. SLC + = BUTTE BOISE. SEAT. … and so on until the whole network
420 CHY. 691 + = 1119 1290 BUT 599 POR 180 497 BOI BUTTE 599 180 497 345 SLC + = 842 BOI BOISE. SEAT. + BOI 432 Bakersville 602 = 612 782 … and so on until the whole network is covered. POR. BAKERSVILLE

11 Dijkstra’s algorithm - continued
When all the network is covered, the shortest route from START to every other node can be identified. Trace the path that leads to each node by backtracking from each node toward node START.

12 The Maximal Flow Problem
Problem definition There is a source node (labeled 1), from which the network flow emanates. There is a terminal node (labeled n), into which all network flow is eventually deposited. There are n - 2 intermediate nodes (labeled 2, 3,…,n-1), where the node inflow is equal to the node outflow. There are capacities Cij for flow on the arc from node i to node j, and capacities Cji for the opposite direction.

13 The Maximal Flow Problem Objective
The objective is to find the maximum total flow out of node 1 that can flow into node n without exceeding the capacities on the arcs.

14 UNITED CHEMICAL COMPANY
United Chemical produces pesticides and lawn care products. Poisonous chemicals needed for the production process are held in a huge drum. A network of pipes and valves regulates the chemical flow from the drum to different production areas. The safety division must plan a procedure to empty the drum as fast as possible into a safety tub in the disposal area, using a network of pipes and valves.

15 UNITED CHEMICAL COMPANY
The plan must determine: which valves to open and shut What is the estimated time for total discharge

16 UNITED CHEMICAL COMPANY- Network Presentation

17 Data 1 8 7 3 6 1 10 3 2 4 10 2 Chemical Drum Safe Tub 1 4 2 12 8 4
Maximum flow from 2 to 4 is 8 8 7 2 Data 3 6 1 10 3 1 6 7 2 4 10 2 Chemical Drum Safe Tub 1 4 3 2 12 8 5 Maximum flow from 6 to 3 is 4

18 UNITED CHEMICAL COMPANY – The Linear Programming Model
Decision variables Xij - the flow from node i to node j on the arc that connects these two nodes Objective function – Maximize the flow out of node 1: Max X12 + X13

19 UNITED CHEMICAL COMPANY – The Linear Programming Model
Constraints The constraint on each intermediate node is: Flow out from the node – flow into the node = 0 Node 2: X23 +X24 + X26 - X12 - X32 = 0 Node 3: X32 +X35 + X36 - X13 - X23 - X63 = 0 Node 4: X46 + X47 - X24 - X64 = 0 Node 5: X56 + X57 - X35 - X = 0 Node 6: X63 +X64 +X65 + X67 - X26 - X36 - X46 -X56 = 0 2

20 UNITED CHEMICAL COMPANY – The Linear Programming Model
Constraints – continued Flow cannot exceed arc capacities X12 £ 10; X13 £ 10; X23 £ 1; X24 £ 8; X26 £ 6; X32 £ 1; X35 £ 15; X36 £ 4; X46 £ 3; X47 £ 7; X56 £ 2; X57 £ 8; X63 £ 4; X64 £ 3; X65 £ 2; X67 £ 2; All Xij  0

21 UNITED CHEMICAL COMPANY – Spreadsheet
galões galões/minuto 100/17 = 5,88 minutos para retirar todo o produto 8 2 7 9 1 4 5 3 6

22 The role of cuts in a maximum flow network
The value of the maximum flow = the sum of the capacities of the minimum cut. This is a minimal cut, and the flow = 17 is maximal Corte: linha sobre os arcos da rede que separa nó fonte do nó destino Cap = 30 This is not a minimal cut 4 8 Capacidade do Corte: soma das capacidades dos arcos cortados pela linha do corte 2 3 10 6 7 1 3 2 1 7 6 2 4 1 4 10 8 Rede com as capacidades nos arcos 2 3 5 12 Cap = 17

23 The Traveling Salesman Problem
Problem definition There are m nodes. Unit cost Cij is associated with utilizing arc (i,j) Find the cycle that minimizes the total cost required to visit all the nodes exactly once.

24 The Traveling Salesman Problem
Importance: Variety of scheduling application can be solved as a traveling salesmen problem. Examples: Ordering drill position on a drill press. School bus routing. Military bombing sorties. The problem has theoretical importance because it represents a class of difficult problems known as NP-hard problems.

25 The Traveling Salesman Problem
Complexity Both writing the mathematical model and solving it are cumbersome (a problem with 20 cities requires over 500,000 linear constraints.) 50 cidades requerem 500 trilhões de restrições lineares 120 cidades requerem restrições lineares !!

26 THE FEDERAL EMERGENCY MANAGEMENT AGENCY
A visit must be made to four local offices of FEMA, going out from and returning to the same main office in Northridge, Southern California. Data (simétrico) Travel time (min) between offices

27 FEMA traveling salesman Network representation

28 Tempo de viagem 40 2 3 40 25 35 50 50 1 4 45 65 30 80 Home

29 FEMA - Traveling Salesman
Solution approaches Enumeration of all possible cycles. This results in (m-1)! cycles to enumerate. Se a rede for simétrica serão (m – 1)!/2 ciclos. Only small problems can be solved with this approach. A combination of the Assignment problem and the Branch and Bound technique. Problem with up to m=20 nodes can be efficiently solved with this approach.

30 FEMA – full enumeration
Possible cycles Cycle Total Cost 1. H-O1-O2-O3-O4-H 210 2. H-O1-O2-O4-O3-H 3. H-O1-O3-O2-O3-H 4. H-O1-O3-O4-O2-H 5. H-O1-O4-O2-O3-H 6. H-O1-O4-O3-O2-H 7. H-O2-O3-O1-O4-H 8. H-O2-O1-O3-O4-H 9. H-O2-O4-O1-O3-H 10. H-O2-O1-O4-O3-H 11. H-O3-O1-O2-O4-H 12. H-O3-O1-O2-O4-H 260 Minimum For this problem we have (5-1)! / 2 = 12 cycles. Symmetrical problems need to enumerate only (m-1)! / 2 cycles.

31 FEMA – optimal solution
40 2 3 25 35 50 40 1 50 4 45 65 30 80 Home Tempo total ótimo = 195 minutos

32 FEMA – The Assignment problem approach
Refer to the nodes designated “From” as “Workers” nodes. Refer to nodes designated by “To” as “Jobs” nodes. Assign “Workers” to “Jobs” at minimum cost. Variáveis de Decisão: Xij = número de vezes que o arco do nó i ao nó j é usado no ciclo. Assim, Xij = 1 (se o arco está no ciclo) ou 0 (arco não está no ciclo). Restrições no Modelo da Designação: soma dos arcos que saem de um nó tipo “Worker” = 1; soma dos arcos que chegam em em nó tipo “Job” = 1.

33 FEMA – The Assignment problem approach
Data

34 FEMA – The assignment solution
O3 – O4 – O3 Sub-tour 40 2 3 25 35 50 40 1 50 4 45 65 30 80 O1 – O2 – H – O1 Sub-tour Home

35 FEMA – The assignment solution
We can prevent the situation of sub-tours by adding certain constraints. Exemplo: Seja o nó 5 = Home (H), assim X52 + X21 + X15  2 evita que o sub-tour H-O2-O1-H seja utilizado. X12 + X23 + X34 + X41  3 evita que o sub-tour O1-O2-O3-O4-O1 seja utilizado. This makes the problem extremely large. Another approach, that combines the Assignment model with the Branch and Bound solution methodology can efficiently solve problems up to m = 20 nodes.

36 The Minimal Spanning Tree
This problem arises when all the nodes of a given network must be connected to one another, without any loop. The minimal spanning tree approach is appropriate for problems for which redundancy is expensive, or the flow along the arcs is considered instantaneous.

37 THE METROPOLITAN TRANSIT DISTRICT
The City of Vancouver is planning the development of a new light rail transportation system. The system should link 8 residential and commercial centers. The Metropolitan Transit District needs to select the set of lines that will connect all the centers at a minimum total cost.

38 METROPOLITAN TRANSIT – Network presentation
The network describes: feasible lines that have been drafted minimum possible cost for taxpayers per line.

39 55 North Side University 3 50 5 30 Business District 39 38 33 4 34 West Side 45 1 32 8 28 43 35 2 6 East Side City Center Shopping Center 41 40 37 44 36 7 South Side

40 NETWORK PRESENTATION 55 North Side University 3 50 5 30 Business
District 39 4 38 33 34 West Side 45 1 32 8 28 43 35 2 6 East Side City Center Shopping Center 41 40 37 44 36 7 South Side

41 THE METROPOLITAN TRANSIT DISTRICT
Solution - a network approach (See Supplement CD 5) The algorithm that solves this problem is a very trivial greedy procedure. Two versions of the algorithm are described. The algorithm – version 1: Start by selecting the smallest arc, and adding it to a set of selected arcs (currently contains only the first arc). At each iteration, add the next smallest arc to the set of selected arcs, unless it forms a cycle. Finish when all nodes are connected.

42 THE METROPOLITAN TRANSIT DISTRICT
The algorithm – version 2: Start by selecting the smallest arc creating the set of connected arcs. At each iteration add the smallest unselected arc that has a connection to the connected set, but do not create a cycle. Finish when all nodes are connected See demonstration of version 2 next

43 Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop Loop
Aplicação do Alg 2 55 University 3 50 5 North Side 30 30 Business District Loop Loop Loop 39 Loop 33 33 Loop 4 38 Loop Loop 34 Loop Loop Loop Loop West Side 45 Loop Loop 32 32 1 Loop Loop Loop 8 28 28 43 35 2 6 East Side City Center Shopping Center 41 40 37 44 36 Continuar até conectar todos os nós 7 South Side

44 OPTIMAL SOLUTION Total Cost = $236 million University 3 5 North Side
30 Business District 4 38 West Side 32 1 8 28 35 2 6 East Side City Center Shopping Center 37 Total Cost = $236 million 36 7 South Side


Download ppt "Network Models."

Similar presentations


Ads by Google