Dynamic Trees • The data structure should be able to: ◦ Insert/delete an edge ◦ Update the key value of a vertex ◦ Report the sum or the bitwise AND/OR/XOR of all vertices in the tree containing a given vertex 101 000 111 100 010 101 110 100 14 / 21
Dynamic Trees • The data structure should be able to: ◦ Insert/delete an edge ◦ Update the key value of a vertex ◦ Report the sum or the bitwise AND/OR/XOR of all vertices in the tree containing a given vertex 101 000 111 100 010 101 110 100 14 / 21
Dynamic Trees • The data structure should be able to: ◦ Insert/delete an edge ◦ Update the key value of a vertex ◦ Report the sum or the bitwise AND/OR/XOR of all vertices in the tree containing a given vertex 101 000 111 100 010 Change to 100 101 110 100 14 / 21
Dynamic Trees • The data structure should be able to: ◦ Insert/delete an edge ◦ Update the key value of a vertex ◦ Report the sum or the bitwise AND/OR/XOR of all vertices in the tree containing a given vertex 101 000 111 100 010 100 110 100 14 / 21
Dynamic Trees • The data structure should be able to: ◦ Insert/delete an edge ◦ Update the key value of a vertex ◦ Report the sum or the bitwise AND/OR/XOR of all vertices in the tree containing a given vertex 101 000 111 100 010 Bitwise AND: 100 110 100 14 / 21
Dynamic Trees • The data structure should be able to: ◦ Insert/delete an edge ◦ Update the key value of a vertex ◦ Report the sum or the bitwise AND/OR/XOR of all vertices in the tree containing a given vertex 101 000 111 100 010 Bitwise AND: 100 100 110 100 14 / 21
Dynamic Trees • The data structure should be able to: ◦ Insert/delete an edge ◦ Update the key value of a vertex ◦ Report the sum or the bitwise AND/OR/XOR of all vertices in the tree containing a given vertex 101 000 111 100 010 Bitwise AND: 100 100 110 100 • There is a dynamic tree data structure supporting each such operation in O (log n ) time 14 / 21
Fully-dynamic connectivity • Efficiently maintaining a spanning forest of a graph: 1 0 4 3 2 6 7 5 15 / 21
Fully-dynamic connectivity • Efficiently maintaining a spanning forest of a graph: 001 000 100 011 010 110 111 101 15 / 21
Fully-dynamic connectivity • Efficiently maintaining a spanning forest of a graph: 001 000 000001 001011 100 000010 011100 011 010 011111 100111 011110 010101 110111 101110 110 111 101 15 / 21
Fully-dynamic connectivity • Efficiently maintaining a spanning forest of a graph: 000001 001011 000010 011100 011111 100111 011110 010101 110111 101110 15 / 21
Fully-dynamic connectivity • Efficiently maintaining a spanning forest of a graph: 001010 000011 000001 001011 111011 000010 011100 010110 010111 011111 100111 011110 010101 110111 101110 000111 001111 111011 15 / 21
Fully-dynamic connectivity • Efficiently maintaining a spanning forest of a graph: 001010 000011 000001 001011 111011 000010 011100 010110 010111 011111 100111 011110 010101 110111 101001 001111 010101 15 / 21
Fully-dynamic connectivity • Efficiently maintaining a spanning forest of a graph: 001010 000011 000001 001011 111011 000010 011100 010110 010111 011111 100111 011110 010101 110111 101001 001111 010101 15 / 21
Fully-dynamic connectivity • The previous only works if there is at most one edge that can reconnect the tree. 16 / 21
Fully-dynamic connectivity • The previous only works if there is at most one edge that can reconnect the tree. • Handling multiple reconnecting edges with random sampling: 1 0 4 3 2 7 6 5 16 / 21
Fully-dynamic connectivity • The previous only works if there is at most one edge that can reconnect the tree. • Handling multiple reconnecting edges with random sampling: 1 0 4 3 2 7 6 5 16 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 6 8 1 2 1 4 3 5 1 4 2 17 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 3 6 8 1 2 1 4 3 5 1 4 2 17 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 3 6 8 1 2 1 4 3 5 1 4 2 17 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 3 6 8 1 2 1 4 3 7 5 1 4 2 17 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 3 6 8 1 2 1 4 3 7 5 1 4 2 17 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 3 6 8 1 1 4 3 7 5 1 4 2 17 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 3 6 8 1 1 4 3 7 5 1 4 2 17 / 21
Dynamic minimum spanning forest • Suppose that instead of maintaining a spanning forest, we want to maintain a minimum spanning forest: 3 6 8 1 1 4 3 7 5 1 4 2 • Does the XOR trick work here? 17 / 21
Types of randomized algorithms • For several graph problems, state-of-the-art algorithms are randomized 18 / 21
Types of randomized algorithms • For several graph problems, state-of-the-art algorithms are randomized • Some of these algorithms are Las Vegas , some are Monte Carlo . 18 / 21
Types of randomized algorithms • For several graph problems, state-of-the-art algorithms are randomized • Some of these algorithms are Las Vegas , some are Monte Carlo . • Las Vegas algorithm: produces the correct solution but time/space random 18 / 21
Types of randomized algorithms • For several graph problems, state-of-the-art algorithms are randomized • Some of these algorithms are Las Vegas , some are Monte Carlo . • Las Vegas algorithm: produces the correct solution but time/space random • Monte Carlo algorithm: may give incorrect solutions but time/space typically not random 18 / 21
Issues with randomized dynamic graph algorithms • A randomized dynamic graph algorithm either needs to: ◦ hide its random bits from the user or ◦ assume that the user is not adaptive 19 / 21
Issues with randomized algorithms • Concrete example: Randomized approximate shortest path algorithm supporting: 20 / 21
Issues with randomized algorithms • Concrete example: Randomized approximate shortest path algorithm supporting: ◦ Updates: insertion/deletion of a single edge 20 / 21
Recommend
More recommend