On Polyatomic Tomography over Abelian Groups: Some Remarks on Consistency, Tree Packings and Complexity

The paper deals with an inverse problem of reconstructing matrices from their marginal sums. More precisely, we are interested in the existence of r×s\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$r\times s$$\end{document} matrices for which only the following information is available: The entries belong to known subsets of c distinguishable abelian groups, and the row and column sums of all entries from each group are given. This generalizes Ryser’s classical problem of characterizing the set of all 0–1-matrices with given row and column sums and is a basic problem in (polyatomic) discrete tomography. We show that the problem is closely related to packings of trees in bipartite graphs, prove consistency results, give algorithms and determine its complexity. In particular, we find a somewhat unusual complexity behavior: the problem is hard for “small” but easy for “large” matrices.

matrices with given row and column sums was addressed by Ryser [17] already in 1960; see also [3]. It is closely related to degree sequences of graphs, and-by identifying the 1-entries of such a matrix with point sets in R 2 or Z 2 -can, in retrospective, also be viewed as an anticipation of the field of discrete tomography. Since then, a rich theory has been developed which is centered around the task of determining (theoretically and algorithmically) discrete structures by information about their interaction with certain query sets. For surveys see [1,10,12], and other sources quoted there. More than half a century after Ryser's work discrete tomography is a well-established field with seminal results reaching into combinatorics, geometry, geometry of numbers, commutative algebra, optimization and other fields.
Its many practical applications in materials science, physics, and various other areas (see e.g. [1]) have fueled studies in dimensions higher than 2, for X-rays in more than two directions, for other query sets-most notably hyperplanes, leading to the discrete Radon transform-with other image domains (modelling e.g. grey values in images) and for objects which are composed of different types of elements, the polyatomic or colored case.
As Ryser [17] showed, the classical binary monoatomic case for 2 directions can be solved easily and in polynomial time. The problem becomes NP-hard, however, when more than two directions are involved [8], see also [4]. The corresponding integer case where the entries of the unknown matrix are in Z can be modeled via systems of linear Diophantine equations and can therefore also be solved in polynomial time for any fixed number of directions.
The situation changes if more than one class of atoms (often called colors) is present. Then, the binary case becomes NP-hard even when X-ray information about the unknown matrix is given only for the rows and columns, i.e., in the two coordinate directions [6].
As we will show, polyatomic tomography over Z depicts a different behavior, being NP-hard for matrices with a small number of rows (or columns) but easy for matrices of larger size. It will turn out that the problem is intimately related to packings of trees in (bipartite) graphs, whose study was initiated by Tutte [20] and Nash-Williams [15]. This connection will be used to determine (even in the general case, i.e., for matrix entries restricted to distinguishable but otherwise arbitrary abelian groups) when the reconstruction problem from row and column sums can be solved for a given number of colors. Let us further remark that the problem we are considering can also be viewed as a special variant of the multi-commodity flow problem which therefore also depicts the same (possibly unexpected) complexity behavior.
The present paper is organized as follows. In Sect. 2 we will introduce the problems formally and state the main results. Section 3 will show how the polyatomic problem relates to tree packings, prove our main existence theorem, and the efficiency part of Theorem 2.2. In Sect. 4 we will deal with the computational complexity of the problem and prove the hardness part of Theorem 2.2. The final Sect. 5 will provide an interpretation as a multi-commodity flow problem, make some concluding remarks and state some open problems.

Notation and Main Results
We will now introduce the relevant notion in great enough generality to be able to formulate our main results and also place them into the perspective of, partly classical, known results.
Throughout the paper N, Z and R denote the sets of positive integers, integers and reals, respectively, and let N 0 = N ∪ {0} and [n] = { j ∈ N : j ≤ n} for each n ∈ N.
Further, let c, r , s ∈ N, and let G 1 , . . . , G c be abelian groups (written additively). (The groups need not be different but are to be distinguished, i.e., should be thought of as a pair consisting of an abelian group and an index from [c], sometimes referred to as its color.) In the following, we are interested in (colored) r × s matrices M = μ with prescribed row and column sums for each of the groups G 1 , . . . , G c .
More precisely, suppose that, for ∈ [c], we are given (2.1) Let us point out again that each element μ ( i j ) i j of the matrix M carries the information which of the c groups it belongs to-specified by (its color) i j . As usual, a sum over the empty set is, by convention, the neutral element of the underlying group.
Clearly, a necessary condition for such a matrix M to exist is that each (R ( ) , S ( ) ) is balanced, i.e., (2.2) Using the notation we say that our row and column sum data . Given a balanced pair (R, S), let A c G (R, S) denote the set of all colored matrices in ∈[c] G r ×s satisfying (2.1). In the following we will focus on the question when A c G (R, S) is nonempty. In some cases, the elements of M ∈ A c G (R, S) will be further restricted to subsets W ( ) ⊂ G for each ∈ [c]. Setting W = (W (1) Given r , s and corresponding balanced (R, S), does there exist M ∈ A c G ,W (R, S)? Let us remark that-as the notation indicates-c, G and W are (arbitrary but) fixed whenever we refer to the problem ColRys c (G , W ), while the dimensions r and s and the parameters in (R, S) specify the different instances. Note that we may assume without loss of generality that 2 ≤ r ≤ s.
The name ColRys c (G , W ) is chosen in reverence for Ryser, as it describes a colored version of his original "monoatomic" problem studied in [17]. In fact, for c = 1, G = (Z), W = ({0, 1}), ColRys c (G , W ) asks for a 0-1 matrix with given row and column sums (computed in Z). As it is well known, this and the corresponding reconstruction problem to compute such a matrix can be solved in polynomial time, [17]; see also [3] or [12]. Let us mention that the monoatomic case has also been studied over rings other than Z; see [2] and the papers quoted there.
Further, for c = 1, G = (Z), W = (Z), each instance of ColRys c (G , W ) gives rise to a system of linear Diophantine equations and can therefore be solved efficiently.
Even if X-ray information in more than two directions is given, the problem can be formulated as a system of linear Diophantine equations and still be solved in polynomial time; see e.g. [14,Sect. 7].
On the other hand, when G = Z and W = {0, 1} for all ∈ [c], ColRys c (G , W ) constitutes the "classical" polyatomic case where a planar hybrid material is only accessible by X-ray information (at atomic scale) in the standard coordinate directions for each of the c types of different materials. Let us stress the fact that the positions of the colors, i.e., the assignments (i, j) → i j , are by no means fixed "externally" but are part of the solution. Therefore ColRys c (G , W ) does not simply decompose into c monoatomic problems with restricted support which can be solved independently. In fact, as it is well known, ColRys c (G , W ) is NP-complete, for every c ≥ 2, [6]. (Note that [6] regards the neutral elements of all groups together as an additional color.) The present paper addresses existence issues and the question of efficient computability for the general problem ColRys c (G , W ). In particular, we give the following existence theorem for general G .
Then, for any corresponding pair Note that the condition in Theorem 2.1 is, in particular, satisfied when This means that the answer to any "large" instance of ColRys c (G , G ) is always "yes". The proof of Theorem 2.1 will be given in Sect. 3. There, we will also discuss natural conditions under which the given condition is sharp; see Theorem 3.8. The proof of Theorem 2.1 utilizes packings of spanning trees in complete bipartite graphs and will even show that a matrix in A c G (R, S) can actually be computed efficiently, whenever the group operations are algorithmically accessible. Since we do not want to overload the paper with technical details, we will formulate our algorithmic results only for the integer case, i.e., for G = Z = (Z, . . . , Z) where we can naturally employ the standard binary Turing machine model.
The following results deal with the complexity of ColRys c (Z , Z ) and it turns out, in particular, that this problem is NP-hard in general.

Theorem 2.2 Let c ∈ N. When all instances are restricted to those for which c
For any c ∈ N\{1}, ColRys c (Z , W ) is NP-complete both for W = Z and W = N 0 . The NP-hardness persists even if all instances are restricted to those where the number of rows is fixed to some r * ∈ {2, . . . , c}. Moreover, when c ∈ N\{1}, The first part of Theorem 2.2 will follow from the (more general) proof given in Sect. 3 while the hardness result will be proved in Sect. 4.
Let us remark that the dramatic drop in complexity of ColRys c (Z , Z ) from r * ≤ c to r * ≥ c + 1 may be phrased intuitively as "Small instances are hard while large instances are easy." Of course, in the hardness statement only r * is fixed but s is still part of the input. Anyway it is more common that problems do not get easier if previously fixed parameters become part of the input.

Tomography and Spanning Trees
In this section we will first consider the monoatomic case, i.e., c = 1, for which we can use a simplified notation. Let G be an abelian group, 0 G its neutral element, and S = (S). As before, we assume that (R, S) is balanced, which simply means that (R, S) is balanced. Further, A c G (R, S) will be denoted by A G (R, S). We show how the existence of a matrix M ∈ A G (R, S) is related to the existence of spanning trees in complete bipartite graphs. As it is standard fare, (R, S) is naturally associated with a vertex weighted complete bipartite graph as follows.
Let A = {a 1 , . . . , a r }, B = {b 1 , . . . , b s } denote the bipartition of the vertex set of K r ,s , and regard, for i ∈ [r ] and j ∈ [s], the values ρ i , σ j as weights associated with the vertices a i and b j , respectively. We speak of K r ,s as (R, S)-weighted. Now, for i ∈ [r ] and j ∈ [s], each edge e i j of K r ,s corresponds to the position (i, j) of the desired matrix M. Hence we are interested in assigning weights μ i j to the edges whose row and column sums add up to R and S, respectively. Note that there is some connection to the 1-2-3-conjecture; see e.g. [19] and the papers quoted there.
Actually, for later applications to the polyatomic case, we are interested in sparsity, i.e., in assigning 0 G to as many edges of K r ,s as possible. Let G = (V , E) be a spanning subgraph of K r ,s , i.e., V = A ∪ B. The graph G naturally inherits the vertex weights (R, S), and is called compensable if there exist edge weights ω i j ∈ G such that Edge weights satisfying (3.1) and (3.2) will be called compensating.
Recall that, by our general assumption, (R, S) is balanced, hence the sum of the weights of the vertices in A coincides with that of B, i.e., the trivial condition for compensability is satisfied. The following observation is obvious, but crucial.
Next we show that actually each arbitrary spanning tree leads to a matrix in A G (R, S).

Theorem 3.2 Let K r ,s be (R, S)-weighted. Then any spanning tree T in K r ,s is compensable.
Proof We select a vertex of T as root, say, without loss of generality, a 1 , and arrange the other vertices of T in layers L 0 , . . . , L q according to their edge distance to a 1 . Since K r ,s is bipartite, the vertices of each layer belong either all to A or all to B and consecutive layers contain vertices of different sets of this bipartition. Of course, Note that for each p ∈ {1, . . . , q} and each vertex v in L p there is a unique edge that joins v to a vertex from L p−1 ; it will in the sequel be denoted by e v . Further, let E v denote the subset of the edge set E T of T of those edges which join v to a vertex from L p+1 . We will now assign appropriate edge weights ω(e) for e ∈ E T layer by layer. For an illustration see Fig. 1.
To simplify the notation, τ (v) will denote the given weight of v, i.e., τ (v) = ρ i for v = a i ∈ A and τ (v) = σ j for v = b j ∈ B. In the following, we say that the vertex v is satisfied if, for v = a i ∈ A, the condition (3.1) and, for v = b j ∈ B, the condition (3.2) is satisfied.
We start with the vertices of L q . Since each such vertex v is a leaf of T we can set ω(e v ) = τ (v), and thus satisfy v. Now let p ∈ [q − 1], P p = L p+1 ∪ · · · ∪ L q and suppose, edge weights have been chosen for all edges in {e v : v ∈ P p } in such a way that all the vertices in P p are satisfied. For v in L p we now choose which, consequently, satisfies v.
Equivalently, the construction can be described in terms of the weights τ (v) for v in L p . Let T v be the vertex set of the connected component of the subgraph of T induced by {v} ∪ P p which contains v. Now, suppose that v ∈ A. Then For v ∈ B, the roles of A and B in (3.3) are reversed. By the successive construction all vertices of V \{a 1 } are satisfied. Moreover, So a 1 is also satisfied, which completes the proof.
Note that, apart from simple computations in T , the construction only involves operations in G. Hence, if these are algorithmically accessible, the corresponding matrix can be constructed efficiently. Since we do not want to go into additional technical details we formulate the result in the following corollary only for Z, where we can apply the standard binary Turing machine model.

Corollary 3.3 Let G = Z. Given an (R, S)-weighted K r ,s , and a spanning tree in K r ,s , compensating edge weights can be computed in polynomial time.
Next we turn to the case of an arbitrary number c of colors. As Remark 3.1 and Theorem 3.2 suggest we will now aim at packing c spanning trees into K r ,s . Let us remark that the study of packings of subgraphs into graphs goes back a long way; e.g. [15,20] for spanning trees, [11] for cliques and stable sets, and [15,18] for other packing problems with a particular view towards combinatorial optimization.
A graph G admits a packing of c spanning trees if there exist (at least) c edge-disjoint spanning trees in G. Equivalently, we say that c spanning trees can be packed into G. Let stp(G) denote G's spanning tree packing number, i.e., the maximal number of spanning trees which can be packed into G. Initiated by work of Tutte [20] and Nash-Williams [15], stp(G) has been studied extensively. Of course, we are particularly interested in the spanning tree packing number for complete bipartite graphs. Note first that, as K r ,s has rs edges while each spanning tree in K r ,s has r + s − 1 edges, rs/(r + s − 1) is a trivial upper bound for stp(K r ,s ). As it turns out, this bound is tight, [16,Sect. 3.4]; see also the references cited there. It is now easy to complete the proof of Theorem 2.1.

Proof of Theorem 2.1
Let r , s ∈ N with 2 ≤ r ≤ s such that c ≤ rs/(r + s − 1) and let (R, S) be balanced over G . Further, let T (1) , . . . , T (c) be edge-disjoint spanning trees according to Proposition 3.4. If we associate, for ∈ [c], with T ( ) the vertex weights (R ( ) , S ( ) ) then T ( ) is compensable by Theorem 3.2. Finally, by Remark 3.1 any compensating edge weighting directly translates to an entry μ ( ) i j ∈ G of the desired matrix M satisfying (2.1). Note that the nonzero elements are restricted to the positions (i, j) whose corresponding edges are in T ( ) . Finally we fill all entries of M which do not correspond to an edge of any of the c trees with neutral elements 0 G of any of the groups G . Then M ∈ A c G (R, S).
As in the monoatomic case, the efficient computation of such a matrix M ∈ A c G (R, S) relies on the appropriate algorithmic accessibility of the group operations. In addition, we need to be able to compute a maximum tree packing in K r ,s . This can be done efficiently even for general graphs; see [18,Sect. 51.5a] for a complexity survey with references.

Proposition 3.5 For each graph G, stp(G) edge-disjoint spanning trees in G can be computed in polynomial time.
With the aid of Corollary 3.3 and Proposition 3.5, the proof of Theorem 2.1 therefore yields, in particular, the following corollary. This corollary allows us to prove the efficiency part of Theorem 2.2. Recall that, by the remark after Theorem 2.1, Corollary 3.6 covers already the cases that r ≥ c + 1, s ≥ (r − 1) 2 and r ≥ 2c. So we are left with the situation that r and s are bounded by constants, and we can use the fact that ColRys c (Z , Z ) becomes easy for fixed r and s. Indeed, we can simply enumerate all (constantly many) partitions P 1 , . . . , P c of [r ] × [s] (where empty sets are allowed) such that the matrix positions in P contain only elements of G . Then, for ∈ [c], we solve in polynomial time the c systems of linear Diophantine equations in the variables ξ ( ) i j for (i, j) ∈ P that encode the row and column sum conditions. This will produce integer solutions for each color or decide infeasibility in polynomial time.
Let us close this section with a result on the tightness of the bound c ≤ rs/(r + s − 1) in Theorem 2.1. While, by Proposition 3.4, the right hand side is tight for stp(K r ,s ), its tightness in Theorem 2.1 actually depends on the underlying groups. For instance, if all groups are trivial, i.e., G = ({0 G }, +), it follows trivially from the convention that sums over the empty set yield the neutral element of the underlying group, that solutions exist for any number c.
As it turns out, however, the bound in Theorem 2.1 is tight if the involved groups are "arithmetically rich enough". To be more precise, let us call a group G arithmetically rich, if for each r , s with 2 ≤ r ≤ s there exist R ∈ (G\{0 G }) r , S ∈ (G\{0 G }) s such that (R, S) is balanced and for each I ⊂ [r ], J ⊂ [s] with 1 ≤ |I | ≤ r − 1 and 1 ≤ |J | ≤ s − 1, Such a pair (R, S) will be called rich.
As it turns out, the bound in Theorem 2.1 is tight, whenever all involved groups are arithmetically rich. contradicting the choice of (R, S). Hence H is connected. Therefore the associated subgraph of K r ,s induced by the edges that correspond to P contains a spanning tree.
Hence M leads to a packing of spanning trees K r ,s , and thus c ≤ stp(K r ,s ).

Computational Complexity
Let us now turn to the hardness results asserted in Theorem 2.2. First note that for ColRys c (Z , Z ) and ColRys c (Z , N 0 ) membership in NP is clear. To prove NPhardness we will use a transformation from
Note that the matrix is now filled completely. In particular, colors > r * are never used. Clearly, M ∈ A c Z ,Z (R, S). Conversely, let J be a yes-instance of ColRys c (Z , Z ), and let M = μ S). By the choice of S, each column contains at least one nonzero entry of each color ∈ [r * ], which adds up to a total of r * · n positions filled with nonzero entries. Hence for each color ∈ [r * ] there is exactly one nonzero entry in each column, and its value is given by the prescribed column sum. This also implies that for none of the colors ≥ r * + 1, any of the entries of M is of that color, i.e., i j = for i ∈ [r * ], j ∈ [n], ≥ r * + 1. Hence μ ( ) , j = 1 for j ∈ [n] and ∈ {3, . . . , r * }, i.e., the -th row of M is filled with 1's of the color for ∈ {3, . . . , r * }. Also i j / ∈ {1, 2} for i ≥ 3. Now, with N = { j ∈ [n] : 1, j = 1}, the row sum equalities imply that which concludes the proof of the reduction for ColRys c (Z , Z ).
To prove the NP-hardness of ColRys c (Z , N 0 ) we can apply (a simplified version of) the same construction. Just observe that a row sum 0 for any color implies that no (nonzero) entry of the matrix M in that row can be of that color. Hence, for larger r , the construction can just be amended by 0 row sums. Now all hardness assertions of Theorem 2.2 have been established.
Note that over Z, the argument on zero row sums forcing zero values in the matrix is obviously wrong. So this additional freedom of realizing row sums 0 in a nontrivial way is actually responsible for the drastic drop in complexity over Z which is shown in Theorem 2.2.

Final Remarks
We conclude with some final remarks and open problems.
Let us first point out that the problem we are considering can be viewed as a special variant of the multi-commodity flow problem. In fact, let the node sets A = {a 1 , . . . , a r } and B = {b 1 , . . . , b s } of K r ,s correspond to r supply and s demand stations for c liquids which can be transported through pipes (modeled by the edges of K r ,s ). No pipe can be used for different liquids, and the quantities of flow are integer (say, in order to guarantee a certain precision for subsequent mixtures). Now, suppose we are given c different integer quantities of demand or supply, respectively, at each node such that the total demand equals the total supply for each of the c liquids. In this situation we will speak of a service request.
Given a service request, we are interested in facilitating the transport in integer quantities in such a way that all demands and supplies are met and no two liquids use the same pipe. Note that negative flows are not prohibited, i.e., flows may transport some liquid from a demand to a supply station in order to satisfy all demands and supplies at each node. Clearly, this asks for consistency (and subsequently, the reconstruction of a solution) of the corresponding instances of ColRys c (Z , Z ) with all groups being Z.
Actually, if we require a "general solution", i.e., that the pipes are reserved for individual liquids so as to guarantee that every possible service request can be executed with the same assignment of liquids to pipes, we are exactly in the situation of Theorem 2.1.
Of course, in the context of multi-commodity flow some questions arise naturally. For instance, bounds on the capacity of the pipes lead to corresponding restrictions of W . Similarly, when only nonnegative flows are allowed the entries of our colored matrix are confined to N 0 . Then, of course, we are in the situation of ColRys c (Z , N 0 ) and Theorem 2.2 provides a corresponding NP-hardness result. Note that, if the capacities are bounded above by 1 and negative flow is prohibited we are actually dealing with binary tomography for c classes of atoms which is NP-hard for c ≥ 2, [6].
Let us now mention two open problems in discrete tomography. In spite of the computational simplicity of the classical monochromatic binary tomography problem of reconstructing a 0-1 matrix from its row and column sums (the "classical Ryser problem"), the complexity status of the corresponding counting problem ("Determine the number of solutions!") is, most annoyingly, still open. Some restricted variants are, however, known to be related to the problem of computing the permanent of a matrix and are thus #P-hard; [7]. See also [2] for counting results over finite fields. Perhaps even more surprisingly, while the consistency problem for the 2-atom case for two directions is NP-hard, [6], the complexity status of the corresponding uniqueness and counting problems remains unknown. (The ambiguity of exchanging neutral elements 0 G is avoided by regarding them together as an extra color.) Our present paper has focused on the polyatomic case for X-rays in two directions. It is, of course, natural to ask similar questions for X-rays in more than two directions or query sets other than lines, particularly hyperplanes, as they lead to the Radon transform. As it turns out, the situation is more complicated then, exceeds by far the scope of the present paper and is therefore deferred to a subsequent article. Let us just mention that the results of Sect. 3 can, to some extent, be generalized, leading to packings of certain hypertrees in associated hypergraphs. by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.