Optimisation and Operations Research

Similar documents
Introduction to OSPF. ISP Workshops. Last updated 11 November 2013

Lecture Notes 3: Paging, K-Server and Metric Spaces

Foundations of Distributed Systems: Tree Algorithms

OSPF Fundamentals. Agenda. OSPF Principles. L41 - OSPF Fundamentals. Open Shortest Path First Routing Protocol Internet s Second IGP

OSPF - Open Shortest Path First. OSPF Fundamentals. Agenda. OSPF Topology Database

CSE 573 Problem Set 1. Answers on 10/17/08

Link State Routing. Stefano Vissicchio UCL Computer Science CS 3035/GZ01

Complex-Network Modelling and Inference

Game Theory and Randomized Algorithms

Link State Routing. Brad Karp UCL Computer Science. CS 3035/GZ01 3 rd December 2013

Gateways Placement in Backbone Wireless Mesh Networks

p-percent Coverage in Wireless Sensor Networks

Network Layer (Routing)

Network-building. Introduction. Page 1 of 6

Decision Mathematics practice paper

Energy Saving Routing Strategies in IP Networks

Link State Routing. In particular OSPF. dr. C. P. J. Koymans. Informatics Institute University of Amsterdam. March 4, 2008

Semiring Pruning for Information Dissemination in Mobile Ad Hoc Networks

Semiring Pruning for Information Dissemination in Mobile Ad Hoc Networks

and 6.855J. Network Simplex Animations

Open Shortest Path First Routing Under Random Early Detection

Real Time Routing in Road Networks

Lecture 8 Link-State Routing

DVA325 Formal Languages, Automata and Models of Computation (FABER)

Optimal Transceiver Scheduling in WDM/TDM Networks. Randall Berry, Member, IEEE, and Eytan Modiano, Senior Member, IEEE

Multicast Energy Aware Routing in Wireless Networks

CSE/EE 461. Link State Routing. Last Time. This Lecture. Routing Algorithms Introduction Distance Vector routing (RIP)

Maximizing Number of Satisfiable Routing Requests in Static Ad Hoc Networks

Graphs and Network Flows IE411. Lecture 14. Dr. Ted Ralphs

Simulative Comparison of MPLS Protection Switching vs. OSPF Re-routing

OSPF Domain / OSPF Area. OSPF Advanced Topics. OSPF Domain / OSPF Area. Agenda

M U LT I C A S T C O M M U N I C AT I O N S. Tarik Cicic

On the Capacity of Multi-Hop Wireless Networks with Partial Network Knowledge

A Comparative Study of Quality of Service Routing Schemes That Tolerate Imprecise State Information

Link State Routing. In particular OSPF. Karst Koymans. Informatics Institute University of Amsterdam. (version 16.3, 2017/03/09 11:25:31)

Optimal Multicast Routing in Ad Hoc Networks

Maximizing Network Lifetime of Broadcasting Over Wireless Stationary Ad Hoc Networks

Decision Mathematics D1

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

Convergence in competitive games

Link-state protocols and Open Shortest Path First (OSPF)

Greedy Algorithms. Kleinberg and Tardos, Chapter 4

Common Mistakes. Quick sort. Only choosing one pivot per iteration. At each iteration, one pivot per sublist should be chosen.

A Study of Dynamic Routing and Wavelength Assignment with Imprecise Network State Information

Algorithm for wavelength assignment in optical networks

On the Benefit of Tunability in Reducing Electronic Port Counts in WDM/TDM Networks

Empirical Probability Based QoS Routing

Low-Cost Routing in Selfish and Rational Wireless Ad Hoc Networks

Link State Routing. In particular OSPF. Karst Koymans. Informatics Institute University of Amsterdam. (version 17.4, 2017/11/30 12:33:57)

On Flow-Aware CSMA. in Multi-Channel Wireless Networks. Mathieu Feuillet. Joint work with Thomas Bonald CISS 2011

Global State and Gossip

CONVERGECAST, namely the collection of data from

Introduction to Local and Wide Area Networks

COMP Online Algorithms. Paging and k-server Problem. Shahin Kamali. Lecture 11 - Oct. 11, 2018 University of Manitoba

Routing and Wavelength Assignment in All-Optical DWDM Transport Networks with Sparse Wavelength Conversion Capabilities. Ala I. Al-Fuqaha, Ph.D.

CS 457 Lecture 16 Routing Continued. Spring 2010

Modeling, Analysis and Optimization of Networks. Alberto Ceselli

Topology Control. Chapter 3. Ad Hoc and Sensor Networks. Roger Wattenhofer 3/1

Rumors Across Radio, Wireless, and Telephone

Study of Location Management for Next Generation Personal Communication Networks

OLSR Standards. Emmanuel BACCELLI. INRIA / Hitachi

Variations on the Index Coding Problem: Pliable Index Coding and Caching

Diffusion of Networking Technologies

Fair Seeding in Knockout Tournaments

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Algorithmic Game Theory Date: 12/6/18

Signal Recovery from Random Measurements

Low-Latency Multi-Source Broadcast in Radio Networks

MULTI-HOP wireless networks consist of nodes with a

A New Design for WDM Packet Switching Networks with Wavelength Conversion and Recirculating Buffering

CS188 Spring 2014 Section 3: Games

With Question/Answer Animations. Chapter 6

Lectures: Feb 27 + Mar 1 + Mar 3, 2017

A virtually nonblocking self-routing permutation network which routes packets in O(log 2 N) time

A Location-Aware Routing Metric (ALARM) for Multi-Hop, Multi-Channel Wireless Mesh Networks

Information Theory and Communication Optimal Codes

Heuristic Search with Pre-Computed Databases

Conversion Masters in IT (MIT) AI as Representation and Search. (Representation and Search Strategies) Lecture 002. Sandro Spina

Distance-Vector Routing

Mathematical Foundations of Computer Science Lecture Outline August 30, 2018

On Symmetric Key Broadcast Encryption

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

Deadlock-free Routing Scheme for Irregular Mesh Topology NoCs with Oversized Regions

PRIORITY QUEUES AND HEAPS

Design of Parallel Algorithms. Communication Algorithms

Decision Mathematics D1 Advanced/Advanced Subsidiary. Friday 17 May 2013 Morning Time: 1 hour 30 minutes

4.4 Shortest Paths in a Graph Revisited

A HYBRID GENETIC ALGORITHM FOR THE WEIGHT SETTING PROBLEM IN OSPF/IS-IS ROUTING

Routing versus Network Coding in Erasure Networks with Broadcast and Interference Constraints

Cooperative Broadcast for Maximum Network Lifetime. Ivana Maric and Roy Yates

Counting. Chapter 6. With Question/Answer Animations

CSE373: Data Structure & Algorithms Lecture 23: More Sorting and Other Classes of Algorithms. Nicki Dell Spring 2014

Localized Topology Control for Unicast and Broadcast in Wireless Ad Hoc Networks

The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n ways to do the first task and n

Past questions from the last 6 years of exams for programming 101 with answers.

Education Resources. This section is designed to provide examples which develop routine skills necessary for completion of this section.

Superimposed Code Based Channel Assignment in Multi-Radio Multi-Channel Wireless Mesh Networks

CS188: Section Handout 1, Uninformed Search SOLUTIONS

Distributed Pruning Methods for Stable Topology Information Dissemination in Ad Hoc Networks

TIME- OPTIMAL CONVERGECAST IN SENSOR NETWORKS WITH MULTIPLE CHANNELS

Multicasting over Multiple-Access Networks

Transcription:

Optimisation and Operations Research Lecture : Graph Problems and Dijkstra s algorithm Matthew Roughan <matthew.roughan@adelaide.edu.au> http://www.maths.adelaide.edu.au/matthew.roughan/ Lecture_notes/OORII/ School of Mathematical Sciences, University of Adelaide July 2, 207

Graph terminology A directed graph is a tree if it is connected and acyclic. A directed graph (N, L ) is a subgraph of (N, L) if N N and L L. A subgraph (N, L ) is a spanning tree if it is a tree and N = N. July 2, 207 2 / 28

Graph Terminology Definition (A Path) A path in a directed network G(N, L) (of node set N and link set L) is a list of nodes,i, i 2, i...i r, i r, where (i) i j N for all j =...r (ii) for each successive pair of nodes, (i k, i k+ ) L, and (iii) with no repetition of nodes i.e i k i j when k j. Definition (A cycle) A cycle in a directed network G(N, L) is a list of nodes, i, i 2, i...i r, i r, i, where i, i 2, i...i r, i r is a path and (i r, i ) L (i.e., the link from the last node of a path to the first is included). July 2, 207 / 28

Graph Terminology Example Consider a path from node to node 7, 2, 4, 7, is one path, while another is,, 2, 4, 5,, 7. Note that, 2, 4,, 7 is not a path, because (4, ) L. A (directed) cycle is 4, 5,, 4. July 2, 207 4 / 28

All Paths Origin-Destination (O-D) pair (p, q) N N Let K be the set of all O-D pairs, with K = {[p, q] : p, q N}. The set of paths joining an O-D pair (p, q) is denoted P pq. The set of all paths in G(N, L) is denoted P. P = [p,q] K P pq There can be exponentially many possible paths in a network July 2, 207 5 / 28

Network Paths 2 4 5 July 2, 207 / 28

Network Paths 2 4 5 Path 2 4 5 Paths P 5 : -2-4-5 July 2, 207 / 28

Network Paths 2 4 5 Path 2 5 Paths P 5 : -2-4-5, -2---5 July 2, 207 / 28

Network Paths 2 4 5 Path 2 5 Paths P 5 : -2-4-5, -2---5, -2--5 July 2, 207 / 28

Network Paths 2 4 5 Path 5 Paths P 5 : -2-4-5, -2---5, -2--5, --5 July 2, 207 / 28

Network Paths 2 4 5 Path 2 4 5 Paths P 5 : -2-4-5, -2---5, -2--5, --5, ---2-4-5 July 2, 207 / 28

Network Paths 2 4 5 Path 5 Paths P 5 : -2-4-5, -2---5, -2--5, --5, ---2-4-5, ---5 July 2, 207 / 28

Network Paths 2 4 5 Path 4 2 5 Paths P 5 : -2-4-5, -2---5, -2--5, --5, ---2-4-5, ---5, -4-2---5 July 2, 207 / 28

Network Paths 2 4 5 Path 4 2 5 Paths P 5 : -2-4-5, -2---5, -2--5, --5, ---2-4-5, ---5, -4-2---5, -4-2--5 July 2, 207 / 28

Network Paths 2 4 5 Path 4 5 Paths P 5 : -2-4-5, -2---5, -2--5, --5, ---2-4-5, ---5, -4-2---5, -4-2--5, -4-5 July 2, 207 / 28

Section Shortest Paths July 2, 207 7 / 28

Logical vs. Physical Network Imagine a physical network 2 o S 8 o S 24 o S 0 o S o S 42 o S fiber 0 o E 20 o E 0 o E 40 o E 50 o E 0 o E July 2, 207 8 / 28

Logical vs. Physical Network But a logical network that looks like 2 o S 8 o S 24 o S 0 o S o S 42 o S hub switch virtual circuit 0 o E 20 o E 0 o E 40 o E 50 o E 0 o E July 2, 207 9 / 28

Logical vs. Physical Network And potential pairs of network locations that want to communicate 2 o S 8 o S 24 o S 0 o S o S 42 o S router route 0 o E 20 o E 0 o E 40 o E 50 o E 0 o E July 2, 207 0 / 28

Mapping the logical to the physical We need to map from one layer to another Network layer routers packets Link layer 2 virtual ciruits switches Physical layer optical fiber WDM cross connects That is, the logical links must be routed across physical links. July 2, 207 / 28

Mapping the logical to the physical We need to map from one layer to another Network layer routers packets Link layer 2 virtual ciruits switches Physical layer optical fiber WDM cross connects That is, the logical links must be routed across physical links. July 2, 207 / 28

Routing We need a method to map packet routes to links called a routing protocol several types exist we consider here shortest path protocols July 2, 207 2 / 28

Shortest paths We have a problem of working out what path packets should take from origin to destination Often, links in networks have lengths associated with them shortest paths would get packets to their destinations fastest shortest paths also use the least resources shortest paths come up in lots of other applications We ll look an algorithm (Dijkstra s) for computing shortest paths it s a greedy algorithm but it guarantees to find the optimal path July 2, 207 / 28

Shortest path problem assumptions For a network G(N, L), The length of link (i, j) is c ij 0 some shortest path algorithms can work with negative distances, but we then need to assume there are no negative cycles 2 There exists a path from s to all other i N. if not, add a dummy link from s to i with very large cost M What problem? APSP = All Pairs Shortest Paths SSSP = Single Source Shortest Paths we ll start with this July 2, 207 4 / 28

Section 2 Dijkstra s algorithm July 2, 207 5 / 28

Routing in essence, routing maps end-to-end traffic from p to q, i.e., tpq to end-to-end paths in Ppq to links in E there are very many paths can t search them all have to be clever about choice of paths can use multiple paths load-balancing spreads load over paths July 2, 207 / 28

Dijkstra s algorithm fast method to find shortest paths is Dijkstra s algorithm [Dij59] Edsger Dijkstra (90-2002) Dutch computer scientist Turing prize winner 972. Goto Statement Considered Harmful paper find distance of all nodes from one start point works by finding paths in order of shortest first longer paths are built up of shorter paths July 2, 207 7 / 28

Dijkstra s algorithm Input Output graph (N, E) link weights α e, define link distances 0 if i = j d ij = α e where (i, j) = e E where (i, j) = e E a start node, WLOG assume it is node distances D j of each node j N from start node. a predecessor node for each node (gives path) July 2, 207 8 / 28

Dijkstra s algorithm Let S be the set of labelled nodes. Initialise: S = {}, D = 0, D j = d j, j S, i.e., j. Step : Find the next closest node Find i S such that D i = min{d j : j S} Set S = S {i}. If S = N, stop Step 2: Find new distances For all j S, set D j = min{d j, D i + d ij } Goto Step. July 2, 207 9 / 28

Dijkstra Example start node 4 2 4 2 5 5 July 2, 207 20 / 28

Dijkstra Example Initialise 0 S={} 4 2 4 2 5 5 D=(0,,,, ) July 2, 207 20 / 28

Dijkstra Example Step 4 2 4 2 5 0 5 S={,} D=(0,,,, ) July 2, 207 20 / 28

Dijkstra Example Step 2 0 S={,} 5 4 2 4 4 2 5 9 5 D=(0,5,,4,9) changed July 2, 207 20 / 28

Dijkstra Example Step 5 4 2 4 4 2 5 0 9 5 S={,,4} D=(0,5,,4,9) July 2, 207 20 / 28

Dijkstra Example Step 2 5 4 2 4 4 2 5 0 9 5 S={,,4} D=(0,5,,4,9) July 2, 207 20 / 28

Dijkstra Example Step 5 4 2 4 2 0 9 4 5 5 S={,,4,2} D=(0,5,,4,9) July 2, 207 20 / 28

Dijkstra Example Step 2 0 5 4 2 4 S={,,4,2} 2 changed 4 5 5 D=(0,5,,4,) July 2, 207 20 / 28

Dijkstra Example Step & stop 0 5 4 2 4 2 S={,,4,2,5} 4 5 5 D=(0,5,,4,) July 2, 207 20 / 28

Dijkstra Result SPF tree 5 4 2 4 4 2 5 0 5 S={,,4,2,5} D=(0,5,,4,) July 2, 207 2 / 28

Dijkstra intuition build a (Shortest-Path First) SPF tree let it grow grow by adding shortest paths onto it solution must look like a tree to get paths, we only need to keep track of predecessors, e.g., previous example node predecessor - 2 4 2 July 2, 207 22 / 28

Dijkstra issues Dijkstra s algorithm solves single-source all-destinations problem easily extended to a directed graph can only join up in the direction of a link link-distances (weights) must be non-negative there are other algorithms to deal with negative weights July 2, 207 2 / 28

Dijkstra complexity Instance size given by number of nodes N and edges E in the graph Simple implementation complexity O( N 2 ) Cisco s implementation of Dijkstra tested in [SG0] comp.time = 2.5N 2 2.5N + 200 microseconds Complexity (assuming smart data structures, i.e., Fibonacci heap) is O( E + N log N ), E = number of edges N = number of nodes To compute paths for all pairs, we can perform Dijkstra for each starting point, with complexity O( N E + N 2 log N ), July 2, 207 24 / 28

Dijkstra complexity Empirical Cisco 7500 and 2000 (GSR) computation times for Dijkstra [SG0] computation time (ms) 450 400 50 00 250 200 50 00 50 0 0 00 200 00 400 Number of nodes N 2.5N 2 2.5N + 200µs July 2, 207 25 / 28

Sketch of proof of Dijkstra Theorem Dijkstra s algorithm solves the single-source shortest-paths problem in networks that have nonnegative weights. Proof: Call the source node s the root, then we need to show that the paths from s to each node x corresponds to a shortest path in the graph from s to x. Note that this set of paths forms a tree out of a subset of edges of the graph. The proof uses induction. We assume that the subtree formed at some point along the algorithm has the property (of shortest paths). Clearly the starting point satisfies this assumption, so we need only prove that adding a new node x adds a shortest path to that node. All other paths to x must begin with a path from the current subtree (because these are shortest paths) followed by an edge to a node not on the tree. By construction, all such paths are longer than the one from s to x that is produced by Dijkstra. July 2, 207 2 / 28

Takeaways Shortest paths common optimisation problem Dijkstra is a good solution but not the only one: there are better approaches some deal with more general cases some are distributed some are slightly faster Greed is good greedy algorithms can be optimal there are lots of similar algorithms e.g., Prim s algorithm for finding minimum spanning trees July 2, 207 27 / 28

Further reading I E.W. Dijkstra, A note in two problems in connexion with graphs, Numerische Mathematik (959), 29 27. Aman Shaikh and Albert Greenberg, Experience in black-box OSPF measurement, Proc. ACM SIGCOMM Internet Measurement Workshop, 200, pp. 25. July 2, 207 28 / 28