Lock-Free Queue with Constant Time Snapshots

Total Page:16

File Type:pdf, Size:1020Kb

Lock-Free Queue with Constant Time Snapshots SnapQueue: Lock-Free Queue with Constant Time Snapshots Aleksandar Prokopec École Polytechnique Fédérale de Lausanne, Switzerland [email protected]fl.ch Abstract Concurrent queues are used as buffers between producers We introduce SnapQueues - concurrent, lock-free queues and consumers in streaming platforms, as event queues in with a linearizable, lock-free global-state transition oper- reactive programming frameworks, or mailbox implementa- ation. This transition operation can atomically switch be- tions in actor systems. Traditionally, concurrent queues ex- tween arbitrary SnapQueue states, and is used by enqueue, pose enqueue and dequeue operations. Augmenting them dequeue, snapshot and concatenation operations. We show with atomic global operations opens several new use cases: that implementing these operations efficiently depends on • Persisting actor state: Actor frameworks expose persis- the persistent data structure at the core of the SnapQueue. tence modules to persist and recover actor state [1]. Per- This immutable support data structure is an interchange- sisting the state requires blocking the mailbox until the able kernel of the SnapQueue, and drives its performance pending messages are copied. With an efficient snapshot characteristics. The design allows reasoning about concur- operation, the mailbox can be persisted in real-time. rent operation running time in a functional way, absent from concurrency considerations. We present a support data struc- • Forking actors: Adding a fork or a choice operator ture that enables O(1) queue operations, O(1) snapshot and to the actor model [26] requires copying the contents O(log n) atomic concurrent concatenation. We show that the of the mailbox. To achieve atomicity, the corresponding SnapQueue enqueue operation achieves up to 25% higher actor is blocked during the copying and cannot access the performance, while the dequeue operation has performance mailbox. Efficient snapshots help avoid this problem. identical to standard lock-free concurrent queues. • Dynamic stream fusion: Streaming platforms express Categories and Subject Descriptors E.1 [Data Struc- computations as dataflow graphs. Each node in this graph tures]: Lists, stacks and queues executes a modular subset of the computation, but also introduces some buffering overhead [24]. Runtime opti- Keywords queues, lock-free, concatenation, snapshots mizations eliminate this overhead by fusing subsets of the graph. Efficient, atomic buffer concatenation and joining 1. Introduction allow optimizations without blocking the computation. Scalability in a concurrent data structure is achieved by al- This paper introduces a lock-free queue implementation, lowing concurrent accesses to execute independently on sep- called SnapQueue, which, in addition to enqueue and de- arate parts of the data structure. While efficient concurrent queue operations, exposes an efficient, atomic, lock-free implementations exist for many different data structure types transition operation. The transition operation is used to im- [15], efficient operations that change their global state are plement snapshots, concatenation, rebalancing and queue still largely unexplored. For example, most concurrent hash expansion. Although SnapQueue is a concurrent data struc- tables [7] [13], concurrent skip lists [21], and concurrent ture, it relies on a persistent data structure to encode its state. queues [14] [22] do not have an atomic snapshot operation, We describe the SnapQueue data structure incrementally: size retrieval or a clear operation. 1. We describe lock-free single-shot queues, or segments, and their enqueue and dequeue operations in Section 2. Permission to make digital or hard copies of all or part of this work for personal or Permissionclassroom use to makeis granted digital without or hard fee copies provided of all that or copies part of are this not work made for orpersonal distributed or 2. We show that segments can be atomically frozen, i.e. classroomfor profit or use commercial is granted advantage without fee and provided that copies that bear copies this are notice not andmade the or full distributed citation transformed into a persistent data structure. foronthe profit first or page. commercial Copyrights advantage for components and that copies of this bear work this owned notice by and others the full than citation ACM onmust the be first honored. page. CopyrightsAbstracting for with components credit is permitted. of this work To copy owned otherwise, by others or thanrepublish, ACM 3. We describe SnapQueues and their fundamental atomic mustto post be on honored. servers Abstracting or to redistribute with credit to lists, is permitted.requires prior Tocopy specific otherwise, permission or republish, and/or a tofee. post Request on servers permissions or to redistribute from [email protected]. to lists, requires prior specific permission and/or a operation called transition in Section 3. fee. Request permissions from [email protected]. Scala ’15, June 13–14, 2015, Portland, Oregon, USA. SCALA’15Copyright c, June2015 13, ACM 2015, 978-1-4503-3626-0/15/06. Portland, OR, USA . $15.00. 4. We implement SnapQueue enqueue, dequeue, snapshot Copyrighthttp://dx.doi.org/10.1145/nnnnnnn.nnnnnnn 2015 ACM 978-1-4503-3626-0/15/06...$15.00 and concatenation using the transition operation. http://dx.doi.org/10.1145/2774975.2774976 1 EMPTY NON-EMPTY FULL 1 @tailrec def enq(p: Int, x: T): Boolean = head last head last head last 2 if (p >= 0 && p < array.length) { 3 if (CAS(array(p), EMPTY, x)) { array 4 WRITE(last, p + 1) 5 true } else enq(findLast(p), x) Figure 1. Single-Shot Queue Illustration 6 7 } else false 8 @tailrec def findLast(p: Int): Int = { 9 val x = READ(array(p)) class Segment[T]( 10 if (x == EMPTY) p val array = new VolatileArray[T], 11 else if (x == FROZEN) array.length @volatile var head: Int = 0, 12 else if (p + 1 == array.length) p + 1 @volatile var last: Int = 0) 13 else findLast(p + 1) 14 } Figure 2. Single-Shot Queue Data Type Figure 3. Single-Shot Queue Enqueue Operation 5. We show how to tune the running time of SnapQueue As we will see in Section 2.2, a single-shot queue can operations using persistent data structures in Section 4. become frozen, in which case no subsequent enqueue or 6. We evaluate SnapQueues against similar concurrent dequeue operations can succeed. In this frozen state, array queue implementations in Section 5, and show that hav- may contain a special FROZEN value. ing snapshot support adds little or no overhead. 2.1 Basic Operations The goal of the paper is not only to propose a novel concur- rent, lock-free queue with atomic constant time snapshots, In this section, we study the basic single-shot queue oper- but also to reproach the common belief that persistent data ations. The enqueue operation overwrites an EMPTY entry in structures are slow, and consequently irrelevant for high- the array. At all times, it ensures that the array corresponds p n m performance parallel and concurrent computing. As this pa- to the string REMOVED · T · EMPTY , where T is the el- per shows, persistent data structures can simplify the devel- ement type, and array length is L = p + n + m. After opment of and reasoning about concurrent data structures. inserting an element, enqueue sets the last field to point to For the sake of conciseness, code listings slightly diverge the first EMPTY entry. from valid Scala code in several ways. First, atomic READ, We define an auxiliary enq method in Figure 3, which WRITE and CAS operations differ from standard Scala syn- takes an estimated position p of the first EMPTY entry, and an tax, which relies on the Unsafe class. These operations re- element x. The enq first checks that p is within the bounds tain the standard Java volatile semantics, and are used to ac- of array. It then attempts to atomically CAS an EMPTY entry cess volatile object fields. Second, volatile arrays are rep- with x in line 3. An unsuccessful CAS implies that another resented with a non-existent VolatileArray class. Finally, enq call succeeded, so findLast finds the first special en- generically typed methods sometimes accept or return spe- try, and enq is retried. A successful CAS means that x is cial singleton values. This does not type-check in Scala, but enqueued, so the value last is increased in line 4. Due to can be worked around at a small syntactic cost. The com- potential concurrent stale writes, last is an underestimate. plete SnapQueue implementation can be found in our online The enq precondition is that p is less than or equal than code repository [2]. the actual first EMPTY entry position. This is trivially ensured by specifying the last field when calling enq. 2. Single-Shot Lock-Free Queue Lemma 1. If enq returns true, then its CAS operation added an element to the queue. Otherwise, the queue is We start by examining a simplistic lock-free queue imple- either full or frozen. mentation, called a single-shot lock-free queue. This queue is bounded – it can contain only up to L elements. Second, Dequeue atomically increments the head field to point to only up to L enqueue and up to L dequeue operations can the next element in the queue. Unlike last, the head field be invoked on this queue. Despite these limited capabilities, always precisely describes the position of the first unread single-shot lock-free queue is the basic building block of the element. When head becomes larger than array length, SnapQueue, as we show in Section 3. the queue is either empty or frozen. Similarly, when head Single-shot queue is defined by a single data type called points to EMPTY or FROZEN, the queue is considered empty Segment, shown in Figure 2. Segment contains an array or frozen, respectively. of queue elements, initially filled with special EMPTY values, The deq method in Figure 4 starts by reading head to a head – the position of the first element in the queue, and local variable p, and checks if p is within bounds.
Recommended publications
  • Log4j-Users-Guide.Pdf
    ...................................................................................................................................... Apache Log4j 2 v. 2.2 User's Guide ...................................................................................................................................... The Apache Software Foundation 2015-02-22 T a b l e o f C o n t e n t s i Table of Contents ....................................................................................................................................... 1. Table of Contents . i 2. Introduction . 1 3. Architecture . 3 4. Log4j 1.x Migration . 10 5. API . 16 6. Configuration . 18 7. Web Applications and JSPs . 48 8. Plugins . 56 9. Lookups . 60 10. Appenders . 66 11. Layouts . 120 12. Filters . 140 13. Async Loggers . 153 14. JMX . 167 15. Logging Separation . 174 16. Extending Log4j . 176 17. Extending Log4j Configuration . 184 18. Custom Log Levels . 187 © 2 0 1 5 , T h e A p a c h e S o f t w a r e F o u n d a t i o n • A L L R I G H T S R E S E R V E D . T a b l e o f C o n t e n t s ii © 2 0 1 5 , T h e A p a c h e S o f t w a r e F o u n d a t i o n • A L L R I G H T S R E S E R V E D . 1 I n t r o d u c t i o n 1 1 Introduction ....................................................................................................................................... 1.1 Welcome to Log4j 2! 1.1.1 Introduction Almost every large application includes its own logging or tracing API. In conformance with this rule, the E.U.
    [Show full text]
  • Lecture 26 Fall 2019 Instructors: B&S Administrative Details
    CSCI 136 Data Structures & Advanced Programming Lecture 26 Fall 2019 Instructors: B&S Administrative Details • Lab 9: Super Lexicon is online • Partners are permitted this week! • Please fill out the form by tonight at midnight • Lab 6 back 2 2 Today • Lab 9 • Efficient Binary search trees (Ch 14) • AVL Trees • Height is O(log n), so all operations are O(log n) • Red-Black Trees • Different height-balancing idea: height is O(log n) • All operations are O(log n) 3 2 Implementing the Lexicon as a trie There are several different data structures you could use to implement a lexicon— a sorted array, a linked list, a binary search tree, a hashtable, and many others. Each of these offers tradeoffs between the speed of word and prefix lookup, amount of memory required to store the data structure, the ease of writing and debugging the code, performance of add/remove, and so on. The implementation we will use is a special kind of tree called a trie (pronounced "try"), designed for just this purpose. A trie is a letter-tree that efficiently stores strings. A node in a trie represents a letter. A path through the trie traces out a sequence ofLab letters that9 represent : Lexicon a prefix or word in the lexicon. Instead of just two children as in a binary tree, each trie node has potentially 26 child pointers (one for each letter of the alphabet). Whereas searching a binary search tree eliminates half the words with a left or right turn, a search in a trie follows the child pointer for the next letter, which narrows the search• Goal: to just words Build starting a datawith that structure letter.
    [Show full text]
  • Search Trees
    Lecture III Page 1 “Trees are the earth’s endless effort to speak to the listening heaven.” – Rabindranath Tagore, Fireflies, 1928 Alice was walking beside the White Knight in Looking Glass Land. ”You are sad.” the Knight said in an anxious tone: ”let me sing you a song to comfort you.” ”Is it very long?” Alice asked, for she had heard a good deal of poetry that day. ”It’s long.” said the Knight, ”but it’s very, very beautiful. Everybody that hears me sing it - either it brings tears to their eyes, or else -” ”Or else what?” said Alice, for the Knight had made a sudden pause. ”Or else it doesn’t, you know. The name of the song is called ’Haddocks’ Eyes.’” ”Oh, that’s the name of the song, is it?” Alice said, trying to feel interested. ”No, you don’t understand,” the Knight said, looking a little vexed. ”That’s what the name is called. The name really is ’The Aged, Aged Man.’” ”Then I ought to have said ’That’s what the song is called’?” Alice corrected herself. ”No you oughtn’t: that’s another thing. The song is called ’Ways and Means’ but that’s only what it’s called, you know!” ”Well, what is the song then?” said Alice, who was by this time completely bewildered. ”I was coming to that,” the Knight said. ”The song really is ’A-sitting On a Gate’: and the tune’s my own invention.” So saying, he stopped his horse and let the reins fall on its neck: then slowly beating time with one hand, and with a faint smile lighting up his gentle, foolish face, he began..
    [Show full text]
  • Comparison of Dictionary Data Structures
    A Comparison of Dictionary Implementations Mark P Neyer April 10, 2009 1 Introduction A common problem in computer science is the representation of a mapping between two sets. A mapping f : A ! B is a function taking as input a member a 2 A, and returning b, an element of B. A mapping is also sometimes referred to as a dictionary, because dictionaries map words to their definitions. Knuth [?] explores the map / dictionary problem in Volume 3, Chapter 6 of his book The Art of Computer Programming. He calls it the problem of 'searching,' and presents several solutions. This paper explores implementations of several different solutions to the map / dictionary problem: hash tables, Red-Black Trees, AVL Trees, and Skip Lists. This paper is inspired by the author's experience in industry, where a dictionary structure was often needed, but the natural C# hash table-implemented dictionary was taking up too much space in memory. The goal of this paper is to determine what data structure gives the best performance, in terms of both memory and processing time. AVL and Red-Black Trees were chosen because Pfaff [?] has shown that they are the ideal balanced trees to use. Pfaff did not compare hash tables, however. Also considered for this project were Splay Trees [?]. 2 Background 2.1 The Dictionary Problem A dictionary is a mapping between two sets of items, K, and V . It must support the following operations: 1. Insert an item v for a given key k. If key k already exists in the dictionary, its item is updated to be v.
    [Show full text]
  • LMAX Disruptor
    Disruptor: High performance alternative to bounded queues for exchanging data between concurrent threads Martin Thompson Dave Farley Michael Barker Patricia Gee Andrew Stewart May-2011 http://code.google.com/p/disruptor/ 1 Abstract LMAX was established to create a very high performance financial exchange. As part of our work to accomplish this goal we have evaluated several approaches to the design of such a system, but as we began to measure these we ran into some fundamental limits with conventional approaches. Many applications depend on queues to exchange data between processing stages. Our performance testing showed that the latency costs, when using queues in this way, were in the same order of magnitude as the cost of IO operations to disk (RAID or SSD based disk system) – dramatically slow. If there are multiple queues in an end-to-end operation, this will add hundreds of microseconds to the overall latency. There is clearly room for optimisation. Further investigation and a focus on the computer science made us realise that the conflation of concerns inherent in conventional approaches, (e.g. queues and processing nodes) leads to contention in multi-threaded implementations, suggesting that there may be a better approach. Thinking about how modern CPUs work, something we like to call “mechanical sympathy”, using good design practices with a strong focus on teasing apart the concerns, we came up with a data structure and a pattern of use that we have called the Disruptor. Testing has shown that the mean latency using the Disruptor for a three-stage pipeline is 3 orders of magnitude lower than an equivalent queue-based approach.
    [Show full text]
  • High Performance & Low Latency Complex Event Processor
    International Journal of Science and Research (IJSR) ISSN (Online): 2319-7064 Impact Factor (2012): 3.358 Lightning CEP - High Performance & Low Latency Complex Event Processor Vikas Kale1, Kishor Shedge2 1, 2Sir Visvesvaraya Institute of Technology, Chincholi, Nashik, 422101, India Abstract: Number of users and devices connected to internet is growing exponentially. Each of these device and user generate lot of data which organizations want to analyze and use. Hadoop like batch processing are evolved to process such big data. Batch processing systems provide offline data processing capability. There are many businesses which requires real-time or near real-time processing of data for faster decision making. Hadoop and batch processing system are not suitable for this. Stream processing systems are designed to support class of applications which requires fast and timely analysis of high volume data streams. Complex event processing, or CEP, is event/stream processing that combines data from multiple sources to infer events or patterns that suggest more complicated circumstances. In this paper I propose “Lightning - High Performance & Low Latency Complex Event Processor” engine. Lightning is based on open source stream processor WSO2 Siddhi. Lightning retains most of API and Query Processing of WSO2 Siddhi. WSO2 Siddhi core is modified using low latency technique such as Ring Buffer, off heap data store and other techniques. Keywords: CEP, Complex Event Processing, Stream Processing. 1. Introduction of stream applications include automated stock trading, real- time video processing, vital-signs monitoring and geo-spatial Number of users and devices connected to internet is trajectory modification. Results produced by such growing exponentially.
    [Show full text]
  • AVL Tree, Bayer Tree, Heap Summary of the Previous Lecture
    DATA STRUCTURES AND ALGORITHMS Hierarchical data structures: AVL tree, Bayer tree, Heap Summary of the previous lecture • TREE is hierarchical (non linear) data structure • Binary trees • Definitions • Full tree, complete tree • Enumeration ( preorder, inorder, postorder ) • Binary search tree (BST) AVL tree The AVL tree (named for its inventors Adelson-Velskii and Landis published in their paper "An algorithm for the organization of information“ in 1962) should be viewed as a BST with the following additional property: - For every node, the heights of its left and right subtrees differ by at most 1. Difference of the subtrees height is named balanced factor. A node with balance factor 1, 0, or -1 is considered balanced. As long as the tree maintains this property, if the tree contains n nodes, then it has a depth of at most log2n. As a result, search for any node will cost log2n, and if the updates can be done in time proportional to the depth of the node inserted or deleted, then updates will also cost log2n, even in the worst case. AVL tree AVL tree Not AVL tree Realization of AVL tree element struct AVLnode { int data; AVLnode* left; AVLnode* right; int factor; // balance factor } Adding a new node Insert operation violates the AVL tree balance property. Prior to the insert operation, all nodes of the tree are balanced (i.e., the depths of the left and right subtrees for every node differ by at most one). After inserting the node with value 5, the nodes with values 7 and 24 are no longer balanced.
    [Show full text]
  • Need a Title Here
    Equilibrium Behaviour of Double-Sided Queueing System with Dependent Matching Time by Cheryl Yang A thesis submitted to the Faculty of Graduate and Postdoctoral Affairs in partial fulfillment of the requirements for the degree of Master of Science in Probability and Statistics Carleton University Ottawa, Ontario @ 2020 Cheryl Yang ii Abstract In this thesis, we consider the equilibrium behaviour of a double-ended queueing system with dependent matching time in the context of taxi-passenger systems at airport terminal pickup. We extend the standard taxi-passenger model by considering random matching time between taxis and passengers in an airport terminal pickup setting. For two types of matching time distribution, we examine this model through analysis of equilibrium behaviour and optimal strategies. We demonstrate in detail how to derive the equilibrium joining strategies for passen- gers arriving at the terminal and the existence of a socially optimal strategies for partially observable and fully observable cases. Numerical experiments are used to examine the behaviour of social welfare and compare cases. iii Acknowledgements I would like to give my deepest gratitude to my supervisor, Dr. Yiqiang Zhao, for his tremendous support throughout my graduate program. Dr. Zhao gave me the opportunity to explore and be exposed to various applications of queueing theory and offered invaluable guidance and advice in my thesis research. Without his help, this thesis would not be possible. I am grateful for his patience, the time he has spent advising me, and his moral support that guided me through my studies at Carleton University. I would also like to thank Zhen Wang of Nanjing University of Science and Tech- nology for his gracious help and patience.
    [Show full text]
  • Varon-T Documentation Release 2.0.1-Dev-5-G376477b
    Varon-T Documentation Release 2.0.1-dev-5-g376477b RedJack, LLC June 21, 2016 Contents 1 Contents 3 1.1 Introduction...............................................3 1.2 Disruptor queue management......................................3 1.3 Value objects...............................................5 1.4 Producers.................................................6 1.5 Consumers................................................7 1.6 Yield strategies..............................................9 1.7 Example: Summing integers.......................................9 2 Indices and tables 15 i ii Varon-T Documentation, Release 2.0.1-dev-5-g376477b This is the documentation for Varon-T 2.0.1-dev-5-g376477b, last updated June 21, 2016. Contents 1 Varon-T Documentation, Release 2.0.1-dev-5-g376477b 2 Contents CHAPTER 1 Contents 1.1 Introduction Message passing is currently a popular approach for implementing concurrent data processing applications. In this model, you decompose a large processing task into separate steps that execute concurrently and communicate solely by passing messages or data items between one another. This concurrency model is an intuitive way to structure a large processing task to exploit parallelism in a shared memory environment without incurring the complexity and overhead costs associated with multi-threaded applications. In order to use a message passing model, you need an efficient data structure for passing messages between the processing elements of your application. A common approach is to utilize queues for storing and retrieving messages. Varon-T is a C library that implements a disruptor queue (originally implemented in the Disruptor Java library), which is a particularly efficient FIFO queue implementation. Disruptor queues achieve their efficiency through a number of related techniques: • Objects are stored in a ring buffer, which uses a fixed amount of memory regardless of the number of data records processed.
    [Show full text]
  • AVL Insertion, Deletion Other Trees and Their Representations
    AVL Insertion, Deletion Other Trees and their representations Due now: ◦ OO Queens (One submission for both partners is sufficient) Due at the beginning of Day 18: ◦ WA8 ◦ Sliding Blocks Milestone 1 Thursday: Convocation schedule ◦ Section 01: 8:50-10:15 AM ◦ Section 02: 10:20-11:00 AM, 12:35-1:15 PM ◦ Convocation speaker Risk Analysis Pioneer John D. Graham The promise and perils of science and technology regulations 11:10 a.m. to 12:15 p.m. in Hatfield Hall. ◦ Part of Thursday's class time will be time for you to work with your partner on SlidingBlocks Due at the beginning of Day 19 : WA9 Due at the beginning of Day 21 : ◦ Sliding Blocks Final submission Non-attacking Queens Solution Insertions and Deletions in AVL trees Other Search Trees BSTWithRank WA8 Tree properties Height-balanced Trees SlidingBlocks CanAttack( ) toString( ) findNext( ) public boolean canAttack(int row, int col) { int columnDifference = col - column ; return currentRow == row || // same row currentRow == row + columnDifference || // same "down" diagonal currentRow == row - columnDifference || // same "up" diagonal neighbor .canAttack(row, col); // If I can't attack it, maybe // one of my neighbors can. } @Override public String toString() { return neighbor .toString() + " " + currentRow ; } public boolean findNext() { if (currentRow == MAXROWS ) { // no place to go until neighbors move. if (! neighbor .findNext()) return false ; // Neighbor can't move, so I can't either. currentRow = 0; // about to be bumped up to 1. } currentRow ++; return testOrAdvance(); // See if this new position works. } You did not have to write this one: // If this is a legal row for me, say so. // If not, try the next row.
    [Show full text]
  • Ch04 Balanced Search Trees
    Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Ch04 Balanced Search Trees 6 v 3 8 z 4 1 1 Why care about advanced implementations? Same entries, different insertion sequence: Not good! Would like to keep tree balanced. 2 1 Balanced binary tree The disadvantage of a binary search tree is that its height can be as large as N-1 This means that the time needed to perform insertion and deletion and many other operations can be O(N) in the worst case We want a tree with small height A binary tree with N node has height at least (log N) Thus, our goal is to keep the height of a binary search tree O(log N) Such trees are called balanced binary search trees. Examples are AVL tree, and red-black tree. 3 Approaches to balancing trees Don't balance May end up with some nodes very deep Strict balance The tree must always be balanced perfectly Pretty good balance Only allow a little out of balance Adjust on access Self-adjusting 4 4 2 Balancing Search Trees Many algorithms exist for keeping search trees balanced Adelson-Velskii and Landis (AVL) trees (height-balanced trees) Red-black trees (black nodes balanced trees) Splay trees and other self-adjusting trees B-trees and other multiway search trees 5 5 Perfect Balance Want a complete tree after every operation Each level of the tree is full except possibly in the bottom right This is expensive For example, insert 2 and then rebuild as a complete tree 6 5 Insert 2 & 4 9 complete tree 2 8 1 5 8 1 4 6 9 6 6 3 AVL - Good but not Perfect Balance AVL trees are height-balanced binary search trees Balance factor of a node height(left subtree) - height(right subtree) An AVL tree has balance factor calculated at every node For every node, heights of left and right subtree can differ by no more than 1 Store current heights in each node 7 7 Height of an AVL Tree N(h) = minimum number of nodes in an AVL tree of height h.
    [Show full text]
  • On New Approaches of Assessing Network Vulnerability: Hardness and Approximation Thang N
    1 On New Approaches of Assessing Network Vulnerability: Hardness and Approximation Thang N. Dinh, Ying Xuan, My T. Thai, Member, IEEE, Panos M. Pardalos, Member, IEEE, Taieb Znati, Member, IEEE Abstract—Society relies heavily on its networked physical infrastructure and information systems. Accurately assessing the vulnerability of these systems against disruptive events is vital for planning and risk management. Existing approaches to vulnerability assessments of large-scale systems mainly focus on investigating inhomogeneous properties of the underlying graph elements. These measures and the associated heuristic solutions are limited in evaluating the vulnerability of large-scale network topologies. Furthermore, these approaches often fail to provide performance guarantees of the proposed solutions. In this paper, we propose a vulnerability measure, pairwise connectivity, and use it to formulate network vulnerability assessment as a graph-theoretical optimization problem, referred to as β-disruptor. The objective is to identify the minimum set of critical network elements, namely nodes and edges, whose removal results in a specific degradation of the network global pairwise connectivity. We prove the NP-Completeness and inapproximability of this problem, and propose an O(log n log log n) pseudo- approximation algorithm to computing the set of critical nodes and an O(log1:5 n) pseudo-approximation algorithm for computing the set of critical edges. The results of an extensive simulation-based experiment show the feasibility of our proposed vulnerability assessment framework and the efficiency of the proposed approximation algorithms in comparison with other approaches. Index Terms—Network vulnerability, Pairwise connectivity, Hardness, Approximation algorithm. F 1 INTRODUCTION ONNECTIVITY plays a vital role in network per- tal a network element is to the survivability of the net- formance and is fundamental to vulnerability C work when faced with disruptive events.
    [Show full text]