Algorithms. Abstract. We describe a simple construction of a family of permutations with a certain pseudo-random

Similar documents
Permutations with short monotone subsequences

ON THE EQUATION a x x (mod b) Jam Germain

NON-OVERLAPPING PERMUTATION PATTERNS. To Doron Zeilberger, for his Sixtieth Birthday

What is counting? (how many ways of doing things) how many possible ways to choose 4 people from 10?

Non-overlapping permutation patterns

Fermat s little theorem. RSA.

Restricted Permutations Related to Fibonacci Numbers and k-generalized Fibonacci Numbers

Fast Sorting and Pattern-Avoiding Permutations

Permutation Groups. Every permutation can be written as a product of disjoint cycles. This factorization is unique up to the order of the factors.

SOLUTIONS FOR PROBLEM SET 4

THE ERDŐS-KO-RADO THEOREM FOR INTERSECTING FAMILIES OF PERMUTATIONS

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

The Sign of a Permutation Matt Baker

Principle of Inclusion-Exclusion Notes

Random permutations avoiding some patterns

Combinatorics in the group of parity alternating permutations

Solutions for the Practice Questions

Applications of Fermat s Little Theorem and Congruences

Enumeration of Two Particular Sets of Minimal Permutations

THE REMOTENESS OF THE PERMUTATION CODE OF THE GROUP U 6n. Communicated by S. Alikhani

The Complexity of Sorting with Networks of Stacks and Queues

Pattern Avoidance in Unimodal and V-unimodal Permutations

Greedy Flipping of Pancakes and Burnt Pancakes

EXPLAINING THE SHAPE OF RSK

An improvement to the Gilbert-Varshamov bound for permutation codes

Superpatterns and Universal Point Sets

12. 6 jokes are minimal.

STRATEGY AND COMPLEXITY OF THE GAME OF SQUARES

SYMMETRIES OF FIBONACCI POINTS, MOD m

1.6 Congruence Modulo m

ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey

Axiom A-1: To every angle there corresponds a unique, real number, 0 < < 180.

PRIMES 2017 final paper. NEW RESULTS ON PATTERN-REPLACEMENT EQUIVALENCES: GENERALIZING A CLASSICAL THEOREM AND REVISING A RECENT CONJECTURE Michael Ma

Unique Sequences Containing No k-term Arithmetic Progressions

17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees.

Counting Permutations by Putting Balls into Boxes

Edge-disjoint tree representation of three tree degree sequences

A STUDY OF EULERIAN NUMBERS FOR PERMUTATIONS IN THE ALTERNATING GROUP

ON SOME PROPERTIES OF PERMUTATION TABLEAUX

Generating indecomposable permutations

ON SPLITTING UP PILES OF STONES

Section Summary. Permutations Combinations Combinatorial Proofs

Domination game and minimal edge cuts

Bounds for Cut-and-Paste Sorting of Permutations

MATHEMATICS ON THE CHESSBOARD

On uniquely k-determined permutations

Tilings with T and Skew Tetrominoes

Number Theory. Konkreetne Matemaatika

#A2 INTEGERS 18 (2018) ON PATTERN AVOIDING INDECOMPOSABLE PERMUTATIONS

Constructions of Coverings of the Integers: Exploring an Erdős Problem

Olympiad Combinatorics. Pranav A. Sriram

The Classification of Quadratic Rook Polynomials of a Generalized Three Dimensional Board

Optimal Results in Staged Self-Assembly of Wang Tiles

A Coloring Problem. Ira M. Gessel 1 Department of Mathematics Brandeis University Waltham, MA Revised May 4, 1989

Yale University Department of Computer Science

Symmetric Permutations Avoiding Two Patterns

A Combinatorial Proof of the Log-Concavity of the Numbers of Permutations with k Runs

Low-Latency Multi-Source Broadcast in Radio Networks

ON THE PERMUTATIONAL POWER OF TOKEN PASSING NETWORKS.

CCO Commun. Comb. Optim.

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m.

Lower Bounds for the Number of Bends in Three-Dimensional Orthogonal Graph Drawings

Pattern Avoidance in Poset Permutations

REU 2006 Discrete Math Lecture 3

PRIMES STEP Plays Games

Math 127: Equivalence Relations

A Simpler and Faster 1.5-Approximation Algorithm for Sorting by Transpositions

Broadcast Transmission to Prioritizing Receivers

Permutations of a Multiset Avoiding Permutations of Length 3

SPACE-EFFICIENT ROUTING TABLES FOR ALMOST ALL NETWORKS AND THE INCOMPRESSIBILITY METHOD

Modular Arithmetic. Kieran Cooney - February 18, 2016

Combinatorics and Intuitive Probability

LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI

Permutation Tableaux and the Dashed Permutation Pattern 32 1

Odd king tours on even chessboards

Lossy Compression of Permutations

SMT 2014 Advanced Topics Test Solutions February 15, 2014

Math236 Discrete Maths with Applications

The Pigeonhole Principle

Carmen s Core Concepts (Math 135)

December 12, W. O r,n r

Heuristic Search with Pre-Computed Databases

ON SOME PROPERTIES OF PERMUTATION TABLEAUX

Stupid Columnsort Tricks Dartmouth College Department of Computer Science, Technical Report TR

The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n ways to do the first task and n

Deterministic Symmetric Rendezvous with Tokens in a Synchronous Torus

MAT Modular arithmetic and number theory. Modular arithmetic

Reading 14 : Counting

arxiv: v2 [math.co] 7 Jul 2016

Tiling Problems. This document supersedes the earlier notes posted about the tiling problem. 1 An Undecidable Problem about Tilings of the Plane

Permutations and codes:

SOLUTIONS TO PROBLEM SET 5. Section 9.1

Permutation Tableaux and the Dashed Permutation Pattern 32 1

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory

8.2 Union, Intersection, and Complement of Events; Odds

THE SIGN OF A PERMUTATION

Finite homomorphism-homogeneous permutations via edge colourings of chains

Online Call Control in Cellular Networks Revisited

DVA325 Formal Languages, Automata and Models of Computation (FABER)

Team Round University of South Carolina Math Contest, 2018

Transcription:

Generating Pseudo-Random Permutations and Maimum Flow Algorithms Noga Alon IBM Almaden Research Center, 650 Harry Road, San Jose, CA 9510,USA and Sackler Faculty of Eact Sciences, Tel Aviv University, Tel Aviv, ISRAEL Abstract We describe a simple construction of a family of permutations with a certain pseudo-random property. Such a family can be used to derandomize a recent randomized maimum-flow algorithm of Cheriyan and Hagerup for all relatively dense networks. Hence this supplies a deterministic maimum-flow algorithm that works, on a network with n vertices and m edges, in time O(nm) for all m = Ω(n 5/3 log n) (and in time O(nmlogn) for all other values of n and m). This improves the running time of the best known deterministic maimum-flow algorithm, due to Goldberg and Tarjan, whose running time is O(nmlog(n /m)). Keywords: maimum-flow algorithms, design of algorithms, derandomization, pseudo-random permutations, longest common ascending subsequence. 0

1 The main results Two permutations π = π(1),..., π(n) and σ = σ(1),..., σ(n) of 1,..., n have a common ascending subsequence of length r if there are i 1 <... < i r and j 1 <... < j r such that π(i l ) = σ(j l ) for all l = 1,..., r. Let λ(π, σ) denote the maimum length of a common ascending subsequence of π and σ. (Equivalently, λ(π, σ) is the maimum length of an ascending subsequence of the sequence σ 1 π(1),..., σ 1 π(n) ). Theorem 1 For every two integers k and n, where k n 0., one can construct a sequence π 1,..., π k of k permutations of 1,..., n, such that for every permutation σ of 1,..., n the inequality λ(σ, π i ) = O(kn 0.8 ) holds. Such a sequence can be constructed (and written) in time O(kn), i.e., in time which is essentially that needed to write these permutations down. Theorem For every two integers k and n, where k n, one can construct a sequence π 1,..., π k of k permutations of 1,..., n, such that for every permutation σ of 1,..., n the inequality λ(σ, π i ) = O(kn /3 ) holds. Such a sequence can be constructed (and written) in time O(kn). We note that the estimate above is not far from being best-possible. In fact for every k and n and for every sequence π 1,..., π k of k permutations of 1,..., n, there is a permutation σ of 1,..., n such that λ(σ, π i ) = Ω(kn 1/ ). This follows from the simple fact that the epecetd length of the maimum ascending subsequence of a random permutation is Θ(n 1/ ), and hence the epected value of the left hand side of the last inequality, where the permutations π i are fied and σ is chosen randomly is Θ(kn 1/ ). We note also that if the permutations π i are chosen randomly then one can check that with high probability for every permutation σ λ(σ, π i ) = O(kn 1/ ). 1

Therfore, our eplicitly-constructed permutations have a certain pseudo-random property. As observed by Cheriyan and Hagerup, the permutations constructed above can be used to derandomize their randomized maimum-flow algorithm described in [3] for all relatively dense networks. Hence this supplies a deterministic maimum-flow algorithm that works, on a network with n vertices and m edges, in time O(nm) for all m Ω(n 5/3 log n) (and in time O(nmlogn) for all other values of n and m). This improves the running time of the best known deterministic maimum-flow algorithm, due to Goldberg and Tarjan [5], whose running time is O(nmlog(n /m)). It is worth noting that the problem of improving on the O(nmlogn) time bound of the maimumflow algorithm in [6] has motivated several recent interesting papers; see [4], [5], [1] and []. Yet, despite these efforts, before the derandomization given in the present note, for real-valued networks and also for networks with very large integer capacities the algorithm in [6] was still the fastest deterministic algorithm for m = O(n ɛ ), where ɛ > 0 is fied. The proofs. In order to prove the above two theorems we need several simple lemmas. Lemma 3 Let A 1,..., A s be s subsets of an n-element set X, and suppose that the cardinality of the intersection of each two distinct sets A i does not eceed t. Then s i=1 A i n + s(s 1)t. Proof Clearly n = X s i=1 A i 1 i<j s A i A j, implying the desired estimate. Corollary 4 Let π 1,..., π s be s permutations of 1,..., n, and suppose that λ(π i, π j ) t for all 1 i < j s. Then, for every permutation σ of 1,..., n s i=1 λ(π i, σ) n + s(s 1)t. Proof Put X = {1,..., n}. For each i, 1 i s, fi one maimum-length common ascending subsequence of π i and σ, and let A i be the subset of X consisting of the numbers in it. Clearly, A i = λ(π i, σ), and the cardinality of the intersection of any two distinct sets A i does not eceed t. The result now follows from Lemma 3.. Lemma 5 Let n+1 = p be a prime and let s n be an integer. Then one can construct a sequence π 1,..., π s of s permutations of 1,..., n, such that for all 1 i < j s, λ(π i, π j ) n 1/ s 1/.

Such a sequence can be constructed (and written) in time O(sn). Proof The permutations we construct will all be of the form π a with 1 a n, where π a is the permutation a, a,..., na, in which all numbers are reduced modulo p. The set A of numbers a for which we will take the permuatation π a will have the following property: a, b A, a b there are no c, d with 1 c, d n 1/ /s 1/ such that ac = bd(modulo p). (1) Such a set A of cardinality s can be easily constructed greedily. After we have already chosen k < s members we compute all the kn/s < n numbers bd/c (modulo p) where b is such a member and 1 c, d n 1/ /s 1/,and choose a to be different from all those. Now observe that if j and l are two distinct numbers in {1,..., n}, then if j appears after l in π a then the distance between them in π a is (j l)/a. Similarly, the distance between them in π b is (j l)/b. (All these operations are modulo p, of course). It is impossible that both these numbers are smaller than n 1/ /s 1/ for two distinct a, b in A, since in this case j l = ac = bd where 1 c, d n 1/ /s 1/, contradicting (1). Thus, in any common ascending sequence of π a and π b one of the distances between any two corresponding pairs of adjacent elements in the subsequence is at least n 1/ /s 1/ and hence the size of this sequence cannot eceed n n 1/ /s 1/ = n 1/ s 1/.. Proof of Theorem 1 If n + 1 is a prime then, by Lemma 5 (with s = n 0. ) and Corollary 4 there are k = n 0. permutations for which the assertion of the theorem holds. If k is bigger, we repeat this set of permutations as many times as needed. Finally, if n + 1 is not a prime we choose a prime larger than n + 1 and smaller than n + (such a prime always eists by Bertrand s postulate and can be found quickly), construct our permutations for that prime and then take their restrictions to 1,..., n. This completes the proof. Proof of Theorem Suppose, first, that n + 1 = p is a prime and that k = n. In this case we simply take all the permutations π a for a {1,..., n}. Let σ be an arbitrary permutation of 1,..., n. Define by = n i=1 λ(σ, π i ). We must show that = O(n 5/3 ). For each i, 1 i n let us fi a common ascending subsequence of π i and σ of maimum length λ(π i, σ). Denote this sequence by S i. For each pair of adjacent elements in S i define their distance to be the distance between them in π i plus the distance between them in σ. Obviously, the sum of all the distances 3

between all the adjacent pairs of all the sequences S i (including the cyclic distance between the last element of each S i and the first element of it) is precisely n. Therefore, there are at least / adjacent pairs whose distances are all at most 4n 4n. Note that we may assume that n, since otherwise < 4n and there is nothing to prove. The number of pairs in the permutation σ whose distance in σ is at most 4n 4n is eactly n = 4n3. Each such pair appears with all possible distances between its members in the various π i, and hence there are eactly 4n / permutations in which it appears with distance at most 4n /. Therefore, the number of pairs of adjacent elements of the n subsequences S i whose distances, as defined above, are at most 4n / is certainly at most 4n 3 4n = 16n5. But this number is at least / and hence / 16n5, implying 3 1/3 n 5/3. This completes the proof when k = n and n + 1 is a prime. The general case follows as in the proof of Theorem 1. 3 Discussion In order to derandomize the maimum-flow algorithm of [3] for sparser networks, a more complicated construction is needed. We say that a permutation σ = σ(1),..., σ(n) of 1,..., n and a permutation π = π(1),..., π(q) of a subset of cardinality q of {1,..., n} have a common ascending subsequence of length r if there are i 1 <... < i r and j 1 <... < j r such that π(i l ) = σ(j l ) for all l = 1,..., r. Let λ(σ, π) denote the maimum length of a common ascending subsequence of σ and π. (Equivalently, λ(σ, π) is the maimum length of an ascending subsequence of the sequence σ 1 π(1),..., σ 1 π(q) ). Given a family F = {A 1,..., A n } of n subsets of {1,..., n}, such that ni=1 A i = m, we wish to find a family {π 1,..., π n }, where π i is a permutation of the elements of A i, such that for every permutation σ of {1,..., n}, the sum n i=1 λ(σ, π i ) does not eceed O(m/ log n). In [3] it is shown, by a simple probabilistic argument, that if m n(log n) such a set of permutations π i always eists. Moreover, it follows from the analysis in [3] that if, for some n and m n(log n) 3, we can generate such a set of permutations in time O(nm) for any given family of subsets F whose sum of cardinalities is m, then we can obtain a deterministic maimum-flow algorithm that works in time O(nm) for every network with n vertices and m edges. Theorem 4

(with k = n) clearly suffices to give the desired permutations in case m Ω(n 5/3 log n). (We simply let π i be the restriction of the i-th permutation supplied by Theorem to A i.) This theorem, as well as the somewhat different Theorem 1 do not suffice for smaller values of m. In fact, it is unlikely that a similar method would work for m = o(n 3/ ), since there eist families of n subsets A i of an n element set, each having cardinality Ω(n 1/ ), such that no two of these subsets have an intersection of size or more. Since our method depends on the eistence of common pairs of elements in the various sets A i it seems that a new idea is needed for such cases. It is not impossible that some of the known pseudo-random properties of eplicitly constructed epander-graphs can be useful here. At the moment we do not see how to use these properties, and the problem of constructing permutations with the desired properties for the cases of small m, as well as the derandomization of the maimum-flow algorithm of [3] for sparser networks, remains open. References [1] R. K. Ahuja and J. B. Orlin, A Fast and Simple Algorithm for the Maimum Flow Problem, Operations Research, to appear. [] A. K. Ahuja, J. B. Orlin and R. E. Tarjan, Improved Time Bounds for the Maimum Flow Problem, SIAM J. Comput. 18 (1989), 939-954. [3] J. Cheriyan and T. Hagerup, A Randomized Maimum-Flow Algoithm, Proc. IEEE FOCS (1989), 118-13. [4] H. N. Gabow, Scaling Algorithms for Network Problems, J. Comput. Syst. Sci. 31 (1985), 148-168. [5] A. V. Goldberg and R. E. Tarjan, A New Approach to the Maimum-Flow Problem, J. of the ACM 35 (1988), 91-940. [6] D. D. Sleator and R. E. Tarjan, A Data Structure for Dynamic Trees, J. Comput. Syst. Sci. 6(1983), 36-391. 5