Combinatorial Algorithms Reference Text Kreher and Stinson Combinatorial
Combinatorial Algorithms Reference Text: Kreher and Stinson
Combinatorial Algorithms can be generally classified into three types: 1) Generation: Contruct all the combinatorial structures of a given type. Examples of these structures are subsets, permutations, partitions, and trees. 2) Enumeration: Count the number of different structures of a given type. By different we usually mean non-isomorphic. (We can't turn one structure into another by applying a permutation. ) All generation algorithms are also enumeration algorithms, since the objects can be counted as they are created. Enumeration is often easier than generation. Example we know the number of k-subsets of n is n!/(n-k)!k! while actually listing them is harder. 3) Search: Find at least one example of a structure of a given type. Optimization is a type of search.
Combinatorial Structures Sets and Lists (Finite Sets) One of basic building blocks Set: Unordered collection of distinct objects List: ordered collection of objects (not necessarily distinct) Cardinality: |A| = number of elements in set A k-set: set of cardinality k Permutation: an ordering of a set; a list of the elements of the set, such that every element occurs exactly once.
1. Graphs G = (V, E), where V is a finite set of vertices and E is a finite set of edges. Each edge is a 2 -element subset of vertices. Incidence (edge with a vertex): edge e = (v 1, v 2) is incident with vertices v 1 and v 2. Degree of a vertex v: deg(v) = number of edges incident with v. Types of graphs Complete graph: E contains all 2 -element subsets of V. Kn = complete graph on n vertices. Regular graph of degree d: all vertices have degree d. Weighted graph: all edges have an associated weight.
Representation of Graphs Adjacency Matrix is a |V|x|V| matrix where A[i][j] = 1 iff there exists an edge between vi and vj. If the graph is weighted then A[i][j] = weight of that edge. Adjacency List A is a list of |V| items corresponding to the vertices in the graph. Each item A[x] is itself a list, consisting of the vertices incident with vertex x. Often used with sparsely connected graphs to save memory. Incidence matrix is a |V|x|E| matrix where A[i][j] = 1 iff vertex i is incident with edge j. Each column has two 1’s (indicating vertices incident with each edge. Each row i has deg(i) 1’s.
Adjacency Matrix Example (Courtesy of S. Houghten) 5 6 7 3 1 4 2 1 2 3 4 5 6 7 1 0 1 1 0 0 1 0 2 1 0 1 1 3 1 1 0 1 1 4 0 1 1 0 0 0 1 5 0 0 1 1 6 1 1 1 0 1 7 0 1 1 1 0
Adjacency List Example (Courtesy of S. Houghten) 5 6 7 3 1 4 2 [{2, 3, 6}, {3, 4, 6, 7}, {4, 5, 6, 7}, {6, 7}, {7}] v 1 v 2 v 3 v 4 v 5 v 6 In this case, vertices are listed in increasing order to prevent listing the same edge from both ends. For example 1 -2 is listed by 2 -1 is not.
Incidence Matrix Example (Courtesy of S. Houghten) Edges are listed in increasing order. If 12 is listed then 21 is not. 5 6 7 3 1 12 13 16 1 1 2 1 3 1 23 24 26 27 1 1 1 4 1 7 34 35 36 37 1 1 1 5 6 4 2 47 1 1 1 57 1 1 67 1 1 1 56 1 1 1
Set Systems (X, B), where X is a finite set of points and B is a finite set of blocks, such that each block is a subset of X. A graph is just a set system where every block has a cardinality of 2.
Binary Error Correcting Codes A set of M binary vectors (codewords) of length n with minimum distance d. 2 codewords are at distance d (from each other) if they differ in exactly d positions. Weight is the number of 1 -bits in a codeword. Minimum distance is the smallest distance between any pair of codewords. (For linear codes, minimum distance = minimum weight). A code is linear if for any codewords u and v, u+v is also a codeword (“addition” is done mod 2, bitwise). In this case, the code is usually denoted as (n, k, d) where k is the dimension of the code.
The dimension of a code is the number of linearly independent vectors that are used to create the code. The entire set of M=2 k vectors can be generated by taking all possible linear combinations of these vectors. Representation: A general code is represented by a list of its codewords. Linear codes can be more compactly represented by a generator matrix (k x n) The list of all codewords is generated by taking all possible linear combinations of vectors in the generator matrix. Example (7, 4, 3) Hamming code.
(7, 4, 3) Hamming Code 0000000 0 1101000 0110100 0011010 0001101 1000110 0100011 1010001 Row 2 Row 3 Row 4 Rows 1+2+3 Rows 2+3+4 Rows 1+2+4 0010111 1001011 1100101 1110010 0111001 1011100 0101110 Rows 3+4 Rows 1+2+3+4 Rows 1+3 Rows 2+4 Rows 1+2 Rows 2+3 1111111 Rows 1+3+4 1 1 0 1 0 0 0 0 1 1 0 1
The above code can correct up to 1 error in a string of 7 bits. How it works: All data must be stored as codewords (so we can’t have just any one of the 27 possible strings of 7 bits; it must be one of the 16 chosen codewords). When we read our received word, if it's the same as one of the codewords, then there probably has not been a transmission error. Otherwise, there has been an error, so we pick the closest one (guessing that was what it was meant to be). E. g. read 1111000 guess 1101000 since it’s the only one that differs in just 1 place. Here, we are assuming that one transmission error is more likely than 2 or more.
Combinatorial Generation Algorithms
Used to generate combinatorial objects. We will look at: Lexicographic ordering (for all subset and ksusbsets) on board. Ranking and unranking (on board). Minimum change ordering (Gray Codes)
- Slides: 15