Addressing and hashing Question: For a network of computers it is desirable to be able to send a message from A to B without B knowing that a message is.

Slides:



Advertisements
Similar presentations
CSNB143 – Discrete Structure
Advertisements

Chapter Matrices Matrix Arithmetic
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
8.3 Representing Relations Connection Matrices Let R be a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. Definition: A n m  n connection.
Lecture 17 Path Algebra Matrix multiplication of adjacency matrices of directed graphs give important information about the graphs. Manipulating these.
From Topological Methods to Combinatorial Proofs of Kneser Graphs Daphne Der-Fen Liu 劉 德 芬 Department of Mathematics California State University, Los Angeles.
(0,1)-Matrices If the row-sums of a matrix A are r 1, …,r k, then we shall call the vector r:=(r 1,r 2, …,r k ) the row-sum of A, and similarly for the.
GOLOMB RULERS AND GRACEFUL GRAPHS
Representing Relations Using Matrices
Applied Discrete Mathematics Week 11: Graphs
Chapter 5 Orthogonality
Definition Hamiltonian graph: A graph with a spanning cycle (also called a Hamiltonian cycle). Hamiltonian graph Hamiltonian cycle.
Graph Theory in CS Route Search in Online Map Services
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Linear Equations in Linear Algebra
K-Coloring k-coloring: A k-coloring of a graph G is a labeling f: V(G)  S, where |S|=k. The labels are colors; the vertices of one color form a color.
K-Coloring k-coloring: A k-coloring of a graph G is a labeling f: V(G)  S, where |S|=k. The labels are colors; the vertices of one color form a color.
MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.
Applied Discrete Mathematics Week 10: Equivalence Relations
Scientific Computing Matrix Norms, Convergence, and Matrix Condition Numbers.
Chap. 2 Matrices 2.1 Operations with Matrices
CHAPTER FIVE Orthogonality Why orthogonal? Least square problem Accuracy of Numerical computation.
1 Network Optimization Chapter 3 Shortest Path Problems.
Lecture 5.2: Special Graphs and Matrix Representation CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Zeph Grunschlag.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Trees and Distance. 2.1 Basic properties Acyclic : a graph with no cycle Forest : acyclic graph Tree : connected acyclic graph Leaf : a vertex of degree.
7.1 and 7.2: Spanning Trees. A network is a graph that is connected –The network must be a sub-graph of the original graph (its edges must come from the.
Matrices CHAPTER 8.1 ~ 8.8. Ch _2 Contents  8.1 Matrix Algebra 8.1 Matrix Algebra  8.2 Systems of Linear Algebra Equations 8.2 Systems of Linear.
Chapter 4 – Matrix CSNB 143 Discrete Mathematical Structures.
Three different ways There are three different ways to show that ρ(A) is a simple eigenvalue of an irreducible nonnegative matrix A:
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Markov Chains and Random Walks. Def: A stochastic process X={X(t),t ∈ T} is a collection of random variables. If T is a countable set, say T={0,1,2, …
Chapter 1 Fundamental Concepts Introduction to Graph Theory Douglas B. West July 11, 2002.
Maximum Flow. p2. Maximum Flow A flow network G=(V, E) is a DIRECTED graph where each has a nonnegative capacity u.
Information and Coding Theory Cyclic codes Juris Viksna, 2015.
Word : Let F be a field then the expression of the form a 1, a 2, …, a n where a i  F  i is called a word of length n over the field F. We denote the.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Graph Theory and Applications
Perfect and Related Codes
Latin squares Def: A Latin square of order n is a quadruple (R, C, S; L) where R, C and S are sets of cardinality n and L is a mapping L: R × C → S such.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
Greatest Common Divisors & Least Common Multiples  Definition 4 Let a and b be integers, not both zero. The largest integer d such that d|a and d|b is.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
1 Covering Non-uniform Hypergraphs Endre Boros Yair Caro Zoltán Füredi Raphael Yuster.
1 Finding a decomposition of a graph T into isomorphic copies of a graph G is a classical problem in Combinatorics. The G-decomposition of T is balanced.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
12. Lecture WS 2012/13Bioinformatics III1 V12 Menger’s theorem Borrowing terminology from operations research consider certain primal-dual pairs of optimization.
Linear Programming Chap 2. The Geometry of LP  In the text, polyhedron is defined as P = { x  R n : Ax  b }. So some of our earlier results should.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
拉丁方陣 交大應數系 蔡奕正. Definition A Latin square of order n with entries from an n-set X is an n * n array L in which every cell contains an element of X such.
5.6 Prefix codes and optimal tree Definition 31: Codes with this property which the bit string for a letter never occurs as the first part of the bit string.
CS 285- Discrete Mathematics Lecture 11. Section 3.8 Matrices Introduction Matrix Arithmetic Transposes and Power of Matrices Zero – One Matrices Boolean.
Trees.
CHAPTER 7 Determinant s. Outline - Permutation - Definition of the Determinant - Properties of Determinants - Evaluation of Determinants by Elementary.
Proof technique (pigeonhole principle)
Combinatorial Spectral Theory of Nonnegative Matrices
Basis and Dimension Basis Dimension Vector Spaces and Linear Systems
3.5 Minimum Cuts in Undirected Graphs
Graph Operations And Representation
V11 Metabolic networks - Graph connectivity
Systems of distinct representations
V12 Menger’s theorem Borrowing terminology from operations research
V11 Metabolic networks - Graph connectivity
Existence of 3-factors in Star-free Graphs with High Connectivity
V11 Metabolic networks - Graph connectivity
Locality In Distributed Graph Algorithms
Presentation transcript:

Addressing and hashing Question: For a network of computers it is desirable to be able to send a message from A to B without B knowing that a message is on its way. Model the network as a graph G. We can assign an address for each vertex. The address is from {0,1} k. The distance of two vertices in the graph is equal to the Hamming distance of the addresses. This is equivalent to regarding G as an induced subgraph of the hypercube H k. This is impossible for K * * * 1 * 3 * * *

Introduce a new alphabet {0,1,*} k and form addresses by taking n-tuples from it. The distance between two addresses is defined to be the number of places where one has a 0 and the other a 1. For an addressing of a graph G, we require that the distance of any two vertices in G is equal to the distance of their addresses. Denote by N(G) the minimum value of n for which there exists an addressing of G with length n.

For a tree we can do without the stars. By induction, it is clear for a tree of two vertices, which is trivial addressing of length 1. Suppose we can address trees with k vertices. If x 0,..,x n are the vertices of the tree T and x 0 has degree 1, consider the addressing for T/{x 0 } and let a i be the address of x i. Suppose x 0 is connected to x 1. Then address x 0 as (1, a 1 ) and change the other addresses to (0, a i ) for i=1,..,k. Thus N(T)  |V(T)|-1. Address a tree

Address a complete graph K m Consider the identity matrix of size m-1. Replace the zeros above the diagonal with stars and add a new row of zeros. N(K m )  m-1. 1 * * * * * 0 1 * * * 1 * * 3 * * *

x * * x2 1 0 * 1 * x3 * x * * x From the first column we have (x 1 +x 2 )(x 4 +x 5 ). From the 2nd column we have (x 1 )(x 2 +x 3 +x 4 +x 5 ). From the 3rd column we have (x 1 +x 4 )(x 3 +x 5 ). From the 4th column we have (x 2 )(x 3 +x 5 ). From the 5th column we have (x 3 )(x 5 ). Sum them up and have:  d ij x i x j. What does this mean?

Thm 9.1. Let n+, respectively n-, be the number of positive, respectively negative, eigenvalues of the distance matrix (d ij ) of the graph G. Then N(G)  max {n+, n-}. Pf: From the previous example:(x 1 +x 2 )(x 4 +x 5 ) can be represented by xAx/2, where x=(x 1, x 2, x 3,x 4,x 5 ) and A is the following matrix of rank 2 and trace 0: Therefore it has one positive and one negative eigenvalue Since (d ij ) is the sum of the matrices corresponding to the quadratic forms, it can have at most n positive eigenvalues Thm 9.2. N(K m ) = m-1. Thm 9.3. If T is a tree on n vertices, then N(T)=n-1.

The conjecture that N(G)  |V(G)|-1 for all connected graphs G was proved by Peter Winkler in ($200) Pick a vertex x 0, then construct a spanning tree T by BFS, and number the vertices by DFS. Define P(i):={j: x j is on the path from x 0 to x i in T}. Define i  j :=max {P(i)  P(j)), i’:=max{P(i)\{i}}. x0x0 x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 x7x7 x8x8 x9x9

Define i ~ j  P(i)  P(j) or P(j)  P(i). Define c(i,j) := d T (x i,x j ) - d G (x i,x j ). Lemma 9.4. (i) c(i,j) =c(j,i)  0; (ii) if i ~ j, then c(i,j) =0. (iii) if not (i ~ j), then c(i, j’)  c(i,j)  c(i,j’)+2. Pf: (i) is trivial. (ii) d G (x i,x j )  |d G (x i,x 0 ) - d G (x j,x 0 )|= d T (x i,x j ). (Why?) (iii) By |d G (x i,x j ) - d G (x i,x j’ )|  1 and d T (x i,x j ) =1+ d T (x i,x j’ ). d T (x i,x j ) - d G (x i,x j ) =1+ d T (x i,x j’ ) - d G (x i,x j ).  x0x0 xjxj xixi

c(i,j) = d T (i,j) - d G (i,j) Example: C(0,1)=0, C(0,2)=0, C(0,3)=0, C(0,4)=0, C(0,5)=0 C(1,2)=0, C(1,3)=1, C(1,4)=1, C(1,5)=1 C(2,3)=1, C(2,4)=3, C(2,5)=3 C(3,4)=0, C(3,5)=0 C(4,5)= a 0 =(0,0,0,0,0) a 1 =(1,0,0,0,0) a 2 =(1,1,0,*,0) a 3 =(*,0,1,0,0) a 4 =(*,*,1,1,0) a 5 =(*,*,1,1,1) a 0 =(0,0,0,0,0) a 1 =(1,0,0,0,0) a 2 =(1,1,0,0,0) a 3 =(0,0,1,0,0) a 4 =(0,0,1,1,0) a 5 =(0,0,1,1,1)

Let n=V(G)-1. Let a i  {0,1,*} n be the address of x i. a i =(a i (1),..., a i (n)), where j>i i 0 j’ j<i

Thm 9.5. d(a i, a k )= d G (x i, x k ). Pf: Assume i < k. (1) Suppose i~k, i.e. i is in P(k): For j  P(i), a k (j) =1 and a i (j) = 1. Thus for j  P(k)\P(i), a k (j) =1 and a i (j)  1. For these j, c(i,j)=0, hence a i (j) =0. Then d G (x i, x k )=|P(k)\P(i)|. x0x0 xkxk xixi xjxj

Thm 9.5. d(a i,a k )= d G (x i,x k ). (2) Suppose not (i~k), i.e. i is not in P(k): Exactly one of {a i (j), a k (j)} equals 1 when j is in P(i)-P(k) or P(k)-P(i). Need to prove that there are exactly c(i,k) *’s in these coordinates. So this will yield d(a i, a k ) = |P(k)\P(i)| + |P(i)\P(k)| - c(i,k) = d T (x i,x k ) – c(i,k) = d G (x i,x k ). Consider c(i,k)  c(i,k’)  c(i,k’’) ...  c(i, i  k) =0 c(i,k)  c(i’,k)  c(i’’,k) ...  c(i  k, k) =0. We will obtain one * in a i for each even m with 0< m  c(i,k) and one * in a k for each odd m with 0< m  c(i,k). For each even m with 0 c(i,j’). Note m may not be in the list but j does exist! Each j is distinct, because c changes at most 2 with each step. The DFS ordering guarantees i < j for each j in P(k) - P(i). Thus a i (j) = * for j in P(k) - P(i) corresponding to some even m. x0x0 xkxk xixi

Similarly, for each odd m with 0 c(j’, k). Each j is distinct because c changes at most 2 with each step. The DFS ordering guarantees j < k for each j in P(i) - P(k). Thus a k (j) = * for j in P(i) - P(k) corresponding to some odd m. Thus we’ve counted the *’s in P(i)-P(k) and P(k)-P(i). The number of * is exactly the number of even integers plus the number of odd integers between 1 and c(i,k), which together equals c(i,k).  Thm 9.6. N(G)  |V(G)| - 1. x0x0 xkxk xixi

Def: An ABD(k,w), associative block design, is a set of b:= 2 w elements of {0,1,*} k with the following properties: if the elements are the rows of a b × k matrix C, then (i) each row of C has k-w stars; (ii) each column of C has b(k-w)/k stars; (iii) any two distinct rows have distance at least 1. Ex: ABD(4, 3) * * * * * * * * This implies each k-bit 0-1 vector has distance 0 to exactly one row of C. å0    represents 2 4 = vectors. So an ABD(k,w) uses 2 w k-bit 0-1-  vectors to indicate 2 k k-bit 0-1 vectors.

Thm 9.7. If an ABD(k,w) exists, then: (1) it has exactly bw/(2k) 0’s and bw/(2k) 1’s in each column; (2) for each k-bit x it has exactly C(w, u) rows which agrees with x in u positions; (3) the parameters satisfy w 2  2k(1-1/b); (4) for any row, the number of rows with stars in the same position is even. Pf: Let C be the ABD(k,w).

(i) each row of C has k-w stars; (ii) each column of C has b(k-w)/k stars; (iii) any two distinct rows have distance at least 1. (1) It has exactly bw/(2k) 0’s and bw/(2k) 1’s in each column. Pf: Each row in C represents 2 (k-w) k-bit 0-1 vectors. Consider the j-th column. There are 2 (k-1) k-bit 0-1 vectors with the j-th bit as 0. How many rows of C are needed to cover these 2 (k-1) 0-1 vectors? Each row in C with the j-th bit as zero can cover 2 (k-w) 0-1 vectors and each row in C with the j-th bit as * can cover 2 (k-w-1) vectors. Thus (# of 0 in the j-th col) 2 (k-w) + (# of * in the j-th col) 2 (k- w-1) = 2 (k-1). (# of 0 in the j-th col) = 2 (w-1) - b(k-w)/2k = b/2 - b(k-w)/2k = bw/2k. Similarly, for 1.

(i) each row of C has k-w stars; (ii) each column of C has b(k-w)/k stars; (iii) any two distinct rows have distance at least 1. (2) For each k-bit x, it has exactly C(w, u) rows which agrees with x in u positions. Pf: Let x be any k-bit 0-1 vector. Denote n i the number of rows of C which agree with x in i positions. There are C(k, l) k-bit vectors which agree with x in exactly l positions. Therefore C(k,l) =  i n i C(k-w, l-i).  l C(k,l)z l =  l  i n i C(k-w, l-i) z l =  i n i z i  l C(k-w, l-i) z l-i. I.e., (1+z) k = (1+z) k-w  n i z i. This proves n i =C(w, i).

(i) each row of C has k-w stars; (ii) each column of C has b(k-w)/k stars; (iii) any two distinct rows have distance at least 1. (3) The parameters satisfy w 2  2k(1-1/b). Pf: The sum of the distances between pairs of rows of C is k(bw/2k) 2 by (1). Why? Since any two rows have distance at least 1, this sum is at least C(b,2). Thus k(bw/2k) 2  C(b,2)= b(b-1)/2. (bw) 2  (4k) b(b-1)/2. w 2  2k (1-1/b).

(i) each row of C has k-w stars; (ii) each column of C has b(k-w)/k stars; (iii) any two distinct rows have distance at least 1. (4) For any row, the number of rows with stars in the same position is even. Pf: Consider a row of C. Count k-bit vectors which have 0’s in the positions where the row has *’s. e.g. For (***1100), there are 2 4 (000_ _ _ _) vectors with 0’s in the *-positions. In general, 2 w. Let R = (# of rows with the same *-pattern). Then these R rows indicate R 0-1 vectors with 0’s in the *- positions. Each row with a different star pattern represents an even number of such vectors whereas a row with the same *-pattern represents exactly one such vector. Why? Thus R + (even number) = 2 w, which implies R is even. **0001 **1010 **0101 ** ** 0**001 11**01

(i) each row of C has k-w stars; (ii) each column of C has b(k-w)/k stars; (iii) any two distinct rows have distance at least 1. Thm 9.8. Let C be an ABD(k,w) with w >3. (1) If two rows of C agree in all but one position, then C(w, 2)  k. (2) Otherwise w 2 > 2k. Proof of (1): Let c 1 and c 2 be two rows of C differing only in position 1. Then all the other rows of C must differ from c 1 in some other position. Thus, b - 2 ≤ (w-1) (bw/2k). kb – 2k ≤ (w-1)bw/2. k ≤ C(w, 2) (b/(b-2))= C(w, 2) (1+ 2/(b-2)),. k ≤ C(w, 2) because 2C(w,2)/(b-2) <1. 0 * * * * 0 _ _ _ _ _ 1 _ _ _ _ _ * _ _ _ _ _

Thm 9.8. Let C be an ABD(k,w) with w >3. (1) If two rows of C agree in all but one position, then C(w, 2)  k, i.e., w(w-1)  2k. (2) Otherwise w 2 > 2k. Proof of (2) : Let c 1 and c 2 be two rows of C with the same star–pattern differing in more than one position. Count the sum of the distances from c 1 to the other rows, which is w(bw/2k), by Thm 9.7.1, and at least (b-2) + 2 = b. Thus, w(bw/2k)  b, i.e., w 2  2k. Need to show the equality does NOT hold. If the equality holds, it implies c 1 and c 2 have distance 2 and the other rows have distance 1 to c 1 and c 2. And this holds for any pair of the same star-pattern. 0 * * 1 1 * 1 * * 0 1 * 0 _ _ _ _ _ 1 _ _ _ _ _ * _ _ _ _ _

Assume c 1 = (* * *....  ) and c 2 = (* * *....  ) to be such a pair. The other bw/(2k) – 1 rows ending in a ‘1’ would end with ’01’. Why? Similarly, there were bw/(2k) – 1 rows ending in ’10’. Thus, there exist two rows with distance at least 2. But with w(bw/2k) = b, we must have bw/(2k) – 1 = 1, which implies bw = 4k, i.e., bw=2w 2. 2 w =b=2w, which is impossible for w > 3. Therefore w 2 > 2k.

Cor. An ABD(8,4) does not exist. Pf: By Thm 9.8. Open problem: The smallest open case is the question whether an ABD(12, 6) exists? Thm 9.9. If an ABD(k i, w i ) exists for i=1, 2, then an ABD(k 1 k 2, w 1 w 2 ) exists. * Pf: Assume w 2 > 0. Partition the rows of ABD(k 2, w 2 ) into two 0 * 1 0 classes R 0 and R 1 of equal size. 0 0 * 1 In ABD(k 1, w 1 ) replace each star by a row of k 2 stars, each * by a row from R 0 and each 1 by a row from R 1 in all possible * ways. Then check it is an ABD as claimed. (Exercise!) 1 * * * Cor: An ABD(4 t, 3 t ) exists.

Thm Let w >0. Suppose an ABD(k, w) exists, k = s 2 h, s odd. Then an ABD(k, w+i  s) exists for i=0,..., (k-w)/s. Pf: It suffices to consider i=1. Let C be the ABD(k, w) and define a matrix A of the same size by requiring a ij =1 if C ij =  and a ij =0 otherwise. Then A has (k-w) 1’s in each rows and b(k-w)/k 1’s in each column. By Thm 7.3, there is a matrix A’ from A with (k-w-s) 1’s in each rows and b(k-w-s)/k 1’s in each column. Note that bs/k=2 w-h is integral. Thus the matrix A’’=A-A’ has s 1’s in each rows and bs/k=2 w-h 1’s in each column. In a row of C, replace  by – if the  occurs in a position where A’’ has a ‘1’. This produces an ABD(k, w+s). Use k-tuple of 0,1,*, – to represent all possible 0, 1, * by replacing each – by 0 or 1.

Thm If an ABD(k, w) exists and R ≥1 is a number such that Rk and Rw are integers, then an ABD(Rk, Rw) exists. Pf: It suffices to show that ABD(k+l, w+m) exists for (k+l)/(w+m)=k/w and gcd(l,m)=1. Let k = s 2 h, s odd. By (ii) of the ABD’s definition, s|w. From (k+l)/(w+m)=k/w, we have w(k+l)=(w+m)k, i.e., wl=mk. Since gcd(l,m)=1, we have l is a power of 2. Consider the l  l circulant matrix with a row of l-m stars and m minus signs as the first row. Since l|b, adjoin a column of b/l copies of this circulant to the matrix C of ABD(k,w). The larger matrix is an ABD(k+l, w+m). 2w2w k l l b/l...