Optimal Sequential Flows
Abstract
We provide a new algebraic technique to solve the sequential flow problem in polynomial space. The task is to maximise the flow through a graph where edge capacities can be changed over time by choosing a sequence of capacity labelings from a given finite set. Our method is based on a novel factorization theorem for finite semigroups that, applied to a suitable flow semigroup, allows to derive small witnesses. This generalises to multiple in/output vertices, as well as regular constraints.
Keywords and phrases:
Network Flow, Sequential Flow, Semigroup FactorizationCategory:
Track A: Algorithms, Complexity and GamesFunding:
Patrick Totzke: EPSRC, grant no.: EP/X042596/1.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Network flows ; Computing methodologies Symbolic and algebraic algorithms ; Computing methodologies Algebraic algorithms ; Theory of computation Algebraic language theoryEditors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele PuppisSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Determining the maximal flow through a network under capacity constraints is a classical optimisation problem [10]. The Sequential flow problem is a dynamic variant in which the labelling of edges by capacities is not static but can change over (discrete) time. We are given a finite set of which each element prescribes capacities for every edge in the directed graph111A capacity / flow value means unbounded, i.e., finite but arbitrarily large.. Every length- capacity word uniquely determines a pipeline, a graph of size together with edge capacities where at time , the edge has capacity . The Sequential flow problem asks to determine the supremum of flow values through any such pipeline.
Notice that there is no limit on the length of the capacity words and therefore, the optimal sequential flow can be unbounded even if there is no finite word witnessing this.
Example 1.
Consider the graph with vertices , with source and target , and capacity constraints as depicted on the left in Figure 1. In both capacities and , there is no path from the source to the target . It is therefore necessary to combine them sequentially in order to enable positive flow from to . This can be achieved using the capacity word , which has a maximal flow value .
Even more flow can be transported from to through longer pipelines. For every the pipeline for capacity word has a flow of (maximal) value , as depicted in Figure 2. The sequential flow for is therefore unbounded.
Background.
Early works on dynamic flows consider flows in directed networks where edges have fixed capacities as well as transit times, and where associated costs are minimised [9, 2].
Closest to our setting, Akrida et al. [1] compute maximal flows through temporal networks [15, 16], where the edge capacities are a function of (discrete and bounded) time, i.e., a fixed capacity word. They devise a polynomial-time algorithm to compute the maximal temporal flow under such constraints, and prove a temporal version of the max-flow min-cut theorem.
In contrast to these works, in the Sequential flow problem neither the time horizon nor the capacities at given times are fixed. Instead, akin to planning or scheduling problems, one can choose the capacity word to maximise the flow through the network. Sequential flows were introduced in [5, Section 3] in the context of distributed computing. They have applications for controlling populations of Markov Decision Processes [6, 11] and Logics: it can be observed that the commutative lossy tiling problem defined and shown decidable in [3] is inter-reducible with the Sequential flow problem. Colcombet et al. showed that it is -hard [6, Section 7], and decidable in exponential space [6, Theorem 5.1] whether the optimal sequential flow is unbounded222This is called the “simple sequential flow problem” in [6].. The upper bound was achieved by an exponential reduction to the unboundedness problem of distance automata, for which a PSPACE upper bound is known [17].
Contributions.
We provide a new, simple and optimal solution for the Sequential flow problem. We show how to compute the precise maximal sequential flow values in polynomial space (Theorem 22), thus matching the lower bound of [6] with an upper bound for a much more general problem. The approach in [6] is based on regular cost functions, a formalism used to express boundedness properties of functions from words to integers. They use a model of weighted automata adapted to this setting to prove their upper bound. There is however an exponential blow-up in the construction of this automata, leading to an exponential-space algorithm. We go through an algebraic approach instead, by exhibiting a suitable -monoid (another way to represent regular cost functions), whose elements are matrices of dimension the number of vertices. While a -monoid could be obtained from the automata in [6], the exponential blow-up would remain.
Our technique is adapted to further generalisations: We derive the same upper bounds for the Sequential flow problem where sequential flows must be witnessed by capacity words from a given regular language (Theorem 37). This directly generalises the classical Max flow problem as well as the setting in Akrida et al. [1]. We also show how to solve a generalisation called the Fair sequential flow problem, where the flow should be routed equally along a set of given edges (Theorem 35).
Our contributions are based on new algebraic contributions of independent interest: In particular, we provide a factorization technique for general finite semigroups, where we show the existence of small summaries (Theorem 26). We also show the existence of -summaries of polynomial height for elements of the flow semigroup, a particular stabilization monoid [4, Section 3.1] used to witness unbounded sequential flows. This allows to obtain optimal upper bounds on the value of a finite solution to the Sequential flow problem (Theorem 16).
Missing proofs can be found in the long version of this paper.
2 Sequential Flows
We first recall the definition of flows and their optimisation problem.
Flows.
Fix a finite set of vertices and two distinct vertices and referred to as source and target, respectively. A flow is a mapping of edges to non-negative reals which satisfies capacity– and flow conservation constraints as follows.
A capacity constraint assigns to each edge a capacity, respecting that all incoming edges to the source and from the target have capacity .
| (1) |
A flow satisfies the capacity constraint if
| (2) |
It satisfies the flow conservation constraints if
| (3) |
where and .
Intuitively, a flow determines rate of goods flowing along each of the edges, and the capacity of an edge is a predetermined bound on the admissible rate that can flow from to . A capacity of means that nothing at all can flow, and a capacity of means that an arbitrary finite amount can flow.
The value of a flow is , the cumulative flow out of the source vertex. The Max flow problem asks to compute the maximal value of any flow.
Due to the presence of edges with unbounded capacities and because every flow must have a finite value, there may not exist flows of maximal value.
Sequential flows.
The Sequential flow problem is a dynamic variant of this setting in which the maximiser gets to pick a fresh capacity constraint at any unit time. A sequential flow still represents the rate of goods flowing along the edges, but both capacity constraints and flow conservation dynamically reflect maximiser’s momentary choice of capacities.
Assume a finite set of capacity constraints. A sequence is a sequential flow if for all , both
| (2′) | ||||
| (3′) |
A sequential flow dictates at least one capacity word that witnesses satisfying the sequential capacity conditions (2′). We will refer to as a sequential flow over capacity word . The value of is
the input flow to the target at the latest time and the output of the source at time . We want to optimise the supremum value of any sequential flow.
Sequential flow problem
Given a finite set of capacity constraints.
Determine the optimal sequential flow .
Note that the Sequential flow problem is not a linear program because is not bounded, and hence the number of constraints (2′) and (3′) is not bounded a priori.
There is a natural connection between the Sequential flow problem and the Max flow problem. Every capacity word defines an instance of Max flow problem in the corresponding pipeline, with source and target . This instance has a maximal flow, and is the supremum of those maximal flows over all capacity words . However, there is no simple algorithmic reduction between these two optimisation problems. Indeed, for an instance of the Sequential flow problem with capacities , the optimal sequential flow value can be the same, strictly larger, or strictly greater than the maximal flow value if is interpreted as an instance of the classical Max flow problem.
Example 2.
Let and capacities , and as depicted in Figure 3. If is considered as an instance of max flow then only unit of flow can be transported from source to target , using the edge at its maximal capacity. The values of maximal flows through capacity words are , respectively, and the max flow through any capacity word of the form remains . The optimal sequential flow given set of capacities is therefore .
Consider now only capacity . A flow with maximal value from the source to the target is . Similarly, the sequential flow for capacity word has value . However, every capacity word of length has maximal flow value . The optimal sequential flow given set of capacities is therefore .
Consider now only capacity . The maximal value of a flow from to is whereas the optimal sequential flow is only , because for any there is at most one path of length , and the minimal capacity along these paths is . The optimal sequential flow given set of capacities is therefore .
Finally, to demonstrate that combining different capacity letters may be required for the optimal sequential flow, consider the set of capacities . The optimal sequential flow value can be witnessed by a single capacity word and a family of sequential flows defined as with of value .
As established in both examples so far, there may not exist sequential flows of maximal value because there are in fact sequential flows of arbitrarily high values. In that case we call the optimal sequential flow unbounded and write . This can be witnessed in two ways: either by a single pipeline such as at the end of Example 2, or, as in Example 1, by a family of pipelines of growing length and maximal flow value. In Example 1, the optimal sequential flow value of cannot be witnessed by any finite pipeline and is instead witnessed by a family of words that iterate the capacity constraint arbitrarily, but finitely often. Our final example demonstrates that such witnesses may require more complex nested iterations.
Example 3.
Take sets and of vertices and capacity constraints as depicted below, where non-zero capacities of are shown in red, blue, and yellow.
The optimal sequential flow from source to target is , yet no finite capacity word witnesses this. To witness a sequential flow of value , a capacity word must be of the form . The combined capacities for the word is shown in Figure 4 (left). This allows a flow of from to (using ); then to transfer one unit to (using , which empties ). Iterating this prefix times allows a flow of units to , at which point all can flow in one step towards the target (via , see the right half of Figure 4).
3 Solving the Sequential flow problem
We present a solution to the Sequential flow problem in two stages. The first stage, described in Section 1, is qualitative: we determine whether the instance is unbounded, i.e., whether there exists sequential flows of arbitrarily high value. The key for that is to abstract the exact computation of values by means of a finite algebraic structure called the flow semigroup. The elements of this semigroup are enumerated using Algorithm 2 (presented later), which searches for a witness of unboundedness. The second stage is quantitative: it is performed by Algorithm 1, which computes the maximal value of sequential flows, assuming they are bounded, by a simple binary search. Both stages can be carried out in polynomial space. A key component for this upper bound in the second stage is the proof that when sequential flows are bounded the supremum is at most exponential in the number of vertices.
For the qualitative stage, we will abstract the exact values of capacity constraints and only consider whether those values are , finite or .
We make use of the maxmin semiring
There is a natural structure of semigroup on , using the usual matrix product over this semiring. For , and ,
Every capacity constraint is naturally abstracted as a matrix by losing precision: and are preserved while finite positive numbers are mapped to .
Example 4.
In Example 1 there are two capacity constraints and . Their abstractions, as well as the product thereof, are as follows:
Notice that and coincide with their abstractions since all finite coordinates are equal to or .
The matrix product allows to keep track of which paths have finite or -capacity. For every , the product can be computed easily: since is idempotent, i.e. , we have
This simple computation tells us that starting from the source (the first line), any sequential flow through the pipeline can carry only a finite flow to the target (the last column), because the top right coefficient is . However, this finite representation of the pipeline misses an important point: although the flow from to is finite for every , it is actually unbounded and grows with (cf. Figure 2).
In order to take this phenomenon into account, we introduce an extra operation on idempotent elements, i.e. the elements such that . This operation computes a new idempotent element . Intuitively, the element is an abstraction of the sequence of pipelines and should be thought of as “using many times”.
Before we proceed to define this operation, let us observe that the possible effect that iterating idempotents can have on the maximal flow between any two vertices.
Lemma 5 (Flow-carrying Edges of idempotent elements).
Let such that , and such that . For , let denote the optimal flow value from to in the pipeline . Exactly one of the following holds.
-
i)
for all . This holds iff and there exists such that
-
ii)
for all . This holds iff and there exists such that
-
iii)
for all . This holds iff and for all ,
The following definition of iterations of idempotents explicitly distinguishes the three cases of Lemma 5 to summarise an “ever growing” finite maxflow (case ii) as a new .
Definition 6 (Iteration of an idempotent).
Let be an idempotent element of . A pair such that is called unstable iff there exists such that , and , and stable otherwise.
Then the iteration of , denoted , is defined by
An idempotent is called unstable if it has an unstable pair, and stable otherwise.
Note that if an edge is unstable then it does not satisfy condition iii) of Lemma 5, thus it satisfies condition ii) of the same Lemma. Note also that is unstable if and only if . We also make the following observation.
Lemma 7.
The iteration of an idempotent is idempotent and stable, i.e., .
Our main algebraic tool is the flow semigroup, a finite structure obtained by application of the product and iteration to the abstract capacities until saturation. This flow semigroup is in fact an example of a stabilisation monoid (upon addition of a neutral element), which are ordered monoids with a stabilisation operator [4, Section 3.1].
Definition 8 (Flow semigroup).
The flow semigroup, denoted , is the smallest subset of which contains all abstracted capacity constraints and is closed under the matrix product and the iteration operation for idempotents.
Example 9.
Continue with Example 4. The flow semigroup contains and and since , it also contains . The only capacity- edge in is unstable since and . Therefore, contains the iteration
Intuitively, allows only one unit of flow from to , but arbitrarily much flow can remain both in and . If this is iterated then the sum of those single units of flows from to grows, which is represented by a new capacity on this edge in the capacity constraint .
Finally, contains the product
The top right coordinate in , which corresponds to the edge from the source to the target, is . This suggests that an arbitrary amount of flow can be transported from to . Such an element is called an unboundedness witness.
Definition 10 (Unboundedness witness).
An unboundedness witness is an element of such that
The existence of such elements in is a sufficient and necessary condition for the existence of sequential flows carrying an arbitrary large amount of flow from the source to the target.
Theorem 11 (Characterization of the unboundedness case).
An instance of the Sequential flow problem is unbounded if, and only if, there exists an unboundedness witness in the corresponding flow semigroup.
We will now present the structure of the proof of this theorem.
To begin with, we observe that since our finite capacities have integer values the integral flow theorem [9] guarantees that every sequence of capacity constraints has a flow with integer coefficients and maximum value. This allows us to work with token flows, in which an explicit set of named tokens is fixed, and the trajectory of every token is precisely described.
Definition 12 (Token flows).
Fix a finite set of tokens. A token flow of of length over a capacity word is a mapping which describes the position of every token at every date, and which satisfies capacity constraints. Formally, for every and
The outcome of a token flow is described by a global flow, which accounts for the number of tokens traveling along every pair of states.
Definition 13 (Global flows).
With every token flow of length is associated a global flow denoted , which measures the number of tokens moving between every pair of vertices between the dates and , formally defined as:
for all .
The proof of Theorem 11 is in two steps: Lemma 14 establishes that the condition is sufficient and Lemma 17 that is it is necessary.
Lemma 14 (Sufficient condition).
If there exists an unboundedness witness, the answer to the Sequential flow problem is .
The proof makes use of the notion of paths.
Definition 15 (Paths).
A path in a capacity word is a sequence of vertices that may be followed by a token, i.e., such that for all .
Proof sketch of Lemma 14.
The key idea is to establish that the following property of element in the flow semigroup is invariant by product and iteration, and satisfied by the abstract capacities. We prove the following property on elements of the flow semigroup :
-
()
For all , for all , there exist a capacity word and a token flow over such that for all , the following two conditions are satisfied:
-
1.
-
2.
there is a path in from to (in the sense of Definition 15).
-
1.
The proof is by induction on the flow semigroup. For abstract capacity constraints , the capacity word is simply and we have tokens following each edge with .
For a product the token flow for is obtained by considering two token flows and for tokens, renaming and deleting some of the tokens and concatenating the resulting sequential flows.
The last case is the iteration . We start by showing that we can decompose as a product of with so-called simple unstable idempotents, where all non-zero entries are self-loops, except for a single unstable pair. This simple structure is used to craft token flows carrying arbitrarily large amount of tokens along unstable pairs.
For the other direction, we show that when evaluating capacity words in the flow semigroup, the flows between pairs of vertices mapped to or are uniformly bounded.
Theorem 16.
Let be the largest finite constant appearing in a capacity constraint of . For every token flow , there exists an element such that, for every ,
This result relies on a subtle and careful analysis of the flow semigroup, performed in Section 4. The first step is a general result about finite semigroups, showing that every element of a semigroup has a finite representation as a binary tree whose height is polynomial in a parameter called the regular -length of the semigroup (Theorem 26). The second step is specific to the flow semigroup , and shows that for this parameter is polynomial in (Theorem 33). We then extend these trees to incorporate the operator, and prove that the resulting trees still have polynomial height. That leads to Theorem 16. By contraposition, a consequence of Theorem 16 is the following.
Lemma 17 (Necessary condition).
If the answer to the Sequential flow problem is then there is an unboundedness witness in .
Proof.
Since we have sequential flows of unbounded values between and , there exists a capacity word with a sequential flow of value greater than . By the integral flow theorem [9], we also have a token flow over such that . We apply Theorem 16 to . By case inspection, the only possible value of is , thus is an unboundedness witness.
In order to test unboundedness for the Sequential flow problem we can compute the entire flow semigroup , starting with the capacity abstractions and closing it by product and , and then check if it contains an unboundedness witness. The correctness of this algorithm follows directly from the definition of , as well as Lemma 14 and Lemma 17. The resulting algorithm runs in exponential time and space, essentially bounded by the size of . This can be improved to polynomial space: Instead of explicitly enumerating elements of the flow group we can enumerate so-called -expressions, which represent elements of .
Definition 18.
A -expression of an element is a finite -labeled ordered tree such that the root node is labeled by , and every node is of one of three possible types:
-
either a leaf node labeled by an abstract capacities ;
-
it has a single child labeled by , in which case is idempotent and is labeled by ,
-
it has two children labeled by and , in which case is labeled by .
The recursive nature of this definition dictates a recursive algorithm to determine if a given element has a -expression of at most a given height . By convention, the height of a single leaf node is .
Lemma 19.
Given capacities , element , and , Algorithm 2 returns true iff has a -expression of height at most .
Notice that Algorithm 2 still runs in (deterministic) exponential time due to the enumerations in lines 4 and 6. However, it only requires space polynomial in and due to the explicit bound on the recursion depth.
The central argument for showing that unboundedness can be tested in polynomial space is a polynomial bound on the number of nested applications of the operator necessary to produce an unboundedness witness, provided by the following theorem.
Theorem 20.
Every element of the flow semigroup is generated by a -expression of height at most .
We make use of proof techniques used for designing polynomial-space algorithms in other contexts, in particular for checking limitedness of desert automata [17] and the value problem of probabilistic automata [8, 7]. According to Theorem 20, every element of has a -expression of height at most . We can therefore check in polynomial space if a given element is in the flow semigroup and whether there exist unboundedness witnesses.
Theorem 21 (Checking unboundedness).
Checking whether the optimal sequential flow is unbounded is decidable in polynomial space.
Proof.
By Theorem 20, any positive instance admits an unboundedness witnessed that has -expressions of height at most . It therefore suffices to enumerate (in polynomial space, using Algorithm 2) all -expressions of such bounded height and for each check if the represented element constitutes an unboundedness witness, i.e., that .
If the maximal finite sequential flow value exists, then we can compute it in polynomial space thanks to the exponential bound established in Theorem 16. Indeed, if there is a flow of value above then there are flows of unbounded values. It therefore suffices to check whether there is a flow of value . If so then flows can have unbounded values, if not, then we find the optimal value between and by dichotomic search. Hence we only need to be able to check whether there is a flow of a given, at most exponential, value. This is done in polynomial space via classic graph exploration.
Theorem 22.
Given capacities , the optimal sequential flow can be computed in .
4 Diving into the flow semigroup
This section is dedicated to the proof of two bounds which are crucial to show that the Sequential flow problem can be solved in . The first one is Theorem 20, which gives a polynomial upper-bound on the maximal depth of a -expression generating elements of . The second one is Theorem 16, which establishes a polynomial upper bound on the optimal sequential flow, in case it is finite.
The central tool for these proofs are summaries and -summaries, which provide a bounded-size representation of words of arbitrary length.
4.1 A general factorization theorem for finite semigroups
We rely on a form of factorization of words in a finite semigroup, which we call summaries. Let be a finite semigroup333We choose to work with semigroups in this paper since they are slightly more general than monoids. Note that [13] formulates everything for finite monoids, but the existence of a neutral element is never used in the paper. Every statement from that paper holds for finite semigroups as well.. An element is called idempotent if . The set of idempotent elements of is denoted . We write for the monoid obtained by extending with a neutral element .
We define a morphism that evaluates sequences of elements of by applying the semigroup (product) operation: .
We recall the Green relations, introduced in [12], on , starting with the following partial orders:
-
if there exist such that
-
if there exist such that
-
if there exist such that
-
if and
These partial orders can be thought of as reachability relations on , and the corresponding equivalence classes as strongly connected components.
We use well-established notations for the relations , the equivalence relations induced by those partial orders. Formally, for each we define the relations and . Note that is coarser than and , themselves coarser than .
The regular -length 444Called regular -length in [13]. For finite semigroups, , and we use here since it is more common. Note that the paper introduces it with a different definition, but the two are proven equivalent in the extended version [14, Appendix B]. of a semigroup , denoted , is defined as
The Ramsey function of is the function where is the minimal number such that every word of length contains an infix of the form with for some . The existence of such a number for all can be inferred from Ramsey’s theorem, but the following theorem gives much more precise bounds.
A core element of the construction is the following result, which guarantees the existence of consecutive idempotent factors in sufficiently long words over . Note that the bound is only exponential in the regular -length of the semigroup, not its size.
Theorem 23 ([13, Theorem 1]).
For all ,
We can now define the central object of our proofs. The theorem gives a way to summarize a word with respect to a finite semigroup. A summary abstracts sequences of idempotent infixes by only keeping the first and last ones. We do so in a way that ensures that the remaining idempotent factors are “short”, so that the number of letters we keep from the initial word is polynomial in the size of the semigroup and .
Definition 24.
A summary of a word is a -labeled ordered binary tree with three types of nodes:
-
a leaf has no children and a label for some
-
a product node labeled has two children labeled and such that and .
-
an idempotent node labeled has two children labeled and such that we have , and .
The root is labeled by , for some , called the result of the summary.
Example 25.
Consider the flow semigroup for Example 1. Remember that and : capacities match their abstractions because finite constants are or . Let be the products and . Since , the following tree is a summary of , for any .
Independently of their length, all words have this summary of height and size . The existence of summaries of constant depth is true in general, as shown in Theorem 26.
This definition resembles the one of Simon’s factorization forests [18]. However, an important difference is that Simon’s trees are meant to factorize the entire word, while ours omit a lot of information by skipping intermediate idempotents. This lets us obtain better bounds on the height of the tree, since Simon’s trees have linear height in the size of the semigroup, not just its regular -length. Those bounds are essential to obtain singly-exponential bounds, and then a polynomial-space algorithm, in the quantitative setting.
Theorem 26.
For all there exists a summary whose result is and of height at most .
Proof sketch.
We first define the regular -length of an element of the semigroup, as the one of the subsemigroup of elements -below it. The proof goes through an induction on the regular -length of elements of the semigroup. We start by cutting the word in minimal blocks of maximal regular -length. We factorize these blocks as a single letter and a block of smaller regular -length, for which we get a factorization by induction. Then we consider the word obtained by replacing each block with its value in the semigroup.
We cut this word into infixes, each long enough to guarantee that it contains idempotents. We describe an operation that lets us merge some blocks where the same idempotent appears. We then use properties of the Green relations to bound the number of blocks obtained this way.
4.2 Application to the flow semigroup and iterations
This subsection is dedicated to the proof of two bounds which are crucial to show that the Sequential flow problem can be solved in polynomial space. The first one is Theorem 20, which gives a polynomial upper-bound on the maximal depth of a -expression generating elements of . The second one is Theorem 16, which establishes a polynomial upper bound on the optimal sequential flow, in case it is finite.
Let , and let be the finite semigroup of Boolean matrices of dimension , equipped with the matrix product. The following result bounds its regular -length by a polynomial in its dimension.
Theorem 27 ([13, Theorem 2]).
The regular -length of is at most .
Let us now take a look at the flow semigroup, with .
Lemma 28.
is isomorphic to a sub-semigroup of .
Proof.
Define such that for all matrix , with, for all ,
This is an injective function, and it is easily verified that this is a morphism.
Theorem 29.
Every word admits a summary of height at most .
Proof.
As observed above, is isomorphic to a subsemigroup of , which has regular -length bounded by . The regular -length of is then at most , while its size is . By Theorem 23, we obtain for . Then, by Theorem 26 we have that every word over has a summary of height at most
We now need to integrate the operator in this construction. We do this by following a proof of Simon [19, Theorem 9] on a different semigroup.
Lemma 30.
Let and idempotents of such that for all . Then there exists such that .
Observe that Example 3 can be generalized to obtain instances where we need a linear number of nested in order to obtain some elements of .
That result has two interesting consequences, which are the keys to obtain algorithms for the Sequential flow problem. The first consequence is that small “-expressions” (Definition 18) are enough to generate all elements in the flow semigroup, as stated in Theorem 20. The idea is as follows: take a -expression generating an element of . First use Lemma 30 to eliminate redundant idempotent nodes and reduce its -height below . Then reorganise its product nodes to obtain balanced subtrees of product nodes. Since the monoid has exponential size in , trees of polynomial height suffice to obtain everything we can with products.
The second consequence of Lemma 30 is that every capacity word can be represented as a small -summary: We define -summaries, where idempotent nodes for are labeled with instead of .
Definition 31.
A -summary of a word is a -labeled ordered binary tree, with three types of nodes:
-
A leaf is labeled by for some ,
-
A product node has two children. If their labels are and then its label is
-
An idempotent node has two children. If their labels are and then is an idempotent of and the label of the node is for some such that all have a -summary whose root is labeled . In the case that we say that the node is a stable idempotent node, and an unstable idempotent node otherwise.
Moreover, the root is labeled by for some , which is called the result of the -summary.
Example 32.
In Example 1, since , the following tree is a -summary of .
This -summary bears some similarity with the summary of Example 25. However, there is a crucial difference: the root of the -summary is labelled by , which is an unboundedness witness (see details before Definition 10). This is not the case in the summary of Example 25: the root is labelled by which is not an unboundedness witness since .
Independently of their length, all words have this -summary of height and size . The existence of -summaries of constant height (and size), whatever the size of the word, is true in general, as shown in Theorem 33.
Our next step is to show that all words have a -summary of polynomial height in the number of vertices . We take inspiration from two existing proofs: First, one by Kirsten [17] to show that the number of unstable nodes along a branch of a -summary (or a -expression) is bounded by a polynomial in , the number of vertices555A polynomial bound in can be obtained by proving that for all , and using the bound on the regular -length. We prefer to use Lemma 30, which gives .. Second, one by Simon [18] to show that every word has a -summary where the distance between consecutive unstable nodes along a branch is bounded by another polynomial in . Adapting and combining those two arguments yields the result.
Theorem 33.
For all there is a -summary of height at most .
We make use of Theorem 33 to prove Theorem 16. By the max flow-min cut theorem [10], to prove a bound on the maximal flow of capacity words it suffices to find for each one a cut of cost at most this bound. We construct this cut by induction on the height of a -summary for the capacity word. A key part of the argument is the trichotomy from Lemma 5, particularly case (ii). When dealing with an idempotent node we show that for all , either iterating the corresponding idempotent gives us unbounded flows from to , or, in any iteration of the idempotent, we can find a cut of bounded cost between and within the first and last iterations. This justifies the abstraction of -summaries: in a sequence of iterations of an idempotent we keep only the first and last. The value of the constructed cut is exponential in the height of the -summary, which yields the result by Theorem 33.
5 Extensions
Our approach to solve the Sequential flow problem can be extended to further generalisations that consider sequential flows between sets of source and target vertices and under regular constraints on the witnessing capacity words.
5.1 Fair flows along multiple edges / out of multiple sources
The previous results and algorithms can be adapted to solve a more general problem.
Instead of a single source-target pair , the problem comes with a collection of edges, and one wishes to carry as much flow as possible along those edges.
That is, the objective is not to maximize the total amount of flow through the edges (this can easily be reformulated as an instance of the Sequential flow problem, solutions to which then may lead to one of the edges being unused). Instead, we ask to maximize the minimal global flow among all given edges.
Using the notation from Definition 12 of token flow and its associated global flow , the Fair sequential flow problem asks to compute the value , where
This problem can be solved similarly to the Sequential flow problem, except one looks for a different kind of witnesses in the flow semigroup .
Definition 34.
A fair unboundedness witness is an element of such that
Theorem 35.
The Fair sequential flow problem can be solved in polynomial space.
Proof.
The unboundedness of the Fair sequential flow problem is equivalent to the existence of a fair unboundedness witness in the flow semigroup , the proof is a straightforward adaptation of the proofs of Lemma 14 and 17. Such a witness can be looked for in polynomial space using Algorithm 2. If no such witness exists then the value is finite and even bounded by according to Theorem 16. Then a variant of Algorithm 1 can be used in order to optimise by looking for a token flow moving exactly tokens along every edge in , where is optimized by dichotomic search in the interval .
Remark 36.
If, instead of simultaneous flow across a subset of edges, one is interested in checking simultaneous flows out of several sources into the target, the resulting problem easily reduces to the Fair sequential flow problem. Indeed, it suffices to introduce a new target vertex and a new final capacity constraint that transfers tokens from all target states to . Then the multi-source flow problem is an instance of the Fair sequential flow problem where we ask to maximise the simultaneous flow from each source to .
5.2 Regular constraints
The Fair sequential flow problem with regular constraints generalises the Fair sequential flow problem by requiring that we only consider capacity words within a given regular language. Formally, consider a finite set of capacities, a set and a regular language recognized by a non-deterministic automaton with states. Let and be the largest finite capacity in any element of . The problem is to compute the optimal fair token flow over capacity words in , i.e.,
Theorem 37.
The Fair sequential flow problem with regular constraints can be solved in polynomial space. Furthermore, if the answer is bounded then it is at most .
This can be shown with the technique discussed in Sections 3 and 5.1 with a slightly extended definition of the flow semigroup. We describe the necessary adjustments below.
Fix a non-deterministic finite automaton with the set of control states, sets of initial and final states, and the transitions over the alphabet . We define the semigroup made of the set of triples in , plus an element , and where the product is defined as follows:
We set and for all .
To lift the iteration operation, notice that, except for , an idempotent of is of the form with an idempotent matrix . Define for all and idempotent , and let .
The labeled flow semigroup is defined as the smallest sub-semigroup of which contains and is stable under and .
6 Conclusion
We provide a new algebraic technique to solve the Sequential flow problem in . We mention two promising directions to utilize the results shown here. First, we aim to adapt our techniques to graphs generated by graph grammars. Second, we plan to extend our framework to settings with asynchronous flows, with applications to asynchronous distributed computing.
References
- [1] Eleni C. Akrida, Jurek Czyzowicz, Leszek Gąsieniec, Łukasz Kuszner, and Paul G. Spirakis. Temporal flows in temporal networks. Journal of Computer and System Sciences, 103:46–60, 2019. doi:10.1016/j.jcss.2019.02.003.
- [2] Jay E. Aronson. A survey of dynamic network flows. Annals of Operations Research, 20(1):1–66, December 1989. doi:10.1007/BF02216922.
- [3] Achim Blumensath, Thomas Colcombet, and Pawel Parys. On a fragment of AMSO and tiling systems. In International Symposium on Theoretical Aspects of Computer Science (STACS), volume 47 of LIPIcs, pages 19:1–19:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2016. doi:10.4230/LIPIcs.STACS.2016.19.
- [4] Thomas Colcombet. Regular cost functions, part I: logic and algebra over words. Log. Methods Comput. Sci., 9(3), 2013. doi:10.2168/LMCS-9(3:3)2013.
- [5] Thomas Colcombet, Nathanaël Fijalkow, and Pierre Ohlmann. Controlling a random population. In International Conference on Foundations of Software Science and Computational Structures (FoSSaCS), volume 12077 of Lecture Notes in Computer Science, pages 119–135. Springer, 2020. doi:10.1007/978-3-030-45231-5_7.
- [6] Thomas Colcombet, Nathanaël Fijalkow, and Pierre Ohlmann. Controlling a random population. Logical Methods in Computer Science, 17(4), 2021. doi:10.46298/LMCS-17(4:12)2021.
- [7] Nathanaël Fijalkow, Hugo Gimbert, Edon Kelmendi, and Denis Kuperberg. Stamina: Stabilisation monoids in automata theory. In International Conference on Implementation and Application of Automata, volume 10329 of Lecture Notes in Computer Science, pages 101–112. Springer, 2017. doi:10.1007/978-3-319-60134-2_9.
- [8] Nathanaël Fijalkow, Hugo Gimbert, Edon Kelmendi, and Youssouf Oualhadj. Deciding the value 1 problem for probabilistic leaktight automata. Log. Methods Comput. Sci., 11(2), 2015. doi:10.2168/LMCS-11(2:12)2015.
- [9] L. R. Ford and D. R. Fulkerson. Constructing maximal dynamic flows from static flows. Operations Research, 6(3):419–433, 1958. doi:10.1287/opre.6.3.419.
- [10] Lester Randolph Ford and Delbert Ray Fulkerson. Maximal flow through a network. Canadian journal of Mathematics, 8:399–404, 1956. doi:10.4153/CJM-1956-045-5.
- [11] Hugo Gimbert, Corto Mascle, and Patrick Totzke. Optimally controlling a random population. In Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis, editors, 53rd International Colloquium on Automata, Languages, and Programming (ICALP 2026), volume 374 of LIPIcs, pages 179:1–179:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2026. doi:10.4230/LIPIcs.ICALP.2026.179.
- [12] James Alexander Green. On the structure of semigroups. Annals of Mathematics, 54(1):163–172, 1951. doi:10.2307/1969317.
- [13] Ismaël Jecker. A Ramsey theorem for finite monoids. In International Symposium on Theoretical Aspects of Computer Science (STACS), volume 187 of LIPIcs, pages 44:1–44:13. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPIcs.STACS.2021.44.
- [14] Ismaël Jecker. A ramsey theorem for finite monoids. CoRR, abs/2101.05895, 2021. arXiv:2101.05895.
- [15] David Kempe, Jon Kleinberg, and Amit Kumar. Connectivity and inference problems for temporal networks. In Symposium on Theory of Computing (STOC), STOC ’00, pages 504–513. Association for Computing Machinery, 2000. doi:10.1145/335305.335364.
- [16] David Kempe, Jon M. Kleinberg, and Amit Kumar. Connectivity and inference problems for temporal networks. Journal of Computer and System Sciences, 64(4):820–842, 2002. doi:10.1006/JCSS.2002.1829.
- [17] Daniel Kirsten. Distance desert automata and the star height problem. RAIRO Theor. Informatics Appl., 39(3):455–509, 2005. doi:10.1051/ITA:2005027.
- [18] Imre Simon. Factorization forests of finite height. Theoretical Computer Science, 72(1):65–94, 1990. doi:10.1016/0304-3975(90)90047-L.
- [19] Imre Simon. On semigroups of matrices over the tropical semiring. Informatique Théorique et Applications, 28(3-4):277–294, 1994. doi:10.1051/ITA/1994283-402771.
