Full Text
UDC 518.5
MATHEMATICS
V. L. ARLAZAROV, E. A. DINITS, M. A. KRONROD, I. A. FARADZHEV
ON AN ECONOMICAL CONSTRUCTION OF THE TRANSITIVE CLOSURE OF A DIRECTED GRAPH
(Presented by Academician I. G. Petrovsky on 9 III 1970)
- For a directed graph \((H,\gamma)\), where \(H\) is the set of vertices and \(\gamma\) is a mapping of \(H\) into itself \((^1)\), algorithms are known for constructing the transitive closure \(\Gamma\) with an estimate of the number of operations, for a graph of general form, \(O(n^3)\) \((^{2-4})\), where \(n=|H|\). In \((^4)\) the problem of constructing the transitive closure of a graph of general form is reduced to a sequence of three problems: constructing the Hertz graph \((^5)\) of the given graph, the transitive closure of the Hertz graph (acyclic), and constructing the transitive closure of the given graph from the transitive closure of its Hertz graph; moreover, it is shown that the first and third of these can be solved in \(O(n^2)\) operations.
In the present note an algorithm is constructed for the transitive closure of an acyclic graph in \(O(n^3/\ln n)\) operations.
- For an acyclic graph \((H,\gamma)\), consider the partition of \(H\) into ranks \(K_i\):
\[ K_0=\{h\in H:\gamma^{-1}h=\phi\},\qquad K_i=\{h\in H\setminus S_{i-1}:\gamma^{-1}h\subset S_{i-1}\}, \]
where \(S_i=\bigcup_{j\le i} K_j\).
In \((^4)\) an algorithm for such a partition in \(O(n^2)\) operations is given. Denote by \(\gamma_i\) and \(\Gamma_i\) the mappings of \(S_{i-1}\) into \(K_i\) generated by \(\gamma\) and \(\Gamma\), respectively, and let \(G_i=\bigcup \Gamma_j\) be the mapping of \(S_{i-1}\) into \(S_i\). Then, obviously:
\[ G_0=\phi,\qquad \Gamma_i=\gamma_i G_{i-1}\cup\gamma_i . \tag{1} \]
Thus the construction of the transitive closure has been reduced to a triangular process of obtaining products of mappings.
- Lemma (M. Kronrod). Let \(A,B,C\) be sets, \(|A|=p\), \(|B|=q\), \(|C|=r\), and let \(\alpha,\beta\) be multivalued mappings \(\alpha:A\to B\), \(\beta:B\to C\).
Then the mapping \(\beta\alpha:A\to C\) can be constructed in \(O((p+q)qr/\ln q)\) operations.
Proof. Partition \(B\) into \([q/\ln q]+1\) disjoint subsets \(B_i\) so that \(|B_i|\le \ln q\). Denote by \(\alpha_i:A\to B_i\), \(\beta_i:B_i\to C\) the mappings generated by \(\alpha\) and \(\beta\), respectively. Then, obviously:
\[ \beta\alpha=\bigcup_i \beta_i\alpha_i . \tag{2} \]
Consider the set \(M_i=\{m_{is}\}\) of all subsets of \(B_i\) and the set \(L_i=\{l_{is}\}\) isomorphic to it, where \(l_{is}=\bigcup_{b\in m_{is}}\beta_i b\). Numbering the elements of \(B_i\): \(b_{i0}, b_{i1}\), etc., we order the elements of \(M_i\) and \(L_i\) as follows:
\[ s=\sum_k 2^{j_k}\leftrightarrow m_{is}=\bigcup_k b_{ij_k}. \]
It is obvious that \(l_{i0}=\phi\), \(l_{i2^j}=\beta_i b_{ij}\), while any other \(l_{is}\) can be obtained by taking the union of two others with smaller numbers. For example: \(l_{is}=l_{ik}\cup l_{i,s-k}\), \(s\ne 2^j\), where \(k=\max\{2^j:2^j<s\}\). Since \(|L_i|\le q\), and \(|l_{is}|\le r\), \(L_i\) can be constructed in \(O(qr)\), and all \(L_i\) in \(O(q^2r/\ln q)\) operations.
Further, from the completeness of \(M_i\) it follows that, for \(a \in A\), \(\alpha_i a \in M_i\) and, consequently, \(\beta_i \alpha_i a \in L_i\). Thus, after all the \(L_i\) have been constructed, obtaining \(\beta \alpha\) by (2) requires \(O(pqr/\ln q)\) operations.
4. Theorem. For an acyclic directed graph \((H,\gamma)\) with \(|H|=n\), the transitive closure \(\Gamma\) can be constructed in \(O(n^3/\ln n)\) operations.
Proof. Apply the algorithm of the lemma to the construction of \(\gamma_i G_{i-1}\) in (1). Since \(\gamma_i\) acts from \(S_{i-1}\), with \(|S_{i-1}|<n\), into \(K_i\), with \(|K_i|=n_i\), while \(G_{i-1}\) acts from \(S_{i-2}\), with \(|S_{i-2}|<n\), into \(S_{i-1}\), the construction of \(\gamma_i G_{i-1}\) can be performed in \(O(n^2 n_i/\ln n)\) operations. Summing over the ranks, we obtain the desired estimate.
Institute for Problems of Information Transmission
Academy of Sciences of the USSR
Moscow
Institute of Control Problems
Moscow
Moscow State University
named after M. V. Lomonosov
Central Scientific Research Institute of Patent Information
Moscow
Received
20 II 1970
CITED LITERATURE
- C. Berge, Theory of Finite Graphs and Its Applications, IL, 1962.
- V. V. Martynyuk, Journal of Computational Mathematics and Mathematical Physics, 2, No. 6 (1963).
- E. B. Ershov, Economics and Mathematical Methods, 2, issue 2 (1966).
- I. A. Faradzhev, Journal of Computational Mathematics and Mathematical Physics, 10, No. 4 (1970).
- A. A. Zykov, Theory of Finite Graphs, Novosibirsk, 1969.