Among the models of quantum computation, the One-way Quantum Computer [10, 11] is one of the most promising proposals of physical realization [12] , and opens new perspectives for parallelization by taking advantage of quantum entanglement [2] . Since a one-way quantum computation is based on quantum measurement, which is a fundamentally nondeterministic evolution, a sufficient condition of global determinism has been introduced in [4] as the existence of a causal flow in a graph that underlies the computation. A O(n 3 )-algorithm has been introduced [6] for finding such a causal flow when the numbers of output and input vertices in the graph are equal, otherwise no polynomial time algorithm 1 was known for deciding whether a graph has a causal flow or not. Our main contribution is to introduce a O(n 2 )-algorithm for finding a causal flow, if any, whatever the numbers of input and output vertices are. This answers the open question stated by Danos and Kashefi [4] and by de Beaudrap [6] . Moreover, we prove that our algorithm produces an optimal flow (flow of minimal depth.) Whereas the existence of a causal flow is a sufficient condition for determinism, it is not a necessary condition. A weaker version of the causal flow, called gflow (generalized flow) has been introduced in [3] and has been proved to be a necessary and sufficient condition for a family of deterministic computations. Moreover the depth of the quantum computation is upper bounded by the depth of the gflow. However, the existence of a polynomial time algorithm that finds a gflow has been stated as an open question in [3] . In this paper we answer this positively with a polynomial time algorithm that outputs an optimal gflow of a given graph and thus finds an optimal correction strategy to the nondeterministic evolution due to measurements.
In REF a polynomial time algorithm which finds an optimal gflow of an input geometry with n vertices running with O(n 4 ) has been proposed.
Finding Optimal Flows Efficiently
Proc. of 35th ICALP (2008), 857-868
Mathematics Physics Computer Science