# Chapter 7: Termination Detection

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Chapter 7: Termination Detection Ajay Kshemkalyani and Mukesh Singhal Distributed Computing: Principles, Algorithms, and Systems Cambridge University Press A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

2 Introduction A fundamental problem: To determine if a distributed computation has terminated. A non-trivial task since no process has complete knowledge of the global state, and global time does not exist. A distributed computation is globally terminated if every process is locally terminated and there is no message in transit between any processes. Locally terminated state is a state in which a process has finished its computation and will not restart any action unless it receives a message. In the termination detection problem, a particular process (or all of the processes) must infer when the underlying computation has terminated. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

3 Introduction A termination detection algorithm is used for this purpose. Messages used in the underlying computation are called basic messages, and messages used for the purpose of termination detection are called control messages. A termination detection (TD) algorithm must ensure the following: 1 Execution of a TD algorithm cannot indefinitely delay the underlying computation. 2 The termination detection algorithm must not require addition of new communication channels between processes. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

4 System Model At any given time, a process can be in only one of the two states: active, where it is doing local computation and idle, where the process has (temporarily) finished the execution of its local computation and will be reactivated only on the receipt of a message from another process. An active process can become idle at any time. An idle process can become active only on the receipt of a message from another process. Only active processes can send messages. A message can be received by a process when the process is in either of the two states, i.e., active or idle. On the receipt of a message, an idle process becomes active. The sending of a message and the receipt of a message occur as atomic actions. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

5 Definition of Termination Detection Let p i (t) denote the state (active or idle) of process p i at instant t. Let c i,j (t) denote the number of messages in transit in the channel at instant t from process p i to process p j. A distributed computation is said to be terminated at time instant t 0 iff: ( i:: p i (t 0 ) = idle) ( i, j:: c i,j (t 0 )=0). Thus, a distributed computation has terminated iff all processes have become idle and there is no message in transit in any channel. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

6 Termination detection Using Distributed Snapshots The algorithm assumes that there is a logical bidirectional communication channel between every pair of processes. Communication channels are reliable but non-fifo. Message delay is arbitrary but finite. Main idea: When a process goes from active to idle, it issues a request to all other processes to take a local snapshot, and also requests itself to take a local snapshot. When a process receives the request, if it agrees that the requester became idle before itself, it grants the request by taking a local snapshot for the request. A request is successful if all processes have taken a local snapshot for it. The requester or any external agent may collect all the local snapshots of a request. If a request is successful, a global snapshot of the request can thus be obtained and the recorded state will indicate termination of the computation, A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

7 Termination detection using distributed snapshots Formal Description Each process i maintains a logical clock denoted by x, initialized to zero at the start of the computation. A process increments its x by one each time it becomes idle. A basic message sent by a process at its logical time x is of the form B(x). A control message that requests processes to take local snapshot issued by process i at its logical time x is of the form R(x, i). Each process synchronizes its logical clock x loosely with the logical clocks x s on other processes in such a way that it is the maximum of clock values ever received or sent in messages. A process also maintains a variable k such that when the process is idle, (x,k) is the maximum of the values (x, k) on all messages R(x, k) ever received or sent by the process. Logical time is compared as follows: (x, k) > (x, k ) iff (x > x ) or ((x=x ) and (k>k )), i.e., a tie between x and x is broken by the process identification numbers k and k. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

8 Termination detection using distributed snapshots The algorithm is defined by the following four rules. (R1): When process i is active, it may send a basic message to process j at any time by doing send a B(x) to j. (R2): Upon receiving a B(x ), process i does let x:=x +1; if (i is idle) go active. (R3): When process i goes idle, it does let x:=x+1; let k:=i; send message R(x, k) to all other processes; take a local snapshot for the request by R(x, k). (R4): Upon receiving message R(x, k ), process i does [((x, k ) > (x,k)) (i is idle) let (x,k):= (x, k ); take a local snapshot for the request by R(x, k ); ((x, k ) (x,k)) (i is idle) do nothing; (i is active) let x:=max(x, x)]. The last process to terminate will have the largest clock value. Therefore, every process will take a snapshot for it, however, it will not take a snapshot for any other process. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

9 Termination detection by Weight Throwing System Model A process called controlling agent monitors the computation. A communication channel exists between each of the processes and the controlling agent and also between every pair of processes. Initially, all processes are in the idle state. The weight at each process is zero and the weight at the controlling agent is 1. The computation starts when the controlling agent sends a basic message to one of the processes. A non-zero weight W (0<W 1) is assigned to each process in the active state and to each message in transit in the following manner: A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

10 Termination detection by Weight Throwing Basic Idea When a process sends a message, it sends a part of its weight in the message. When a processreceives a message, it adds the weight received in the message to it s weight. Thus, the sum of weights on all the processes and on all the messages in transit is always 1. When a process becomes passive, it sends its weight to the controlling agent in a control message, which the controlling agent adds to its weight. The controlling agent concludes termination if its weight becomes 1. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

11 Notations The weight on the controlling agent and a process is in general represented by W. B(DW) - a basic message B sent as a part of the computation, where DW is the weight assigned to it. C(DW) - a control message C sent from a process to the controlling agent where DW is the weight assigned to it. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

12 Algorithm The algorithm is defined by the following four rules: Rule 1: The controlling agent or an active process may send a basic message to one of the processes, say P, by splitting its weight W into W1 and W2 such that W1+W2=W, W1>0 and W2>0. It then assigns its weight W:=W1 and sends a basic message B(DW:=W2) to P. Rule 2: On the receipt of the message B(DW), process P adds DW to its weight W (W:=W+DW). If the receiving process is in the idle state, it becomes active. Rule 3: A process switches from the active state to the idle state at any time by sending a control message C(DW:=W) to the controlling agent and making its weight W:=0. Rule 4: On the receipt of a message C(DW), the controlling agent adds DW to its weight (W:=W+DW). If W=1, then it concludes that the computation has terminated. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

13 Correctness of Algorithm Notations A: set of weights on all active processes B: set of weights on all basic messages in transit C: set of weights on all control messages in transit W c : weight on the controlling agent. Two invariants I 1 and I 2 are defined for the algorithm: I 1 : W c + W = 1 W (A B C) I 2 : W (A B C), W>0 A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

14 Correctness of Algorithm Invariant I 1 states that sum of weights at the controlling process, at all active processes, on all basic messages in transit, and on all control messages in transit is always equal to 1. Invariant I 2 states that weight at each active process, on each basic message in transit, and on each control message in transit is non-zero. Hence, W c =1 W (A B C) W = 0 (by I 1) (A B C) = φ (by I 2 ) (A B) = φ. (A B) = φ implies the computation has terminated. Therefore, the algorithm never detects a false termination. Further, (A B) = φ W c + W C W = 1 (by I 1) Since the message delay is finite, after the computation has terminated, eventually W c =1. Thus, the algorithm detects a termination in finite time. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

15 Spanning-Tree-Based Termination Detection Algorithm There are N processes P i, 0 i N, which are modeled as the nodes i, 0 i N, of a fixed connected undirected graph. The edges of the graph represent the communication channels. The algorithm uses a fixed spanning tree of the graph with process P 0 at its root which is responsible for termination detection. Process P 0 communicates with other processes to determine their states through signals. All leaf nodes report to their parents, if they have terminated. A parent node will similarly report to its parent when it has completed processing and all of its immediate children have terminated, and so on. The root concludes that termination has occurred, if it has terminated and all of its immediate children have also terminated. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

16 Spanning-Tree-Based Termination Detection Algorithm Two waves of signals generated one moving inward and other outward through the spanning tree. Initially, a contracting wave of signals, called tokens, moves inward from leaves to the root. If this token wave reaches the root without discovering that termination has occurred, the root initiates a second outward wave of repeat signals. As this repeat wave reaches leaves, the token wave gradually forms and starts moving inward again, this sequence of events is repeated until the termination is detected. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

17 A spanning-tree-based termination detection algorithm Initially, each leaf process is given a token. Each leaf process, after it has terminated sends its token to its parent. When a parent process terminates and after it has received a token from each of its children, it sends a token to its parent. This way, each process indicates to its parent process that the subtree below it has become idle. In a similar manner, the tokens get propagated to the root. The root of the tree concludes that termination has occurred, after it has become idle and has received a token from each of its children. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

18 Spanning-Tree-Based Termination Detection Algorithm A Problem with the algorithm This simple algorithm fails under some circumstances, when a process after it has sent a token to its parent, receives a message from some other process, which could cause the process to again become active (See Figure 1). Hence the simple algorithm fails since the process that indicated to its parent that it has become idle, is now active because of the message it received from an active process. Hence, the root node just because it received a token from a child, can t conclude that all processes in the child s subtree have terminated. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

19 A spanning-tree-based termination detection algorithm T1 0 m 1 2 denotes a token T5 T6 Figure 1: An Example of the Problem. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

20 Spanning-Tree-Based Termination Detection Algorithm Main idea is to color the processes and tokens and change the color when messages such as in Figure 1 are involved. The algorithm works as follows: Initially, each leaf process is provided with a token. The set S is used for book-keeping to know which processes have the token Hence S will be the set of all leaves in the tree. Initially, all processes and tokens are colored white. When a leaf node terminates, it sends the token it holds to its parent process. A parent process will collect the token sent by each of its children. After it has received a token from all of its children and after it has terminated, the parent process sends a token to its parent. A process turns black when it sends a message to some other process. When a process terminates, if its color is black, it sends a black token to its parent. A black process turns back to white, after it has sent a black token to its parent. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

21 Message-Optimal Termination Detection The network is represented by a graph G = (V, E), where V is the set of nodes, and E V V is the set of edges or communication links. The communication links are bidirectional and exhibit FIFO property. The algorithm assumes the existence of a leader and a spanning tree in the network. If a leader is not available, the minimum spanning tree algorithm of Gallager et al. can be used to elect a leader and find a spanning tree using O( E + V log V ) messages. Spanning-tree-based termination detection algorithm is inefficient in terms of message complexity because every message of the underlying computation can potentially cause the execution of one more round of the termination detection algorithm, resulting in significant message traffic. This is explained next. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

22 Message-Optimal Termination Detection Consider the example shown in Figure 2. Suppose before node q receives message m, it has already sent a white token to its parent. Node p can not send a white token to its patent until node q becomes idle. To insure this, node p changes its color to black and sends a black token to its parent so that termination detection is performed again. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

23 Message-Optimal Termination Detection q s parent white token m p q Figure 2: Node p sends a message m to node q that has already sent a white token to its parent. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

24 Message-Optimal Termination Detection...Formal Description of the Algorithm Initially, all nodes in the network are in state NDT (not detecting termination) and all links are uncolored. For termination detection,the root node changes its state to DT (detecting termination) and sends a warning message on each of its outgoing edges. When a node p receives a warning message from its neighbor, say q, it colors the incoming link (q, p) and if it is in state NTD, it changes its state to DT, colors each of its outgoing edges, and sends a warning message on each of its outgoing edges. When a node p in state DT sends a basic message to its neighbor q, it keeps track of this information by pushing the entry TO(q) on its local stack. When a node x receives a basic message from node y on the link (y, x) that is colored by x, node x knows that the sender node y will need an acknowledgement for this message from it. The receiver node x keeps track of this information by pushing the entry FROM(y) on its local stack. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

25 Message-Optimal Termination Detection...Formal Description of the Algorithm Procedure receive message is given below: Procedure receive message(y: neighbor); (* performed when a node x receives a message from its neighbor y on the link (y,x) that was colored by x *) begin receive message from y on the link (y,x) if (link(y,x) has been colored by x) then push FROM(y) on the stack end; When a node p becomes idle, it calls procedure stack cleanup, which examines its stack from the top, and for every entry of the form FROM(q), it deletes the entry and sends the remove entry message to node q. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

26 Message-Optimal Termination Detection Formal Description of the Algorithm Node p repeats this until it encounters an entry of the form TO(x) on the stack. The idea behind this step is to inform those nodes that sent a message to p that the actions triggered by their messages to p are complete. Procedure stack cleanup; begin while (top entry on stack is not of the form TO() ) do begin pop the entry on the top of the stack; let the entry be FROM(q); send a remove entry message to q end end; A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

27 Message-Optimal Termination Detection Node x on receipt of the control message remove entry from node y, examines its stack from the top and deletes the first entry of the form TO(y) from the stack. If node x is idle, it also performs the stack cleanup operation. The procedure receive remove entry is defined as follows: Procedure receive remove entry(y: neighbor); (* performed when a node x receives a remove entry message from its neighbor y *) begin end; scan the stack and delete the first entry of the form TO(y); if idle then stack cleanup A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

28 Message-Optimal Termination Detection A node sends a terminate message to its parent when it satisfies all the following conditions: 1 It is idle. 2 Each of its incoming links is colored (it has received a warning message on each of its incoming links). 3 Its stack is empty. 4 It has received a terminate message from each of its children (this rule does not apply to leaf nodes). When the root node satisfies all of the above conditions, it concludes that the underlying computation has terminated. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

29 Performance In the worst case, each node in the network sends one warning message on each outgoing link. Thus, each link carries two warning messages, one in each direction. Since there are E links, the total number of warning messages generated by the algorithm is 2* E. For every message generated by the underlying computation,exactly one remove message is sent on the network. If M is the number of messages sent by the underlying computation, then at most M remove entry messages are used. Finally, each node sends exactly one terminate message to its parent and since there are only V nodes and V 1 tree edges, only V 1 terminate messages are sent. Hence, the total number of messages generated by the algorithm is 2* E + V 1 + M. Thus, the message complexity of the algorithm is O( E + M) as E > V 1 for any connected network. The algorithm is asymptotically optimal in the number of messages. A. Kshemkalyani and M. Singhal (Distributed Computing) Termination Detection CUP / 30

### Chapter 9: Distributed Mutual Exclusion Algorithms

Chapter 9: Distributed Mutual Exclusion Algorithms Ajay Kshemkalyani and Mukesh Singhal Distributed Computing: Principles, Algorithms, and Systems Cambridge University Press A. Kshemkalyani and M. Singhal

### 6.852: Distributed Algorithms Fall, 2009. Class 2

.8: Distributed Algorithms Fall, 009 Class Today s plan Leader election in a synchronous ring: Lower bound for comparison-based algorithms. Basic computation in general synchronous networks: Leader election

### Multimedia Communications. Huffman Coding

Multimedia Communications Huffman Coding Optimal codes Suppose that a i -> w i C + is an encoding scheme for a source alphabet A={a 1,, a N }. Suppose that the source letter a 1,, a N occur with relative

### Logical Clocks and Causal Ordering

Logical Clocks and Causal Ordering CS60002: Distributed Systems Pallab Dasgupta Dept. of Computer Sc. & Engg., Indian Institute of Technology Kharagpur Why do we need global clocks? For causally ordering

### Network (Tree) Topology Inference Based on Prüfer Sequence

Network (Tree) Topology Inference Based on Prüfer Sequence C. Vanniarajan and Kamala Krithivasan Department of Computer Science and Engineering Indian Institute of Technology Madras Chennai 600036 vanniarajanc@hcl.in,

### Sample Problems in Discrete Mathematics

Sample Problems in Discrete Mathematics This handout lists some sample problems that you should be able to solve as a pre-requisite to Computer Algorithms Try to solve all of them You should also read

### IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics* Rakesh Nagi Department of Industrial Engineering University at Buffalo (SUNY) *Lecture notes from Network Flows by Ahuja, Magnanti

Chapter 7 Load Balancing and Termination Detection Load balancing used to distribute computations fairly across processors in order to obtain the highest possible execution speed. Termination detection

### Load Balancing and Termination Detection

Chapter 7 Load Balancing and Termination Detection 1 Load balancing used to distribute computations fairly across processors in order to obtain the highest possible execution speed. Termination detection

### COT5405 Analysis of Algorithms Homework 3 Solutions

COT0 Analysis of Algorithms Homework 3 Solutions. Prove or give a counter example: (a) In the textbook, we have two routines for graph traversal - DFS(G) and BFS(G,s) - where G is a graph and s is any

### Algorithms and Data Structures

Algorithms and Data Structures Part 2: Data Structures PD Dr. rer. nat. habil. Ralf-Peter Mundani Computation in Engineering (CiE) Summer Term 2016 Overview general linked lists stacks queues trees 2 2

### CMSC 451: Graph Properties, DFS, BFS, etc.

CMSC 451: Graph Properties, DFS, BFS, etc. Slides By: Carl Kingsford Department of Computer Science University of Maryland, College Park Based on Chapter 3 of Algorithm Design by Kleinberg & Tardos. Graphs

### An Efficient Distributed Algorithm to Identify and Traceback DDoS Traffic

Ó The Author 26. Published by Oxford University Press on behalf of The British Computer Society. All rights reserved. For Permissions, please email: journals.permissions@oxfordjournals.org doi:1.193/comjnl/bxl26

### Load Balancing and Termination Detection

Chapter 7 slides7-1 Load Balancing and Termination Detection slides7-2 Load balancing used to distribute computations fairly across processors in order to obtain the highest possible execution speed. Termination

### Full and Complete Binary Trees

Full and Complete Binary Trees Binary Tree Theorems 1 Here are two important types of binary trees. Note that the definitions, while similar, are logically independent. Definition: a binary tree T is full

### Homework 15 Solutions

PROBLEM ONE (Trees) Homework 15 Solutions 1. Recall the definition of a tree: a tree is a connected, undirected graph which has no cycles. Which of the following definitions are equivalent to this definition

### Distributed Algorithms

Distributed Algorithms Wan Fokkink Distributed Algorithms: An Intuitive Approach MIT Press, 2013 (revised 1st edition, 2015) 1 / 325 Algorithms A skilled programmer must have good insight into algorithms.

### 12 Abstract Data Types

12 Abstract Data Types 12.1 Source: Foundations of Computer Science Cengage Learning Objectives After studying this chapter, the student should be able to: Define the concept of an abstract data type (ADT).

### Graphs and Network Flows IE411 Lecture 1

Graphs and Network Flows IE411 Lecture 1 Dr. Ted Ralphs IE411 Lecture 1 1 References for Today s Lecture Required reading Sections 17.1, 19.1 References AMO Chapter 1 and Section 2.1 and 2.2 IE411 Lecture

### EKSAMEN / EXAM TTM4100 18 05 2007

1.1 1.1.1...... 1.1.2...... 1.1.3...... 1.1.4...... 1.1.5...... 1.1.6...... 1.1.7...... 1.1.8...... 1.1.9...... 1.1.10.... 1.1.11... 1.1.16.... 1.1.12... 1.1.17.... 1.1.13... 1.1.18.... 1.1.14... 1.1.19....

### PART II Algorithms for Message- Passing Systems. Section 7 Introduction Model Basic Graph Algorithms

PART II Algorithms for Message- Passing Systems Section 7 Introduction Model Basic Graph Algorithms 1 Formal Model for Message-Passing Systems There are n processes in the system: p 0,.., p n-1 Each process

### Model Simulation in Rational Software Architect: Business Process Simulation

Model Simulation in Rational Software Architect: Business Process Simulation Mattias Mohlin Senior Software Architect IBM The BPMN (Business Process Model and Notation) is the industry standard notation

### Lecture Notes on Spanning Trees

Lecture Notes on Spanning Trees 15-122: Principles of Imperative Computation Frank Pfenning Lecture 26 April 26, 2011 1 Introduction In this lecture we introduce graphs. Graphs provide a uniform model

### Load Balancing and Termination Detection

Chapter 7 Slide 1 Slide 2 Load Balancing and Termination Detection Load balancing used to distribute computations fairly across processors in order to obtain the highest possible execution speed. Termination

### Clock Synchronization. Physical Clocks

Clock Synchronization Physical clocks Logical clocks Vector clocks Physical Clocks Problem: Suppose we have a distributed system with a UTCreceiver somewhere in it we still have to distribute its time

### AS-2261 M.Sc.(First Semester) Examination-2013 Paper -fourth Subject-Data structure with algorithm

AS-2261 M.Sc.(First Semester) Examination-2013 Paper -fourth Subject-Data structure with algorithm Time: Three Hours] [Maximum Marks: 60 Note Attempts all the questions. All carry equal marks Section A

### Minimum Spanning Trees

Minimum Spanning Trees Algorithms and 18.304 Presentation Outline 1 Graph Terminology Minimum Spanning Trees 2 3 Outline Graph Terminology Minimum Spanning Trees 1 Graph Terminology Minimum Spanning Trees

### Binary Search Trees. Data in each node. Larger than the data in its left child Smaller than the data in its right child

Binary Search Trees Data in each node Larger than the data in its left child Smaller than the data in its right child FIGURE 11-6 Arbitrary binary tree FIGURE 11-7 Binary search tree Data Structures Using

### Discrete Mathematics, Chapter 5: Induction and Recursion

Discrete Mathematics, Chapter 5: Induction and Recursion Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 5 1 / 20 Outline 1 Well-founded

### CS268: Geometric Algorithms Handout #5 Design and Analysis Original Handout #15 Stanford University Tuesday, 25 February 1992

CS268: Geometric Algorithms Handout #5 Design and Analysis Original Handout #15 Stanford University Tuesday, 25 February 1992 Original Lecture #6: 28 January 1991 Topics: Triangulating Simple Polygons

### The Goldberg Rao Algorithm for the Maximum Flow Problem

The Goldberg Rao Algorithm for the Maximum Flow Problem COS 528 class notes October 18, 2006 Scribe: Dávid Papp Main idea: use of the blocking flow paradigm to achieve essentially O(min{m 2/3, n 1/2 }

### Chapter 7 Load Balancing and Termination Detection

Chapter 7 Load Balancing and Termination Detection Load balancing used to distribute computations fairly across processors in order to obtain the highest possible execution speed. Termination detection

### DATA ANALYSIS II. Matrix Algorithms

DATA ANALYSIS II Matrix Algorithms Similarity Matrix Given a dataset D = {x i }, i=1,..,n consisting of n points in R d, let A denote the n n symmetric similarity matrix between the points, given as where

### Graph. Consider a graph, G in Fig Then the vertex V and edge E can be represented as:

Graph A graph G consist of 1. Set of vertices V (called nodes), (V = {v1, v2, v3, v4...}) and 2. Set of edges E (i.e., E {e1, e2, e3...cm} A graph can be represents as G = (V, E), where V is a finite and

### Topology-based network security

Topology-based network security Tiit Pikma Supervised by Vitaly Skachek Research Seminar in Cryptography University of Tartu, Spring 2013 1 Introduction In both wired and wireless networks, there is the

### Analysis of Algorithms, I

Analysis of Algorithms, I CSOR W4231.002 Eleni Drinea Computer Science Department Columbia University Thursday, February 26, 2015 Outline 1 Recap 2 Representing graphs 3 Breadth-first search (BFS) 4 Applications

### each college c i C has a capacity q i - the maximum number of students it will admit

n colleges in a set C, m applicants in a set A, where m is much larger than n. each college c i C has a capacity q i - the maximum number of students it will admit each college c i has a strict order i

### OPTIMAL DESIGN OF DISTRIBUTED SENSOR NETWORKS FOR FIELD RECONSTRUCTION

OPTIMAL DESIGN OF DISTRIBUTED SENSOR NETWORKS FOR FIELD RECONSTRUCTION Sérgio Pequito, Stephen Kruzick, Soummya Kar, José M. F. Moura, A. Pedro Aguiar Department of Electrical and Computer Engineering

### Chapter 7: Queues and Deques

Chapter 7: Queues and Deques After the stack, the next simplest data abstraction is the queue. As with the stack, the queue can be visualized with many examples you are already familiar with from everyday

### Homework Exam 1, Geometric Algorithms, 2016

Homework Exam 1, Geometric Algorithms, 2016 1. (3 points) Let P be a convex polyhedron in 3-dimensional space. The boundary of P is represented as a DCEL, storing the incidence relationships between the

### 1 Gaussian Elimination

Contents 1 Gaussian Elimination 1.1 Elementary Row Operations 1.2 Some matrices whose associated system of equations are easy to solve 1.3 Gaussian Elimination 1.4 Gauss-Jordan reduction and the Reduced

### Rotation Operation for Binary Search Trees Idea:

Rotation Operation for Binary Search Trees Idea: Change a few pointers at a particular place in the tree so that one subtree becomes less deep in exchange for another one becoming deeper. A sequence of

### Lecture 7: Approximation via Randomized Rounding

Lecture 7: Approximation via Randomized Rounding Often LPs return a fractional solution where the solution x, which is supposed to be in {0, } n, is in [0, ] n instead. There is a generic way of obtaining

### Synchronization in Distributed Systems

Synchronization in Distributed Systems Chapter 4: Time and Synchronisation Page 1 1 Cooperation and Coordination in Distributed Systems Communication Mechanisms for the communication between processes

### Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Algorithms Efficiency of algorithms Computational resources: time and space Best, worst and average case performance How to compare algorithms: machine-independent measure of efficiency Growth rate Complexity

### Graph Theory Problems and Solutions

raph Theory Problems and Solutions Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is

### 6.02 Practice Problems: Routing

1 of 9 6.02 Practice Problems: Routing IMPORTANT: IN ADDITION TO THESE PROBLEMS, PLEASE SOLVE THE PROBLEMS AT THE END OF CHAPTERS 17 AND 18. Problem 1. Consider the following networks: network I (containing

### Load Balancing. Load Balancing 1 / 24

Load Balancing Backtracking, branch & bound and alpha-beta pruning: how to assign work to idle processes without much communication? Additionally for alpha-beta pruning: implementing the young-brothers-wait

### Attacking Anonymized Social Network

Attacking Anonymized Social Network From: Wherefore Art Thou RX3579X? Anonymized Social Networks, Hidden Patterns, and Structural Steganography Presented By: Machigar Ongtang (Ongtang@cse.psu.edu ) Social

### Solutions to Exercises 8

Discrete Mathematics Lent 2009 MA210 Solutions to Exercises 8 (1) Suppose that G is a graph in which every vertex has degree at least k, where k 1, and in which every cycle contains at least 4 vertices.

### A. V. Gerbessiotis CS Spring 2014 PS 3 Mar 24, 2014 No points

A. V. Gerbessiotis CS 610-102 Spring 2014 PS 3 Mar 24, 2014 No points Problem 1. Suppose that we insert n keys into a hash table of size m using open addressing and uniform hashing. Let p(n, m) be the

### Chapter 4. Trees. 4.1 Basics

Chapter 4 Trees 4.1 Basics A tree is a connected graph with no cycles. A forest is a collection of trees. A vertex of degree one, particularly in a tree, is called a leaf. Trees arise in a variety of applications.

### Graph Theory. Directed and undirected graphs make useful mental models for many situations. These objects are loosely defined as follows:

Graph Theory Directed and undirected graphs make useful mental models for many situations. These objects are loosely defined as follows: Definition An undirected graph is a (finite) set of nodes, some

### UML Activities & Actions. Charles ANDRE - UNSA

UML Activities & Actions Action & Object Nodes Accept inputs, start behaviors, provide outputs Object/Data flow Control flow Send Envoice Invoice Make Payment Accept Payment Invoice1234: Invoice Invoice1234:

### Social Media Mining. Graph Essentials

Graph Essentials Graph Basics Measures Graph and Essentials Metrics 2 2 Nodes and Edges A network is a graph nodes, actors, or vertices (plural of vertex) Connections, edges or ties Edge Node Measures

### Analysis of Algorithms I: Optimal Binary Search Trees

Analysis of Algorithms I: Optimal Binary Search Trees Xi Chen Columbia University Given a set of n keys K = {k 1,..., k n } in sorted order: k 1 < k 2 < < k n we wish to build an optimal binary search

### Long questions answer Advanced Mathematics for Computer Application If P= , find BT. 19. If B = 1 0, find 2B and -3B.

Unit-1: Matrix Algebra Short questions answer 1. What is Matrix? 2. Define the following terms : a) Elements matrix b) Row matrix c) Column matrix d) Diagonal matrix e) Scalar matrix f) Unit matrix OR

### Hash-based Digital Signature Schemes

Hash-based Digital Signature Schemes Johannes Buchmann Erik Dahmen Michael Szydlo October 29, 2008 Contents 1 Introduction 2 2 Hash based one-time signature schemes 3 2.1 Lamport Diffie one-time signature

### Edge-to-Edge Measurement-based Distributed Network Monitoring

Edge-to-Edge Measurement-based Distributed Network Monitoring Ahsan Habib, Maleq Khan, and Bharat Bhargava Center for Education and Research in Information Assurance and Security (CERIAS) and Department

### Factoring Trinomials: The ac Method

6.7 Factoring Trinomials: The ac Method 6.7 OBJECTIVES 1. Use the ac test to determine whether a trinomial is factorable over the integers 2. Use the results of the ac test to factor a trinomial 3. For

### Synchronization in. Distributed Systems. Cooperation and Coordination in. Distributed Systems. Kinds of Synchronization.

Cooperation and Coordination in Distributed Systems Communication Mechanisms for the communication between processes Naming for searching communication partners Synchronization in Distributed Systems But...

### Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm

### An Empirical Study of Two MIS Algorithms

An Empirical Study of Two MIS Algorithms Email: Tushar Bisht and Kishore Kothapalli International Institute of Information Technology, Hyderabad Hyderabad, Andhra Pradesh, India 32. tushar.bisht@research.iiit.ac.in,

### Distributed Computing over Communication Networks: Maximal Independent Set

Distributed Computing over Communication Networks: Maximal Independent Set What is a MIS? MIS An independent set (IS) of an undirected graph is a subset U of nodes such that no two nodes in U are adjacent.

### 3(vi) B. Answer: False. 3(vii) B. Answer: True

Mathematics 0N1 Solutions 1 1. Write the following sets in list form. 1(i) The set of letters in the word banana. {a, b, n}. 1(ii) {x : x 2 + 3x 10 = 0}. 3(iv) C A. True 3(v) B = {e, e, f, c}. True 3(vi)

### THE ARCHIVAL SECTOR IN DW2.0 By W H Inmon

The fourth sector of the DW2.0 environment is the archival sector. Fig arch.1 shows the architectural positioning of the archival sector. Fig arch.1 The archival sector All data that flows into the archival

### Experiments on the local load balancing algorithms; part 1

Experiments on the local load balancing algorithms; part 1 Ştefan Măruşter Institute e-austria Timisoara West University of Timişoara, Romania maruster@info.uvt.ro Abstract. In this paper the influence

### Graphs without proper subgraphs of minimum degree 3 and short cycles

Graphs without proper subgraphs of minimum degree 3 and short cycles Lothar Narins, Alexey Pokrovskiy, Tibor Szabó Department of Mathematics, Freie Universität, Berlin, Germany. August 22, 2014 Abstract

### Back Propagation Neural Networks User Manual

Back Propagation Neural Networks User Manual Author: Lukáš Civín Library: BP_network.dll Runnable class: NeuralNetStart Document: Back Propagation Neural Networks Page 1/28 Content: 1 INTRODUCTION TO BACK-PROPAGATION

### Trees. Tree Definitions: Let T = (V, E, r) be a tree. The size of a tree denotes the number of nodes of the tree.

Trees After lists (including stacks and queues) and hash tables, trees represent one of the most widely used data structures. On one hand trees can be used to represent objects that are recursive in nature

### Level 2 Routing: LAN Bridges and Switches

Level 2 Routing: LAN Bridges and Switches Norman Matloff University of California at Davis c 2001, N. Matloff September 6, 2001 1 Overview In a large LAN with consistently heavy traffic, it may make sense

### Static Load Balancing

Load Balancing Load Balancing Load balancing: distributing data and/or computations across multiple processes to maximize efficiency for a parallel program. Static load-balancing: the algorithm decides

### minimal polyonomial Example

Minimal Polynomials Definition Let α be an element in GF(p e ). We call the monic polynomial of smallest degree which has coefficients in GF(p) and α as a root, the minimal polyonomial of α. Example: We

### Min-cost flow problems and network simplex algorithm

Min-cost flow problems and network simplex algorithm The particular structure of some LP problems can be sometimes used for the design of solution techniques more efficient than the simplex algorithm.

### Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

### Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

7 Catalan Numbers Thomas A. Dowling, Department of Mathematics, Ohio State Uni- Author: versity. Prerequisites: The prerequisites for this chapter are recursive definitions, basic counting principles,

### COLORED GRAPHS AND THEIR PROPERTIES

COLORED GRAPHS AND THEIR PROPERTIES BEN STEVENS 1. Introduction This paper is concerned with the upper bound on the chromatic number for graphs of maximum vertex degree under three different sets of coloring

### Module 6. Embedded System Software. Version 2 EE IIT, Kharagpur 1

Module 6 Embedded System Software Version 2 EE IIT, Kharagpur 1 Lesson 30 Real-Time Task Scheduling Part 2 Version 2 EE IIT, Kharagpur 2 Specific Instructional Objectives At the end of this lesson, the

### CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma

CMSC 858T: Randomized Algorithms Spring 2003 Handout 8: The Local Lemma Please Note: The references at the end are given for extra reading if you are interested in exploring these ideas further. You are

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

### 2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Code No: R05220502 Set No. 1 1. (a) Describe the performance analysis in detail. (b) Show that f 1 (n)+f 2 (n) = 0(max(g 1 (n), g 2 (n)) where f 1 (n) = 0(g 1 (n)) and f 2 (n) = 0(g 2 (n)). [8+8] 2. (a)

### Today s Agenda. Automata and Logic. Quiz 4 Temporal Logic. Introduction Buchi Automata Linear Time Logic Summary

Today s Agenda Quiz 4 Temporal Logic Formal Methods in Software Engineering 1 Automata and Logic Introduction Buchi Automata Linear Time Logic Summary Formal Methods in Software Engineering 2 1 Buchi Automata

### 6.042/18.062J Mathematics for Computer Science October 3, 2006 Tom Leighton and Ronitt Rubinfeld. Graph Theory III

6.04/8.06J Mathematics for Computer Science October 3, 006 Tom Leighton and Ronitt Rubinfeld Lecture Notes Graph Theory III Draft: please check back in a couple of days for a modified version of these

### Flip-Flops, Registers, Counters, and a Simple Processor

June 8, 22 5:56 vra235_ch7 Sheet number Page number 349 black chapter 7 Flip-Flops, Registers, Counters, and a Simple Processor 7. Ng f3, h7 h6 349 June 8, 22 5:56 vra235_ch7 Sheet number 2 Page number

### Data Structure [Question Bank]

Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:

### 2 using read and write operations. A schedule is called correct" if we can find a serial schedule that is equivalent" to it. Given a set of transactio

1 1. CONCURRENCY CONTROL CS 242: Operating Systems Transactions Prasun Dewan The synchronization primitives we have seen so far are not as high-level as we might want them to be since they require programmers

### Theorem A graph T is a tree if, and only if, every two distinct vertices of T are joined by a unique path.

Chapter 3 Trees Section 3. Fundamental Properties of Trees Suppose your city is planning to construct a rapid rail system. They want to construct the most economical system possible that will meet the

### Design of LDPC codes

Design of LDPC codes Codes from finite geometries Random codes: Determine the connections of the bipartite Tanner graph by using a (pseudo)random algorithm observing the degree distribution of the code

### Lesson 3. Algebraic graph theory. Sergio Barbarossa. Rome - February 2010

Lesson 3 Algebraic graph theory Sergio Barbarossa Basic notions Definition: A directed graph (or digraph) composed by a set of vertices and a set of edges We adopt the convention that the information flows

### A single minimal complement for the c.e. degrees

A single minimal complement for the c.e. degrees Andrew Lewis Leeds University, April 2002 Abstract We show that there exists a single minimal (Turing) degree b < 0 s.t. for all c.e. degrees 0 < a < 0,

### Planar Tree Transformation: Results and Counterexample

Planar Tree Transformation: Results and Counterexample Selim G Akl, Kamrul Islam, and Henk Meijer School of Computing, Queen s University Kingston, Ontario, Canada K7L 3N6 Abstract We consider the problem

### Lecture 10: Regression Trees

Lecture 10: Regression Trees 36-350: Data Mining October 11, 2006 Reading: Textbook, sections 5.2 and 10.5. The next three lectures are going to be about a particular kind of nonlinear predictive model,

### CHAPTER 5 FINITE STATE MACHINE FOR LOOKUP ENGINE

CHAPTER 5 71 FINITE STATE MACHINE FOR LOOKUP ENGINE 5.1 INTRODUCTION Finite State Machines (FSMs) are important components of digital systems. Therefore, techniques for area efficiency and fast implementation

### The Trip Scheduling Problem

The Trip Scheduling Problem Claudia Archetti Department of Quantitative Methods, University of Brescia Contrada Santa Chiara 50, 25122 Brescia, Italy Martin Savelsbergh School of Industrial and Systems

### 2.3 Scheduling jobs on identical parallel machines

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

### Data Structure with C

Subject: Data Structure with C Topic : Tree Tree A tree is a set of nodes that either:is empty or has a designated node, called the root, from which hierarchically descend zero or more subtrees, which

### Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 17 Shannon-Fano-Elias Coding and Introduction to Arithmetic Coding