Using edge cuts
to find Euler tours and Euler families in hypergraphs
Abstract
An Euler tour in a hypergraph is a closed walk that traverses each edge of the hypergraph exactly once, while an Euler family is a family of closed walks that jointly traverse each edge exactly once and cannot be concatenated. In this paper, we show how the problem of existence of an Euler tour (family) in a hypergraph can be reduced to the analogous problem in some smaller hypergraphs that are derived from using an edge cut of . In the process, new techniques of edge cut assignments and collapsed hypergraphs are introduced. Moreover, we describe algorithms based on these characterizations that determine whether or not a hypergraph admits an Euler tour (family), and can also construct an Euler tour (family) if it exists.
Keywords: Hypergraph; Euler tour; Euler family; edge cut; edge cut assignment; collapsed hypergraph; algorithm.
1 Introduction
It is common knowledge that a connected graph admits an Euler tour — that is, a closed walk traversing each edge of the graph exactly once — if and only if the graph has no vertices of odd degree. The notion of an Euler tour can be generalized to hypergraphs in the obvious way, and has been studied as such in [5, 1]. In addition, Bahmanian and Šajna [1] also introduced the notion of an Euler family, which is a family of closed walks that jointly traverse each edge of the hypergraph exactly once and cannot be concatenated. For a connected graph, an Euler family precisely corresponds to an Euler tour; for general connected hypergraphs, however, the two notions give rise to two rather distinct problems: Euler family, which is of polynomial complexity [1], and Euler tour, which is NP-complete [5]. The question of how to reduce the search for an Euler family or tour in a hypergraph to smaller hypergraphs is thus particularly pertinent in the case of Euler tours.
An Euler tour (family) is called spanning if it traverses every vertex of the hypergraph. In [6], Steimle and Šajna showed how to use certain vertex cuts to reduce the problem of finding a spanning Euler tour (family) in a hypergraph to some smaller hypergraphs derived from subhypergraphs of . In the present paper, with the same goal in mind, we shall use edge cuts instead. This new approach represents a major improvement over the results from [6]. First, it can be used for general Euler tours and families, not just for spanning Euler tours and families. Second, while the main results from [6] apply only to hypergraphs with vertex cuts of cardinality at most two, the present approach applies to edge cuts of any size, and hence to all hypergraphs, as every non-trivial hypergraph has an edge cut. In addition, we introduce new elegant techniques of edge cut assignments and collapsed hypergraphs, which will be useful in problems beyond the scope of this paper.
After reviewing the terminology and providing some basic tools in Section 2, we shall introduce edge cuts in Section 3, and the first main tool — edge cut assignments — in Section 4. The key result of this section is Theorem 4.4, where we show that a hypergraph admits an Euler family (tour) if and only if there exists an edge cut assignment such that the associated hypergraph admits an Euler family (tour). This theorem forms the basis of all reduction results and algorithms.
In Section 5, we present our first main reduction result. Namely, in Theorems 5.2 and 5.3 we show that a hypergraph with a minimal edge cut admits an Euler family (tour) if and only if certain subhypergraphs of H (obtained from the connected components of ) admit an Euler family (tour).
We begin Section 6 by introducing a collapsed hypergraph of a hypegraph ; that is, a hypergraph obtained from by “collapsing” (identifying) the vertices in a given subset of the vertex set of . We then present our second main reduction result. In Theorem 6.2, we show that a hypergraph admits an Euler family if and only if certain collapsed hypergraphs obtained via an edge cut assignment admit Euler families. The analogous result for Euler tours is presented in Corollaries 6.3 and 6.4; the former contains the proof of necessity, while the latter contains the proof of sufficiency, but requires an additional assumption.
2 Preliminaries
We begin with some basic concepts related to hypergraphs, which will be used in later discussions. For any graph- and hypergraph-theoretic terms not defined here, we refer the reader to [3] and [2], respectively.
A hypergraph is an ordered pair , where is a non-empty finite set and is a finite multiset of . To denote multisets, we shall use double braces, . The elements of and are called vertices and edges, respectively. A hypergraph is said to be trivial if it has only one vertex, and empty if it has no edges. The size of a hypergraph is .
Let be a hypergraph, and . If and there exists an edge such that , then we say that and are adjacent (via the edge ); this is denoted . If and are such that , then is said to be incident with , and the ordered pair is called a flag of . The set of flags of is denoted by . The degree of a vertex is the number of edges in incident with , and is denoted by , or simply when there is no ambiguity.
A hypergraph is called a subhypergraph of the hypergraph if and for some submultiset of . For any subset , we define the subhypergraph of induced by to be the hypergraph with . Thus, we obtain the subhypergraph induced by by deleting all vertices in from and from each edge of , and subsequently deleting all empty edges. For any subset , we denote the subhypergraph of by , and for , we write instead of . For any multiset of , the symbol will denote the hypergraph obtained from by adjoining all edges in .
A -walk of length in a hypergraph is an alternating sequence of (possibly repeated) vertices and edges such that , , and for each , the vertices and are adjacent in via the edge . Note that since adjacent vertices are by definition distinct, no two consecutive vertices in a walk can be the same. It follows that no walk in a hypergraph contains an edge of cardinality less than 2. The vertices in are called the anchors of , vertices and are the endpoints of , and are the internal vertices of . We also define the edge set of as , and the set of anchor flags of as . Walks and in a hypergraph are said to be edge-disjoint if , and anchor-disjoint if .
A walk is called closed if and ; a trail if the edges are pairwise distinct; a path if it is a trail and the vertices are pairwise distinct; and a cycle if it is a closed trail and the vertices are pairwise distinct. (Note that in [2], a “trail” was defined as a walk with no repeated anchor flags, and a walk with no repeated edges was called a “strict trail”. In this paper, we shall consider only strict trails, and hence use the shorter term “trail” to mean a “strict trail”.)
A walk is said to traverse a vertex and edge if and , respectively. More specifically, the walk is said to traverse the edge via vertex , as well as traverse vertex via edge , if either or is a subsequence of .
Vertices and are connected in a hypergraph if there exists a -walk — or equivalently, a -path [2, Lemma 3.9] — in , and itself is connected if every pair of vertices in are connected in . The connected components of are the maximal connected subhypergraphs of without empty edges. The number of connected components of is denoted by .
An Euler tour of a hypergraph is a closed trail of traversing every edge of , and a hypergraph is said to be eulerian if it either admits an Euler tour or is trivial and empty. An Euler family of is a set of pairwise edge-disjoint and anchor-disjoint closed trails of jointly traversing every edge of . Clearly, an Euler family of cardinality 1 corresponds to an Euler tour, and vice-versa. An Euler family of is said to be spanning if every vertex of is an anchor of a closed trail in , and an Euler tour of is spanning if it traverses every vertex of .
The following two observations will be frequently used tools in the rest of the paper. Their easy proofs are omitted.
Lemma 2.1
Let be a hypergraph with connected components for . Then the following hold.
-
(i)
If, for each , we have that has an Euler family , then is an Euler family of . If each is spanning in , then is spanning in .
-
(ii)
If has an Euler family , then has a partition such that, for each , we have that is an Euler family of . If is spanning in , then is spanning in , for each .
Lemma 2.2
Let and be hypergraphs such that and there exists a bijection satisfying for all . Then the following hold.
-
(i)
If has an Euler family , then has an Euler family obtained from by replacing each edge with .
-
(ii)
If has an Euler family such that for all we have that is traversed in via vertices in , then has an Euler family obtained from by replacing each edge with .
Lemma 2.2 also gives rise to the following tool, to be used in our algorithms.
Corollary 2.3
Let be a hypergraph, and an even graph with and . Then the following hold.
-
(i)
has an Euler family if and only if does.
-
(ii)
Assume is connected and is a cycle (graph) on the vertex set . Then has an Euler tour if and only if does.
Proof.
-
(i)
Assume has an Euler family . Let be the graph with vertex set and , where if traverses via its vertices and . By Lemma 2.2(ii), the graph has an Euler family, and hence is even. Therefore is even and possesses an Euler family, and hence by Lemma 2.2(i), the hypergraph possesses an Euler family.
Conversely, assume that admits an Euler family , and let be an Euler family of . Then an Euler family of is obtained from is by concatenating any closed trails with a common anchor.
-
(ii)
Let .
Assume has an Euler tour . Let be the graph with vertex set and , where if traverses via its vertices and . By Lemma 2.2(ii), the graph has an Euler tour, and hence is even and connected. Let . Then is a connected even graph, and hence admits an Euler tour. By Lemma 2.2(i), the hypergraph admits an Euler tour.
The converse is obtained similarly, interchanging the roles of and , and those of and .
3 Edge cuts in hypergraphs
As in graphs [3], an edge cut in a hypergraph is a (multi)set of edges of the form for some non-empty proper subset of . Here, for any , we denote
An edge in a hypergraph is said to be a cut edge of if . Thus, an edge is a cut edge if and only if is an edge cut.
Lemma 3.1
Let be a hypergraph and Then is disconnected if and only if has an edge cut .
Proof. Assume is disconnected, let be one connected component of , and . Then is an edge cut of contained in .
Conversely, assume has an edge cut , where for . Then has no edge intersecting both and , so it is disconnected.
As we shall see in the next lemma, minimal edge cuts — that is, edge cuts that are not properly contained in other edge cuts — have a very nice property that will be much exploited in subsequent results. Note that, for a hypergraph and its subhypergraph , we say that an edge intersects if .
Lemma 3.2
Let be a hypergraph. An edge cut of is minimal if and only if every edge of intersects each connected component of .
Proof. Assume is a minimal edge cut of . Suppose is a connected component of , and is such that does not intersect . Let and . Then , contradicting the minimality of . Thus every edge of intersects each connected component of .
Conversely, assume each edge of intersects every connected component of . Suppose is an edge cut of and . Take any . Since intersects every connected component of , the hypergraph is connected. Hence by Lemma 3.1, the set contains no edge cut of , a contradiction. Hence the edge cut is minimal.
In our algorithms, it will be helpful to find minimal edge cuts containing edges of cardinality at least 3. The proof of the next lemma explains how this can be done.
Lemma 3.3
Let be a connected hypergraph, and an edge of of cardinality at least 3. Then admits a minimal edge cut such that or has no edges of cardinality less than 3.
Proof. Fix a vertex , and let . Then is an edge cut; let be the connected components of . Without loss of generality, we may assume that intersects .
Let , so . Since vertices of are disconnected from vertex in , by Lemma 3.1, there exists a minimal edge cut .
Let be the connected components of . Observe that, without loss of generality, we may assume that , while .
If , then by Lemma 3.2, each edge of has cardinality at least 3. Hence we may assume that . If , then , and we are done. Otherwise, each edge in contains , as well as a vertex in and a vertex in , and hence has cardinality at least 3.
We conclude that or each edge of has cardinality at least 3, as claimed.
4 Edge Cut Assignments
We are now ready to present the first of the two main tools that we shall use to study eulerian properties of hypergraphs via their edge cuts; namely, an edge cut assignment associated with an edge cut of a hypergraph , which maps each edge of to an unordered pair of connected components (or, more generally, unions of connected components) of .
Note that, for a finite set , we denote the set of all unordered pairs of elements in , with repetitions in a pair permitted, by ; that is, . Thus, .
Definition 4.1
Let be a connected hypergraph with a minimal edge cut , and let be a partition of such that each is a union of the vertex sets of the connected components of .
-
•
A mapping is called an edge cut assignment (associated with and ) if, for all , we have that implies that and , and implies that .
-
•
An edge cut assignment is called standard if , for each , is the vertex set of a connected component of .
-
•
Given an edge cut assignment , we define, for each ,
-
•
A hypergraph , defined by
is called the hypergraph associated with and the edge cut assignment .
-
•
A multigraph with vertex set and edge multiset is called the multigraph associated with the edge cut assignment . Thus can be viewed as a bijection .
The usefulness of these concepts will be conveyed in the following three observations, the last of which yields necessary and sufficient conditions for a hypergraph to admit an Euler family (tour) via an edge cut assignment and the associated hypergraph .
Lemma 4.2
Let be a connected hypergraph with a minimal edge cut , and let be a partition of into unions of the vertex sets of the connected components of . Furthermore, let be an edge cut assignment. If has an Euler family (tour), then so does .
Proof. Let be an Euler family of , and the subset of consisting of all closed trails that traverse at least on edge of . Take any closed trail . Then, without loss of generality, is of the form for some and -trails in , for . Obtain the sequence from by replacing each subsequence with , and each edge with . Then is a closed trail in , and is an Euler family of .
Moreover, if is an Euler tour of , then is Euler tour of .
Lemma 4.3
Let be a connected hypergraph with a minimal edge cut , and let be a partition of into unions of the vertex sets of the connected components of .
-
(i)
Suppose has an Euler family . Let be an edge cut assignment defined by if the edge is traversed by a trail in via a vertex in and a vertex in (where is possible). Then the hypergraph has an Euler family obtained from by replacing each with .
-
(ii)
Conversely, if for some edge cut assignment , the associated hypergraph has an Euler family , then has an Euler family obtained from by replacing each , for , with .
Proof.
-
(i)
Define a bijection by , for all . Then for all . By Lemma 2.2(ii), since each edge of is traversed in via vertices in , an Euler family of is obtained from by replacing each edge with , which effectively means replacing each with .
-
(ii)
Define as in (i) and use Lemma 2.2(i).
Theorem 4.4
Let be a connected hypergraph with a minimal edge cut , and let be a partition of into unions of the vertex sets of the connected components of . Then
-
(i)
has an Euler family if and only if for some edge cut assignment , each connected component of has an Euler family; and
-
(ii)
has an Euler tour if and only if for some edge cut assignment , the hypergraph has a unique non-empty connected component, which has an Euler tour.
Proof. Observe that, by Lemma 4.3, a hypergraph has an Euler family of cardinality if and only if for some edge cut assignment , the associated hypergraph has an Euler family of cardinality .
-
(i)
Since by Lemma 2.1, has an Euler family if and only if each of its connected components has an Euler family, the statement follows.
-
(ii)
From the above observation, has an Euler tour if and only if , for some , has an Euler tour. Since it is clear that has an Euler tour if and only if it has a unique non-empty connected component, which itself has an Euler tour, the statement follows.
We point out that Theorem 4.4 forms the basis for all other, more specific reductions, as well as for the algorithms presented in the rest of this paper.
5 Reduction using standard edge cut assignments
In this section, we shall be using only standard edge cut assignments; that is, edge cut assignments arising from partitions of the form , where the , for , are the connected components of , and is a minimal edge cut in a hypergraph .
Lemma 5.1
Let be a connected hypergraph with a minimal edge cut , and let , for , be the connected components of . Furthermore, let be a standard edge cut assignment.
-
(i)
If is a connected component of , then is a connected component of .
-
(ii)
If is a connected component of , then for some , and is a connected component of .
Proof.
-
(i)
Let be a connected component of , let and .
Take any such that . Then there exists such that and . Since intersects both and , it follows that is connected. Therefore is connected.
Moreover, if there exist , , , and such that , then for some we have that , and hence , a contradiction.
We conclude that is a connected component of .
-
(ii)
Let be a connected component of . Since , there exists such that .
Take any . Then for all and we have that and are connected in . It is then easy to see that and are connected in . Hence is connected.
It then follows from (i) that is a connected component of .
We are now ready to prove our first reduction theorem, Theorem 5.2, which states that a hypergraph with a minimal edge cut admits an Euler family if and only if certain subhypergraphs of obtained from the connected components of admit Euler families. The analogous result for Euler tours follows in Theorem 5.3.
Theorem 5.2
Let be a connected hypergraph with a minimal edge cut , and let , for , be the connected components of .
Then has a (spanning) Euler family if and only if there exists with such that
-
(i)
has a non-empty (spanning) Euler family, and
-
(ii)
has a (spanning) Euler family for all .
Proof. Assume has an Euler family , and let be the edge cut assignment defined by if the edge is traversed by via a vertex in and a vertex in . Then by Lemma 4.3(i), the associated hypergraph has an Euler family as well. Let be the associated multigraph, and the union of the vertex sets of all non-empty connected components of . Since is connected, we have , and hence . Since has an Euler family, by Lemma 4.2, so does . Hence is an even graph with vertices, edges, and minimum degree at least 2; it follows that .
To show (i) and (ii), let . By Lemma 5.1(i), we have that is a union of connected components of , and , for each , is a connected component of . Since has an Euler family, it follows from Lemma 2.1 that has an Euler family, as does , for each .
It remains to show that has a Euler family. Define a bijection by . Then for all , so by Lemma 2.2(i), since has an Euler family, so does . Moreover, since is non-empty, this Euler family is non-empty.
Conversely, assume that there exists with such that (i) and (ii) hold. Let and . Then by Lemma 2.1(i), the hypergraph admits an Euler family.
Observe that . Define a bijection by for all , and for all . Hence for all , and since has an Euler family, by Lemma 2.2(i), the hyperhgraph has an Euler family as well.
It is easy to see that if the Euler family of is spanning, then so are the resulting Euler families of and , for all , and vice-versa.
Theorem 5.3
Let be a connected hypergraph with a minimal edge cut , and let , for , be the connected components of .
Then has an Euler tour if and only if there exists with such that
-
(i)
has an Euler tour, and
-
(ii)
is empty for all .
Proof. Assume has an Euler tour , and let be the edge cut assignment defined by if the edge is traversed by via a vertex in and a vertex in . Let be the associated multigraph. By Lemmas 4.3(i) and 4.2, respectively, the hypergraph and multigraph both have Euler tours. Hence has a unique non-empty connected component; let be its vertex set. As in the proof of Theorem 5.2, it can be shown that .
Let . By Lemma 5.1(i), we have that is a connected component of , as is , for each . Since has an Euler tour and is not empty, it follows that has an Euler tour, and , for each , is empty.
Conversely, assume that there exists with such that (i) and (ii) hold. Let , and . Similarly to the proof of Theorem 5.2, we observe that since has an Euler tour and , for each , is empty, Lemma 2.1(i) shows that has an Euler tour as well. By Lemma 2.2(i), it follows that has an Euler tour.
We observe that Theorem 5.3 cannot be extended to spanning Euler tours in any meaningful way. The following immediate consequence of Theorems 5.2 and 5.3 gives more transparent necessary and sufficient conditions for the existence of an Euler family and Euler tour for a hypergraph with a cut edge.
Corollary 5.4
Let be a connected hypergraph with a cut edge . Let , for , be the connected components of . Then the following hold.
-
(i)
has a (spanning) Euler family if and only if there exists such that
-
•
has a non-empty (spanning) Euler family, and
-
•
has a (spanning) Euler family for all .
-
•
-
(ii)
has an Euler tour if and only if there exists such that
-
•
has an Euler tour, and
-
•
is empty for all .
-
•
-
(iii)
has no spanning Euler tour.
-
(iv)
If has no vertex of degree 1, then has no Euler tour.
In Algorithm 5.5 below, we shall now put to use the results of Lemma 4.2 and Theorem 4.4 (applied to standard edge cut assignments), as well as Corollary 2.3 and Lemma 3.3, to determine whether a given hypergraph has an Euler family.
Algorithm 5.5
Does a connected hypergraph admit an Euler family?
-
(1)
Sequentially delete vertices of degree at most 1 from until no such vertices remain or is trivial. If at any step has an edge of cardinality less than 2, then has no Euler family — exit.
-
(2)
Let be the graph obtained from by deleting all edges of cardinality greater than 2, and a maximal even subgraph of . Delete all edges of from .
-
(3)
Repeat Steps (1) and (2) as needed.
-
(4)
If is a graph, then it has an Euler family if and only if it is even — exit.
-
(5)
Find a minimal edge cut containing an edge of cardinality at least 3.
-
(6)
Let , for , be the connected components of .
-
(7)
For all edge cut assignments :
-
(a)
If has no Euler family, then has no Euler family — discard this .
-
(b)
For each connected component of :
if has no Euler family (recursive call), discard this . -
(c)
If every connected component of has an Euler family, then has an Euler family — exit.
-
(a)
-
(8)
has no Euler family — exit.
Similarly, in Algorithm 5.6 below, we use Theorem 5.3 and Corollary 5.4, in addition to Corollary 2.3, Lemmas 3.3 and 4.2, and Theorem 4.4, to determine whether a given hypergraph has an Euler tour.
Algorithm 5.6
Does a connected hypergraph admit an Euler tour?
-
(1)
Sequentially delete vertices of degree at most 1 from until no such vertices remain or is trivial. If at any step has an edge of cardinality less than 2, then is not eulerian — exit.
-
(2)
Let be the graph obtained from by deleting all edges of cardinality greater than 2, and a maximal even subgraph of . For each non-empty connected component of , replace in with the edge set of any cycle on .
-
(3)
Repeat Steps (1) and (2) as needed.
-
(4)
If is a graph, then it is eulerian if and only if it is even and has at most one non-trivial connected component — exit.
-
(5)
Find a minimal edge cut containing an edge of cardinality at least 3. If , then is not eulerian — exit.
-
(6)
Let , for , be the connected components of .
-
(7)
Let . If , then is not eulerian — exit.
-
(8)
For all edge cut assignments :
-
(a)
If is not eulerian, then is not eulerian — discard this .
-
(b)
If has at least 2 non-empty connected components, then is not eulerian — discard this .
-
(c)
Let be the unique non-empty connected component of . If is eulerian (recursive call), then is eulerian — exit. Otherwise, discard this .
-
(a)
-
(9)
is not eulerian — exit.
Remarks 5.7
-
(i)
In both algorithms, the input hypergraph is being modified during the execution of the algorithm. However, at any step, the current hypergraph admits an Euler family (tour) if and only if the input hypergraph does.
-
(ii)
As each non-empty proper subset of corresponds to an edge cut, minimal edge cuts are easy to construct. If the minimal edge cut obtained in this straightforward way does not contain an edge of cardinality at least 3, then at Step (5) of both algorithms, the proof of Lemma 3.3 can be used to satisfy this requirement. Its purpose is to ensure the reduction in size of the hypergraph for the next recursive call, as explained below.
-
(iii)
To guarantee that the algorithms terminate, it suffices that at each iteration . Some adjustments may be needed to satisfy this condition. First, when generating edge cut assignments, priority should be given to such that for some — for as many as possible in case of Algorithm 5.5, and for at least one in case of Algorithm 5.6. In other words, we want to have as many connected components as possible (while allowing a positive outcome) in the hope that the reduction in size from to is as large as possible.
However, we may still need to examine such that and hence and no reduction in size has occurred. In that case, it must be that — that is, has just two connected components, and — and for all . We then choose such that . For all and , we let and . Note that , and admits an Euler family (tour) if and only if at least one such hypergraph does. If necessary, we then recursively test all such hypergraphs .
-
(iv)
As long as we can guarantee that the algorithms terminate, using a minimum edge cut (instead of just a minimal one) would likely be more efficient. An algorithm for finding a minimum edge cut in a hypergraph with size , order , and cardinality of a minimum edge cut was described in [4].
-
(v)
The most time-consuming part of both algorithms is likely going to be the sequence of recursive calls to determine whether hypergraphs have an Euler family or tour. The smaller the size of the largest of the hypergraphs , the better; however, this size is impossible to predict. Instead, we suggest minimizing the number of possible edge cut assignments to be verified. The number of all possible mappings is , which indeed suggests choosing to be a minimum edge cut (if possible). Among minimum edge cuts , should we seek one that also minimizes ? We do not have a clear answer: on one hand, this approach would minimize the number of mappings to verify; on the other hand, the expected size of the hypergraphs for our recursive calls is inversely proportional to the number of connected components of , which can be anywhere between 1 and . — We shall comment more on the complexity of Algorithms 5.5 and 5.6 in Conclusion.
-
(vi)
The number of edge cut assignments resulting in an even graph is likely much smaller than . To give some idea of this number, we show in Figure 1, for , the isomorphism classes of the suitable graphs with the isolated vertices removed.
- (vii)
Example 5.8
We shall demonstrate Algorithm 5.5 using the hypergraph with and . The key hypergraphs in the execution of the algorithm on are shown in Figure 2. In each hypergraph, each edge is drawn as a complete graph on the vertex set , using a different line style. Symbols and indicate that both or either, respectively, of the two branches must lead to success, and indicates that an edge cut assignment has been applied. Finally, adj. indicates that an adjustment has been applied in order to reduce the size of the hypergraph; see Remarks 5.7(iii). Note that some minor details are omitted for brevity.
Iteration 0. The input hypergraph is , and we choose a minimal edge cut . The hypergraph has connected components , and , with vertex sets , , and . We first examine the edge cut assignment with (Iteration 1), and then the edge cut assignment with (Iteration 2).
Iteration 1. We have , and we need to test its two non-empty connected components (Iterations 1.1 and 1.2).
Iteration 1.1. The input hypergraph is . We choose a minimal edge cut . The hypergraph has connected components and , with vertex sets and . The only edge cut assignment such that is even yields , which results in . Following Remarks 5.7(iii), we replace the edge first with (Iteration 1.1.1), and then with (Iteration 1.1.2).
Iteration 1.1.1. We have . In Step (1), we delete vertex 2, which is of degree 1, resulting in an edge of cardinality 1. Hence admits no Euler family.
Iteration 1.1.2. We have . This is an even graph, and so it admits an Euler family. Iteration 1.1 is successfully completed.
Iteration 1.2. The input hypergraph is rejected in Step (1). Iteration 1 is completed unsuccessfully.
Iteration 2. We have . There is a single non-empty connected component to be tested (Iteration 2.1).
Iteration 2.1. The input hypergraph is . We choose a minimal edge cut . The hypergraph has connected components and with vertex sets and . We first test the edge cut assignment with (Iteration 2.1.1).
Iteration 2.1.1. We have . There is a single non-empty connected component to be tested (Iteration 2.1.1.1).
Iteration 2.1.1.1. The input hypergraph is . We choose a minimal edge cut . The hypergraph has components and with vertex sets and . The only admissible edge cut assignment is with , which results in . Following Remarks 5.7(iii), we replace the edge first with (Iteration 2.1.1.1.1), and then with (Iteration 2.1.1.1.2).
Iteration 2.1.1.1.1. The input hypergraph gets rejected in Step (1).
Iteration 2.1.1.1.2. The input hypergraph is , which is an even graph. Iterations 2.1.1.1, 2.1.1, 2.1, and 2 are thus completed successfully.
We conclude that the original input hypergraph admits an Euler family.
Note that Algorithm 5.6 performed on runs very similarly, except that Iteration 1 is omitted because has more than one non-empty connected component.
6 Reduction Using Collapsed Hypergraphs
We shall now introduce our second main tool — the collapsed hypergraph — which allows for a binary-type of a reduction.
Definition 6.1
Let be a hypergraph, and a subset of its vertex set with . The collapsed hypergraph of with respect to is the hypergraph defined by
where
Here, is a new vertex, which we call the collapsed vertex of .
We are now ready for our second main reduction theorem, Theorem 6.2, which states that a hypergraph admits an Euler family if and only if some collapsed hypergraphs of (obtained using an edge cut assignment) admit Euler families.
Theorem 6.2
Let be a connected hypergraph with a minimal edge cut , and a partition of into unions of the vertex sets of the connected components of .
Then admits an Euler family if and only if there exists an edge cut assignment such that is even, and either
-
(i)
and has an Euler family for each , or
-
(ii)
, and for each , the collapsed hypergraph has an Euler family that traverses the collapsed vertex via each of the edges in .
Proof. Let be an Euler family of , and the edge cut assignment with if and only if the edge is traversed by via a vertex in and a vertex in (where is possible). By Lemma 4.3(i), the hypergraph has an Euler family as well, say . Since the only edges of that intersect both and are edges of the form with and , it is easy to see that each closed trail in traverses an even number of such edges. Hence is indeed even.
Suppose first that . Then , for each , is a union of connected components of , and hence has an Euler family by Lemma 2.1(ii).
Suppose now that . By symmetry, it suffices to show that has an Euler family that traverses the collapsed vertex via each of the edges in . Let be a closed trail in the Euler family of that traverses an edge , for some . Then has the form
for some vertices and ; for some edges ; and for , for some -trails in and -trails in . Let be the sequence obtained from by replacing each subsequence of the form with . Then is a closed trail in , and it traverses the collapsed vertex via each of the edges of the form for such that traverses . If we additionally define for all closed trails that do not traverse any edges of the form , for some , then it is clear that is a family of closed trails in that jointly traverse each edge exactly once, and also traverse the collapsed vertex via each of the edges in . To obtain an Euler family, we just need to concatenate all those closed trails in this family that traverse the collapsed vertex .
To prove the converse, let be an edge cut assignment such that is even, and either (i) or (ii) holds.
Suppose first that (i) holds. Since , for each , the hypergraph is a union of connected components of , and by Lemma 2.1, since each of and admits an Euler family, so does . By Lemma 4.3(ii), it follows that admits an Euler family.
Suppose now that (ii) holds and . For each , let . By assumption, the collapsed hypergraph admits an Euler family that traverses the collapsed vertex via each of the edges , for . Let be the unique closed trail in that traverses . Then, without loss of generality, must be of the form
for some vertices and, for , some -trails in . (Here, subscripts are evaluated modulo .)
Let be a bijection such that , for all . We thus have that , for all .
We now link the -trails and -trails , for , into a family of closed trails in using the edges , for . In particular, the new closed trails will traverse each edge via anchors and .
Finally, let
Since for each , the closed trails in traverse all edges of that are not traversed by , and the closed trails in traverse all edges of that are traversed by or , as well as all edges in , we conclude that is an Euler family of .
It then follows by Lemma 4.3(ii) that admits an Euler family.
Observe that in the proof of sufficiency in Theorem 6.2 we have no control over the number of closed trails in the family ; hence the analogous result for Euler tours does not hold in general. A weaker result is proved below: necessity is guaranteed by Corollary 6.3, while sufficiency is proved in Corollary 6.4 with an additional assumption on the edge cut assignment. This additional assumption, however, always holds for edge cuts of cardinality at most 3.
Corollary 6.3
Let be a connected hypergraph with a minimal edge cut , and a partition of into unions of the vertex sets of the connected components of .
If admits an Euler tour, then there exists an edge cut assignment such that is even, and either
-
(i)
and, without loss of generality, has an Euler tour and is empty, or
-
(ii)
, and for each , the collapsed hypergraph has an Euler tour that traverses the collapsed vertex via each of the edges in .
Proof. Let be an Euler tour of , and the edge cut assignment with if and only if the edge is traversed by via a vertex in and a vertex in (where is possible). We establish that is even just as in the proof of necessity in Theorem 6.2.
By Lemma 4.3(i), the hypergraph has an Euler tour as well. If , then is disconnected. Hence without loss of generality, has an Euler tour and is empty.
Suppose now that . Following the proof of necessity in Theorem 6.2, we can show that for each , the Euler tour of gives rise to an Euler tour of that traverses the collapsed vertex via each of the edges in .
Corollary 6.4
Let be a connected hypergraph with a minimal edge cut , and a partition of into unions of the vertex sets of the connected components of . Assume that there exists an edge cut assignment such that , and either
-
(i)
and, without loss of generality, has an Euler tour and is empty, or
-
(ii)
, and for each , the collapsed hypergraph has an Euler tour that traverses the collapsed vertex .
Then admits an Euler tour.
Proof. If , then , and since is empty and admits an Euler tour, so does . By Lemma 2.2(ii), it follows that admits an Euler tour.
The case is similar to the proof of sufficiency in Theorem 6.2, assuming Condition (ii). We have . By assumption, for each , the collapsed hypergraph admits an Euler tour that traverses the collapsed vertex , necessarily via the edges , for . Then must be of the form
for some vertices and a -trail in .
Since either or for , linking the -trail and -trail using the edges and clearly results in a closed trail in that traverses all edges of traversed by and , as well as the edges and . We conclude that is an Euler tour of .
By Lemma 4.3(ii), we have that admits an Euler tour.
In Theorem 6.2 and Corollaries 6.3 and 6.4, we seem to be translating the problem of finding an Euler family (tour) to a different problem, namely, of finding an Euler family (tour) that traverses a specified vertex via each of the specified edges. In the next lemma, we show that an algorithm to find the former can be used to find the latter as well.
Lemma 6.5
Let be a hypergraph, , and such that each edge in is incident with the vertex . Construct a hypergraph from as follows: for each edge such that ,
-
•
adjoin a new vertex , and
-
•
replace with edges and .
Then has an Euler family (tour) traversing vertex via each edge in if and only if has an Euler family (tour).
Proof. Let .
Assume is an Euler family of traversing vertex via each edge in . For each closed trail in , obtain a sequence by replacing each subsequence of the form in (where ) with the subsequence , and each subsequence of the form (where ) with the subsequence . It is clear that is an Euler family of .
Conversely, if is an Euler family of , then it must traverse each edge of the form , for , via either the subtrail or the subtrail . For each closed trail , obtain a sequence by replacing each subsequence of the form (where ) with , and each subsequence of the form (where ) with . It is then easy to see that is an Euler family of that traverses vertex via each edge in , as well as via each edge in , as the edges in the latter set are of cardinality 2.
Since in both parts of the proof we have , the statement for Euler tours holds as well.
We shall now describe an algorithm based on Theorem 6.2, Lemma 6.5, and Corollary 2.3 that determines whether a hypergraph admits an Euler family.
Algorithm 6.6
Does a connected hypergraph admit an Euler family?
-
(1)
Sequentially delete vertices of degree at most 1 from until no such vertices remain or is trivial. If at any step has an edge of cardinality less than 2, then has no Euler family — exit.
-
(2)
Let be the graph obtained from by deleting all edges of cardinality greater than 2, and a maximal even subgraph of . Delete all edges of from .
-
(3)
Repeat Steps (1) and (2) as needed.
-
(4)
If is a graph, then it has an Euler family if and only if it is even — exit.
-
(5)
Find a minimal edge cut .
-
(6)
Let , for , be the connected components of .
-
(7)
Find a bipartition of into unions of , for .
-
(8)
For all edge cut assignments :
-
(a)
If is odd — discard this .
-
(b)
If : if and both have Euler families (recursive call), then has an Euler family — exit.
-
(c)
If : if and both have Euler families (recursive call) that traverse the collapsed vertex via each of the edges of the form , for , then has an Euler family — exit.
-
(a)
-
(9)
has no Euler family — exit.
The analogous algorithm for Euler tours, Algorithm 6.7 below, relies on Corollary 6.4 and Lemma 6.5, as well as Theorem 5.3 and Corollaries 5.4 and 2.3. If the hypergraph has no edge cut satisfying the assumptions of Corollary 6.4, then Algorithm 5.6 is invoked.
Algorithm 6.7
Does a connected hypergraph admit an Euler tour?
-
(1)
Sequentially delete vertices of degree at most 1 from until no such vertices remain or is trivial. If at any step has an edge of cardinality less than 2, then is not eulerian — exit.
-
(2)
Let be the graph obtained from by deleting all edges of cardinality greater than 2, and a maximal even subgraph of . For each non-empty connected component of , replace in with the edge set of any cycle on .
-
(3)
Repeat Steps (1) and (2) as needed.
-
(4)
If is a graph, then it is eulerian if and only if it is even and has at most one non-trivial connected component — exit.
-
(5)
Find a minimum edge cut . If , then is not eulerian — exit.
-
(6)
Let , for , be the connected components of .
-
(7)
Let . If , then is not eulerian — exit.
-
(8)
For all bipartitions of into unions of , for
and for all edge cut assignments :-
(a)
If is odd — discard this .
-
(b)
If : if is empty and has an Euler tour, or vice-versa (recursive call), then has an Euler tour — exit.
-
(c)
If : if and both have an Euler tour that traverses the collapsed vertex (recursive call), then has an Euler tour — exit.
-
(a)
-
(9)
Use Algorithm 5.6.
Remarks 6.8
- (i)
- (ii)
-
(iii)
As in Algorithms 5.5 and 5.6 — see Remarks 5.7(iii) — a few adjustments may be necessary to guarantee that Algorithms 6.6 and 6.7 indeed terminate.
For any hypergraph , let and , and call the relevant size of . Since the problem of existence of an Euler family (tour) is computationally easy for graphs (Step (4) in both algorithms), for either algorithm to terminate, it suffices that each recursive call be performed on a hypergraph with or . (Note that the use of Lemma 6.5 in Step (8c) may result in , but as long as , we are still moving in the right direction.) To guarantee such a relevant reduction, we first proceed as described in Remarks 5.7(iii), that is, favouring edge cut assignments that yield , and therefore for all recursive calls.
However, we may need to examine an edge cut assignment that yields . In this case, we know that for all , and the recursive call involves (for ). Clearly, , but suppose that and (in other words, ). This situation may arise when Lemma 6.5 has been invoked or is small.
If there exists such that , then and for some vertex . For each , we then let and . Note that , and it is easy to see that admits an Euler family (tour) if and only if at least one such hypergraph does. Hence, if necessary, we test all such hypergraphs .
Otherwise, it must be that for all , and as Lemma 6.5 was not invoked. Fix any , and let . For each , we then let , , and . Note that , and again it is easy to see that admits an Euler family (tour) if and only if at least one such hypergraph does.
-
(iv)
In Step (8) of Algorithm 6.7, we examine all bipartitions of to maximize the chance of finding an edge cut assignment such that . Observe that for a given edge cut such that has exactly connected components, the number of bipartitions is , and the number of edge cut assignments is at most . Hence the loop at Step (8) of Algorithm 6.7 will be executed at most times.
-
(v)
For suitable bipartitions , we expect that the reduction at Step (8) in both algorithms is the most efficient (that is, the number of recursive calls is minimized) if and are as equal as possible.
Example 6.9
We shall now demonstrate Algorithm 6.6 using the same hypergraph as in Example 5.8; that is, hypergraph with and . The main hypergraphs in the procedure are shown in Figures 3 and 4. We use the same symbols as in Figure 2; in addition, the collapsed vertices are shown in grey, and new vertices are labelled . New edges arising from the use of Lemma 6.5 are drawn in the same style as their parent edges, just thinner. Note that some minor details are omitted for brevity.
Iteration 0. The input hypergraph is , and as in Example 5.8, we start by choosing a minimal edge cut , so has connected components , and with vertex sets , , and . We then choose the bipartition with and , and first examine the edge cut assignment with (Iteration 1), and then (Iteration 2).
Iteration 1. We have . As , we need to test its subhypergraphs and (Iterations 1.1 and 1.2, respectively).
Iteration 1.1. The input hypergraph is . We choose a minimal edge cut . The hypergraph has connected components and , with vertex sets and , so our bipartition is with and . The only edge cut assignment with even is defined by , which yields . As , we need to test (Iteration 1.1.1) and (Iteration 1.1.2).
Iteration 1.1.1. We have . This is an even graph, so it admits an Euler family traversing the collapsed vertex .
Iteration 1.1.2. We have , with being the collapsed vertex. To ensure its traversal, we use Lemma 6.5, modifying the hypergraph to . As the size of the hypergraph has increased from Iteration 1.1, while the relevant size remained the same, we replace the edge with (see Remarks 6.8(iii)), which results in an even graph. This successfully completes Iteration 1.1.
Iteration 1.2. The input hypergraph is rejected in Step (1). Iteration 1 is thus completed, but unsuccessfully.
Iteration 2. We have . As , we need to test (Iteration 2.1) and (Iteration 2.2).
Iteration 2.1. The input hypergraph is , with being the collapsed vertex. To ensure its traversal, we use Lemma 6.5, modifying the hypergraph to . We choose a minimal edge cut . The hypergraph has two connected components, yielding a single bipartition , with and . We choose the edge cut assignment with , which results in . As , we need to test (Iteration 2.1.1) and (Iteration 2.2.2).
Iteration 2.1.1. The input hypergraph is (again) , with being the newly collapsed vertex. To ensure its traversal, we use Lemma 6.5, modifying the hypergraph to . We observe that this hypergraph is identical to from Iteration 2.1. Hence we perform an adjustment as advised in Remarks 6.8(iii), replacing the edge with .
We then choose a minimal edge cut , resulting in the bipartition , with and . The only edge cut assignment with even is defined by , which yields . As , we need to test (Iteration 2.1.1.1) and (Iteration 2.1.1.2).
Iteration 2.1.1.1. The input hypergraph is , with being the newly collapsed vertex. To ensure its traversal, we use Lemma 6.5, modifying the hypergraph to . We choose a minimal edge cut . The only possible bipartition is , with and , and the only edge cut assignment with even is defined by , resulting in . We thus need to test (Iteration 2.1.1.1.1) and (Iteration 2.1.1.1.2).
Iteration 2.1.1.1.1. The input hypergraph is (again) , with being the newly collapsed vertex. To ensure its traversal, we modify the hypergraph to , and observe that this hypergraph is identical to from Iteration 2.1.1.1. Hence we perform an adjustment (see Remarks 6.8(iii)), replacing the edge with .
Iteration 2.1.1.1.1.1. The input hypergraph is . In Step (1), vertex 1 is deleted, resulting in the even graph . This successfully completes Iteration 2.1.1.1.1.
Iteration 2.1.1.1.2. The input hypergraph is , with being the newly collapsed vertex. As is an even graph, it admits an Euler family that traverses the collapsed vertex. Iteration 2.1.1.1 is thus successfully completed.
Iteration 2.1.1.2. We have , where is the newly collapsed vertex. Again, is an even graph, thus admitting an Euler family that traverses the collapsed vertex. Hence Iteration 2.1.1 is successfully completed.
Iteration 2.1.2. Identical to Iteration 2.1.1.2., successfully completing Iteration 2.1.
Iteration 2.2. The input hypergraph is , with being the collapsed vertex. To ensure its traversal, we first modify the hypergraph to . We then choose a minimal edge cut . The hypergraph has three connected components, and we choose a bipartition , with and . Furthermore, we choose the edge cut assignment with . As and is empty, we only need to test (Iteration 2.2.1).
Iteration 2.2.1. We have , which is an even graph. This successfully completes Iterations 2.2 and 2.
We conclude that the original input hypergraph admits an Euler family.
Note that Algorithm 6.7 performed on runs very similarly, except that Iteration 1 is omitted because has more than one non-empty connected component.
7 Conclusions
In this paper, we proved several results showing that, using an edge cut of a hypergraph , the problem of existence of an Euler family (tour) in can be reduced to the analogous problem in smaller hypergraphs derived from . These results led to Algorithms 5.5 and 6.6 for finding Euler families, and Algorithms 5.6 and 6.7 for finding Euler tours. We shall now compare the two algorithms in each pair.
Remarks 7.1
Comparison of Algorithms 5.5 and 6.6.
- (i)
- (ii)
- (iii)
-
(iv)
Constructing an arbitrary bipartition in Algorithm 6.6 takes a negligible amount of time; however, if we wish to find a bipartition that, as much as possible, equalizes and — see Remark 6.8(v) — then we may need to search through all bipartitions, and this step may increase the time complexity of Algorithm 6.6.
-
(v)
In Algorithm 5.5, the recursive calls use as the input the connected components of , while in Algorithm 6.6, the two collapsed hypergraphs need to be constructed first, and then (if contains edges of cardinality at least 3) further modified using Lemma 6.5. These operations, however, do not increase time complexity.
- (vi)
Remarks 7.2
Comparison of Algorithms 5.6 and 6.7.
- (i)
- (ii)
-
(iii)
In the worst case, the main loop in Algorithm 5.6 requires iterations (see Remark 5.7(v)), while the main loop in Algorithm 6.7 requires iterations (see Remark 6.8(iv)). If , then the two numbers are the same; however, assuming is bounded, the number of iterations in Algorithm 6.7 grows much faster with .
- (iv)
-
(v)
In Algorithm 5.6, a recursive call happens only with a hypergraph that is the unique non-trivial connected component of , hence its size is close to the size of (but we expect that the number of edge cut assignments requiring a recursive call will be small). In Algorithm 6.7, the expected size of is either very close to (if Step (8b) applies) or approximately (if Step (8c) applies).
-
(vi)
For an overall comparison of time complexities, let and denote the time complexity functions of Algorithms 5.6 and 6.7, respectively, where . To facilitate the comparison, we shall assume that at any step of the algorithm (including recursive calls) we have and for some constants and , and that in any recursive call, we have for some constant . In addition, we assume that Step (9) of Algorithm 6.7 is never reached. With these assumptions, we have
and
Thus, and are both polynomial in ; however, which of the polynomial orders is smaller depends on the relationship between and . Roughly speaking, is smaller when is larger than , while is smaller when is much larger than .
Acknowledgement
The first author gratefully acknowledges support by the Natural Sciences and Engineering Research Council of Canada (NSERC), Discovery Grant RGPIN-2022-02994.
References
- [1] M. A. Bahmanian and M. Šajna, Quasi-eulerian hypergraphs, Electron. J. Combin. 24 (2017), #P3.30, 12 pp.
- [2] M. A. Bahmanian and M. Šajna, Connection and separation in hypergraphs, Theory Appl. Graphs 2 (2015), no. 2, Art. 5, 24 pp.
- [3] J. A. Bondy, U. S. R. Murty, Graph theory. Graduate Texts in Mathematics 244, Springer, New York, 2008.
- [4] C. Chekuri, C. Xu, Computing minimum cuts in hypergraphs, Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms (2017), 1085–1100.
- [5] Z. Lonc, P. Naroski, On tours that contain all edges of a hypergraph, Electron. J. Combin. 17 (2010), # R144, 31 pp.
- [6] Y. D. Steimle, M. Šajna, Spanning Euler tours and spanning Euler families in hypergraphs with particular vertex cuts, Discrete Math. 341 (2018), 2808–2819.