From: Martin Mares Date: Sat, 3 May 2008 18:28:50 +0000 (+0200) Subject: Corrections: The rest of Chapter 7. X-Git-Tag: printed~23 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=ff0a4590f542ae6559682741b5dbaeb09e6d4223;p=saga.git Corrections: The rest of Chapter 7. --- diff --git a/rank.tex b/rank.tex index aac7c97..91121ab 100644 --- a/rank.tex +++ b/rank.tex @@ -390,7 +390,7 @@ $$ As the sum converges to~$1/e$ when $n$~approaches infinity, we know that the number of derangements is asymptotically $n!/e$. -\obs\id{matchobs}% +\paran{Matchings and permanents}\id{matchper}% Placements of~$n$ rooks (and therefore also restricted permutations) can be also equated with perfect matchings in the restriction graph~$G$. The edges of the matching correspond to the squares occupied by the rooks, the condition @@ -405,21 +405,21 @@ non-zero summands are in one-to-one correspondence with the placements of~$n$ rooks on the corresponding board. The number $N_0$ is therefore equal to the permanent of the matrix~$M$. -We will summarize our observations in the following lemma: +We will summarize our observations by the following lemma: \lemma\id{permchar}% The following sets have the same cardinality: \itemize\ibull -\:permutations which obey a~given restriction graph~$G$, +\:permutations that obey a~given restriction graph~$G$, \:non-attacking placements of rooks on a~$n\times n$ board avoiding holes - which correspond to non-edges of~$G$, + that correspond to non-edges of~$G$, \:perfect matchings in the graph~$G$, \:non-zero summands in the permanent of the adjacency matrix of~$G$. \endlist \proof -See observations \ref{rooksobs} and~\ref{matchobs}. +Follows from \ref{rooksobs} and~\ref{matchper}. \qed \para @@ -437,13 +437,13 @@ It is sufficient to verify that there exists a~perfect matching in the given graph. By a~standard technique, this can be reduced in linear time to finding a~maximum flow in a~suitable unit-capacity network. This flow can be then found using the Dinic's algorithm in time $\O(\sqrt{n}\cdot m)$. -(See \cite{dinic:flow} for the flow algorithm, \cite{even:dinic} for the time bound -and \cite{schrijver} for more references on flows and matchings.) +(See Dinic \cite{dinic:flow} for the flow algorithm, Even and Tarjan \cite{even:dinic} for the time bound +and Schrijver \cite{schrijver} for more references on flows and matchings.) \qed \para The bad news is that computing the permanent is known to be~$\#P$-complete even -for zero-one matrices (as proven by Valiant in \cite{valiant:permanent}). +for zero-one matrices (as proven by Valiant \cite{valiant:permanent}). As a~ranking function for a~set of~matchings can be used to count all such matchings, we obtain the following theorem: @@ -474,7 +474,7 @@ graph. This way we construct the whole maximum permutation~$\pi$ in~$\O(n^2)$ calls to the verification algorithm. \qed -\para +\paran{Recursive structure}% However, the hardness of computing the permanent is the only obstacle. We will show that whenever we are given a~set of restrictions for which the counting problem is easy (and it is also easy for subgraphs obtained @@ -485,7 +485,7 @@ permutations in \ref{permrec}. \nota\id{restnota}% As we will work with permutations on different sets simultaneously, we have to extend our notation accordingly. For every finite set of elements $A\subset{\bb N}$, -we will consider the set ${\cal P}_A$ of all permutations on~$A$ as customary +we will consider the set ${\cal P}_A$ of all permutations on~$A$, as usually viewed as ordered $\vert A\vert$-tuples. The restriction graph will be represented by its adjacency matrix~$M\in \{0,1\}^{\vert A\vert\times \vert A\vert}$ and a~permutation $\pi\in{\cal P}_A$ satisfies~$M$ (conforms to the restrictions) @@ -514,7 +514,7 @@ $\(\pi,i,n,A,M)$: Compute the lexicographic rank of a~permutation $\pi[i\l \algo \:If $i\ge n$, return 0. \:$a\=R_A(\pi[i])$. -\:$b\=C_a=\sum_k N_0(M^{1,k})$ over all $k$ such that $1\le k\le a$ and $M[1,k]=1$. +\:$b\=C_a=\sum_k N_0(M^{1,k})$ over all $k$ such that $1\le k\le a$ and \hbox{$M[1,k]=1$.\kern-3pt} %%HACK \cmt{$C_a$ is the number of permutations in ${\cal P}_{A,M}$ whose first element lies among the first $a$ elements of~$A$.} \:Return $b + \(\pi,i+1,n,A\setminus\{\pi[i]\},M^{1,a+1})$. @@ -528,7 +528,7 @@ permutation in~${\cal P}_{A,M}$. \algo \:If $i>n$, return $(0,\ldots,0)$. -\:Find minimum $a$ such that $C_a > j$ (where $C_a$ is as above). +\:Find minimum $a$ such that $C_a > j$ (where $C_a$ is as in \ above). \:$x\=R^{-1}_A(a-1)$. \:$\pi\=\(j-C_{a-1}, i+1, n, A\setminus\{x\}, M^{1,a})$. \:$\pi[i]\=x$. @@ -540,8 +540,8 @@ permutation in~${\cal P}_{A,M}$. \para The time complexity of these algorithms will be dominated by the computation of the numbers $C_a$, which requires a~linear amount of calls to~$N_0$ on every -level of the recursion, and by the manipulation with matrices. Because of this, -we do not any special data structure for the set~$A$, an~ordinary sorted array +level of recursion, and by the manipulation with matrices. Because of this, +we do not need any sophisticated data structure for the set~$A$, an~ordinary sorted array will suffice. (Also, we cannot use the vector representation blindly, because we have no guarantee that the word size is large enough.) @@ -569,8 +569,8 @@ and $\O(n^2\cdot t(n))$ by the computations of the~$N_0$'s. \rem In cases where the efficient evaluation of the permanent is out of our reach, we can consider using the fully-polynomial randomized approximation scheme -for the permanent described by Jerrum, Sinclair and Vigoda in \cite{jerrum:permanent}. -We then get an~approximation scheme for the ranks. +for the permanent described by Jerrum, Sinclair and Vigoda \cite{jerrum:permanent}. +Then we get an~approximation scheme for the ranks. \rem There are also deterministic algorithms for computing the number of perfect matchings @@ -591,8 +591,8 @@ The time bound for ranking of general restricted permutations shown in the previ section is obviously very coarse. Its main purpose was to demonstrate that many special cases of the ranking problem can be indeed computed in polynomial time. For most families of restriction matrices, we can do much better. One of the possible improvements -is to replace the matrix~$M$ by the corresponding restriction graph and instead of -copying the matrix at every level of recursion, we perform local operations on the graph +is replacing the matrix~$M$ by the corresponding restriction graph and instead of +copying the matrix at every level of recursion, we can perform local operations on the graph and undo them later. Another useful trick is to calculate the $N_0$'s of the smaller matrices using information already computed for the larger matrices. @@ -602,7 +602,7 @@ instead. We will show that for the derangements one can achieve linear time comp \nota\id{hatrank}% As we already know, the hatcheck permutations correspond to restriction -matrices that contain zeroes only on the main diagonal and graphs that are +matrices that contain zeroes only on the main diagonal, and to graphs that are complete bipartite with the matching $\{(i,i) \mid i\in[n]\}$ deleted. For a~given order~$n$, we will call this matrix~$D_n$ and the graph~$G_n$ and we will show that the submatrices of~$D_n$ share several nice properties: @@ -646,7 +646,7 @@ n_0(z,d) &= z\cdot n_0(z-1,d-1) + (d-z)\cdot n_0(z,d-1) \quad\hbox{for $z