A method for ﬁnding all connections in the Pantelides algorithm for delay differential-algebraic equations

: The Pantelides algorithm for systems of delay differential-algebraic equations (DDAEs) is a method to structurally analyse such systems with the goal to detect which equations have to be differentiated or shifted to construct a solution. In this process, one has to detect implicit connections between equations in the shifting graph, making it necessary to check all possible connections. The problem of ﬁnding these efﬁciently remained unsolved so far. It is explored in further detail and a reformulation is introduced. Additionally, an algorithmic approach for its solution is presented.


Introduction
Delay differential-algebraic equations (DDAEs) are a class of differential equations for a function x : R → R n on a time interval [0, T ) ⊆ R, T > 0, that, in their simplest form, not only depend on the time derivativeẋ(t ) but also on a previous time state ∆ −τ x(t ) := x(t − τ) with a delay τ > 0. Additionally, the system may possess algebraic constraints such that it can only be formulated in implicit form. Here, the DDAE is assumed to be a system of n ∈ N equations F = (F 1 , ..., F n ) and variables x = (x 1 , ..., x n ). Thus, consider a DDAE of the form where with D x , Dẋ , D ∆x ⊆ R n open. Here,ẋ denotes the derivative of x with respect to t from the right. To obtain an initial value problem, (1) has to be equipped with a consistent initial condition Equations of this form arise in many applications, such as multibody control systems, electric circuits or fluid dynamics (see [7,18]). They combine features of delay differential equations (DDEs) and differentialalgebraic equations (DAEs), which makes them particularly difficult to solve. Solutions may depend on derivatives of F and on evaluations of F at future time points (see [5,9]). Therefore, the interplay of the differentiation operator d dt and the shift operator ∆ −τ has to be treated carefully (cf. [11]) and solutions have to be constructed by differentiating and shifting equations (cf. [5,9,10,11,15,16]). Even for linear DDAEs, general existence and uniqueness results can only be obtained using a distributional solution concept (see [15,18]) or imposing further restrictions on the DDAE (see [9,10,16]) or its initial function in eq. (2) (see [8,16]). For nonlinear DDAEs, the existence of solutions can be established for certain classes (cf. [2,17]).
In most cases, the construction of a solution for a DDAE involves the method of steps. This means that the equation is successively integrated over the time intervals [i τ, (i + 1)τ), i ∈ N. By substituting the delayed variables with the already computed solution of the previous interval, the problem can be reduced to solve a DAE in each step (cf. [3,4,10]). However, this method does not always succeed and a reformulation of eq. (1) is required such that the DAE that has to be solved in each interval is regular and has a small index. Hereby, the index is, roughly speaking, a measure of how often parts of the DAE have to be differentiated to reformulate the DAE as an ordinary differential equation. This reformulation can be done by a compress-and-shift algorithm (see [5,15]) or by a combined shift and derivative array (see [10]). The differentiation and shifting of certain equations is necessary in both cases.
Determining which equations one has to differentiate or shift is therefore a central aspect of the solution process of a DDAE. In [1], the Pantelides algorithm for DDAEs is presented as a tool to exploit the structure of (1), i.e., the information about which variable appears in which equation, to determine the number of differentiations and shifts necessary to solve the DDAE. It is based on the Pantelides algorithm for DAEs (see [14]) and will be simply referred to as Pantelides algorithm from now on. The approach consists of defining different bipartite graphs, where each equation and certain equivalence classes of variables are represented by the nodes. Edges exist between equation nodes and variable nodes if and only if one of the variables of the equivalence class appears in that equation. In other words, the graphs represent the structure of the DDAE. Then, matchings between equation nodes and variable nodes of highest shift and differentiation order are constructed in these graphs. This is achieved by following a specific pattern of shifting and differentiating equations and the variables belonging to it. At the end of the process, each equation can be resolved for a variable of highest shift and differentiation order. For more details on the whole procedure and the algorithm, see the original paper [1].
In this work, the focus is put on a specific subproblem that appears in the Pantelides algorithm. During the first part of the algorithm, called the shifting step, one has to shift equations that are connected to each other in a certain way through edges in a specific graph, called the shifting graph. Generally, such a connection is not unique and all possible connections have to be found to allow for correct shifting. The identification of all of these connections, however, may be computationally very expensive, and no efficient algorithmic solution is known so far.
The contribution of this paper is a deeper exploration of the problem of finding all connections. First, the problem is explained in further detail and all important preliminaries are given in Section 2. Then, a new solution approach is proposed based on the reformulation to a known enumeration problem from graph theory. The equivalence of both problems is proven (Section 3). Additionally, an algorithm from [6] for the solution of the enumeration problem is presented (Section 4). This algorithm is applied to the original problem, yielding a method for finding all connections in the Pantelides algorithm, and two detailed examples of its usage are given (Section 5). Finally, a numerical demonstration of the advantageous properties of the new method is shown (Section 6) and the paper is concluded with a summary and some final remarks (Section 7).

Notation:
The natural numbers, the non-negative integers, and the reals are denoted by N, N 0 and R, respectively. For a differentiable function f : I → R n , the notationḟ := d dt f is used to denote the derivative with respect to the (time) variable t andf := d d tḟ for the second derivative. For higher derivatives of order q ∈ N 0 , the abbreviation f (q) is used. Similarly, the shift operator ∆ τ is defined as ∆ τ f (t ) = f (t + τ). The union of two sets A and B is denoted by A∪B . A disjoint union of sets is written as A∪B . The cardinality of the set A is denoted by |A|.

Problem description
This section describes the overall problem of the paper in detail and introduces the most important definitions to give all preliminaries needed to understand the solution approach. Since this paper can be seen as an extension of [1], most information of this section is based on that work and all derivations can be found there. In comparison, new concepts (which are not used in [1]) are introduced in Sections 3 and 4 and include Definition 5, Definition 6, Definition 9, and Definition 14, as well as results based on those. The Pantelides algorithm translates the structural information of the DDAE into graphs. First, the shifting graph G S is constructed by combining all variables of the same index k (for each k = 1, ..., n) and shift order p ∈ N 0 ∪ {−1} (but possibly different differentiation order) into the same equivalence class, i.e., Then, one can define the set of equation nodes, variable nodes, and edges as appears in DDAE for any q ∈ N 0 , respectively, which yields the shifting graph defined as G S := (V S E∪ V S V , E S ). Note that although writing the equivalence classes in the form [∆ pτ x k ] makes the notation more compact, the members of the equivalence classes will be given explicitly in set form to enhance comprehension for the reader in the examples throughout this paper.  Then, the shifting graph is given as G S := (V S E∪ V S V , E S ). In Figure 1, an illustration of the graph can be found.
In the bipartite shifting graph, one successively assigns to each equation node F i ∈ V S E an equivalence class v k ∈ V S V of highest shift, i.e., if v k = [∆ pτ x k ] is of   If a particular F j cannot be matched to a variable node that is not in M yet, the node F j is called exposed with respect to M . The corresponding equation is shifted, together with all other equations that F j is connected to via alternating paths with respect to M in G S . An alternating path with respect to M is a sequence of edges  Simply shifting all connected equations may not be sufficient, since the connection may be given only implicitly through the equivalence classes of the variable nodes. To see this, define G := (V E∪ V V , E ) as the graph of the DDAE with V E := F 1 , ..., F n , In other words, the graph of the DDAE contains all variables explicitly as distinct nodes without using equivalence classes. An implicit connection in the shifting graph means that the involved equations contain variables with the same shift but a different differentiation order. Thus, they belong to the same variable node in the shifting graph but not to the same node in the graph of the DDAE. There is an alternating path connecting the exposed equation F j and the equation that has to be shifted in G S but not in G. In this case, an explicit connection has to be established by differentiating the involved equations that do not depend on the highest derivative in the equivalence class. To ensure that all implicit connections are resolved, all possible connections have to be identified and checked.
A visualization is shown in Figure 2d.
Since F 3 is exposed with respect to the matching in the shifting graph (Figure 2a), all possible connections for F 3 with respect to M have to be found. These are given by the alternating paths presented in Example 3, i.e., Figure 2b) and Figure 2c). One can see that connection C 1 does also exist in G via the path  and hence, is an explicit connection. However, C 2 is implicit, as the alternating path {F 3 , {x 1 ,ẋ 1 }}, {{x 1 ,ẋ 1 }, F 1 } does not connect F 3 and F 1 in G. One has to differentiate F 3 to establish an explicit connection. It can be seen that checking one connection is not enough, all have to be identified to resolve possible implicit connections in the shifting graph.
Theoretically, one could identify all connections by just checking all possible combinations of edges of E S that yield alternating paths. In practice, however, this approach is not feasible, because the amount of combinations increases rapidly with the number of nodes and edges of the graph G S . By reformulating the problem, it can be solved much more efficiently.

Reformulation of problem
First, a connection has to be technically defined. To simplify the notation, let G = (V E∪ V V , E ) be a bipartite graph with equation nodes V E and variable nodes V V , where E contains only edges between V E and V V , not between nodes of one set. Further, let a matching be given in G with M < n and F j ∈ V E as an exposed equation node with respect to M . Then, between F j and F k in G denotes the equation nodes that are connected to F j via an alternating path. This set is automatically generated by the algorithm Augmentpath (see [ and M a matching in G. Further, let F j ∈ V E be exposed with respect to M and C F j as defined above. A connection for F j with respect to M is defined as a set of connected alternating paths ( Additionally, it has to hold that for all F ∈ C F j the corresponding matching edge {v k , F } ∈ M occurs exactly once and there is at least one alternating path starting in F j .
Note that the definition of a connection for F j with respect to M has been changed in comparison to the definition from [1, p.18]. That is reasonable because the previous definition is not sufficient and allows sets of alternating paths that contain cycles and not necessarily the exposed node F j , two aspects that do not make sense in this context. Therefore, the definition was expanded to exclude these cases. In the forthcoming Corollary 13, it is shown that a connection in the sense of Definition 5 is indeed cycle-free. Also, a connection for F j with respect to M will simply be referred to as a connection when it is clear which node is exposed and which matching the connection is based on.
With the exact definition of a connection, one can further define the connection graph by interpreting the alternating paths from this definition as directed edges between the equation nodes. Definition 6. Let G = (V E∪ V V , E ) be a bipartite graph and M a matching in G. Further, let F j ∈ V E be exposed with respect to M and C F j as defined above. Define the set of nodes V H := C F j∪ {F j } and directed edges Then, the directed graph H : it might seem as if information is lost about which variable node v k connects the equation nodes F i and F . However, since each F is uniquely matched to one v k in M , the variable node can easily be reconstructed from the directed edge (F i , F ) using M . A second approach to not lose information is to define edge weights w i = k for the edges ( Similar to before, the connection graph for F j with respect to M will be referred to simply as connection graph when it is clear which node is exposed and which matching the connection graph is based on. A picture of H can be seen in Figure 3. The connection graph facilitates to reformulate the problem of finding all connections in the sense of Definition 5 by transferring it from the shifting graph to the connection graph. It translates to finding all spanning trees (defined below) with root F j in H . To prove this, some definitions and lemmas from graph theory are needed (see [12, p.71-73] for reference and proofs; note that the term arborescence in [12] has been changed to spanning tree for consistency with the rest of the paper). The underlying undirected graph of a spanning tree has to be a connected forest, i.e., a tree. According to Lemma 10, a spanning tree with n nodes thus has n − 1 edges and, according to Definition 9, every node has at most one edge ending in it. Therefore, there is exactly one node r with no incoming edge. Let δ − (v) be the set of incoming edges of a vertex v of G. Then, this condition can be formulated as δ − (r ) = . In this case, r is called root of the spanning tree. For any edge (u, v) of a spanning tree, v is called a child of u and u the predecessor of v. Vertices with no children are called leaves (see [12, p.73]).

Lemma 11.
[12, Theorem 6.23, p.73] Let G be a directed graph with n vertices and r a vertex of G. Then, the following statements are equivalent: i) G is a spanning tree with root r . ii) G is a branching with n − 1 edges and δ − (r ) = .
iii) δ − (r ) = and there exists a uniquely determined directed path from r to every vertex in G.
be a bipartite graph, M a matching in G, F j ∈ V E exposed with respect to M , and H = (V H , E H ) the connection graph for F j with respect to M . Then, the following statements are equivalent: i) The set It follows that H u has |V H | − 1 edges. According to Definition 5, the alternating paths (F i , v k , F ) ∈ C are connected and each F ∈ C F j occurs exactly once. The variable nodes v k are uniquely determined by the equation nodes F via the matching M . This implies that each v k m , for m = 1, ..., M , also occurs only once in C and the alternating paths must be connected via the equation nodes F i and F . Thus, the edges in E u are connected and thereby, H u is connected as well.
In summary, H u has |V H | − 1 edges and is connected. Therefore, according to Lemma 10, the underlying undirected graph of H is a tree (and also a forest). Additionally, V H = C F j∪ {F j } and it was already mentioned that each F ∈ C F j occurs exactly once as second equation node in the alternating paths (F i , v k , F ) ∈ C . The node F j itself has no alternating path leading to it because it is exposed. Therefore, every node of H has at most one edge ending in it. According to Definition 9, the graph H is a branching and, as mentioned above, it has |V H | − 1 edges.
Finally, one can choose the exposed node F j as the root of H because δ − (F j ) = . By Lemma 11, it follows that H is a spanning tree with root F j . ii H be a spanning tree with root F j , and denote Since H is a subgraph of the connection graph for F j with respect to M , it follows that all ( where v k is uniquely determined by the matching M (see Definition 6 and Remark 7). From Lemma 11, it is known that the root F j of the spanning tree is a vertex of H with δ − (F j ) = and, therefore, is also included as the starting node in an alternating path from C . Additionally, there exists a uniquely determined directed path from the root F j to every vertex in H . Thus, the same property applies to the alternating paths in C , which yields that they are connected and each F ∈ C F j occurs exactly once as final node of an alternating path. Hence, C fulfills all properties of a connection for F j with respect to M . Proof. The proof follows directly from Theorem 12, using the equivalence of a connection for F j with respect to M to a spanning tree in the connection graph for F j with respect to M . Spanning trees are by Definition 9 cyclefree.
In the literature (e.g., [6,12]), a spanning tree of a directed graph is also referred to as an arborescence. The sort of problem where all possible solutions to a computational problem have to be computed and explicitly returned as an output is called enumeration problem. Methods for solving these problems are called enumeration algorithms.
With Theorem 12, a reformulation of the initial problem (finding all connections) has been derived by showing that it is equivalent to the problem of enumerating all spanning trees in the corresponding connection graph. Each spanning tree can then be interpreted as a connection. There are efficient algorithms to solve this enumeration problem, one of which is discussed in the next section.

Enumeration of spanning trees
One enumeration algorithm for finding all spanning trees of a directed graph was published in [6]. It turns out to be an effective method for the purpose of this work and is therefore implemented in the (overall) Pantelides algorithm to solve the subproblem of finding all connections. In this section, a short summary is given of how this algorithm works. For further details of the implementation as well as theoretical results and their proofs, see [6].
First, the important concept of so-called bridges has to be introduced.

Definition 14.
[6, p.280] Let G = (V, E ) be a directed graph and r ∈ V a vertex. i) G is called rooted at r if there exists a spanning tree with root r in G. ii) An edge e ∈ E is called a bridge for r if G is rooted at r but G \ {e} is not rooted at r . iii) Equivalently, an edge e ∈ E is a bridge for r if it is part of every spanning tree rooted at r in G.
Assume a directed graph G = (V, E ) and a root vertex r are given and all spanning trees of G rooted at r have to be computed. This goal is accomplished by finding all spanning trees containing different subtrees T ⊆ G, also rooted at r .
Given a subtree T , the approach consists of successively adding edges to T in the following way: A new edge e i := (u, v) ∈ E , directed from a vertex u ∈ T to a vertex v ∉ T , is added to T , and all spanning trees containing T ∪{e i } are computed. When this is done, the edge e i is deleted from G and T and another edge e j ∈ E \ {e i } (directed from T to a vertex not in T ), is added to T . Again, all spanning trees containing T ∪ {e j } are computed, then e j is deleted from G and T . The same process continues with the next edge and is repeated until an edge is processed that is a bridge for r in the modified graph G \{e i , e j , ...}. Each spanning tree containing T has now been found exactly once.
A key point in this approach is to discover efficiently if an edge e is a bridge. Assume all spanning trees containing T ∪ {e} have been computed and let L be the last found spanning tree. It has to be checked if e := (u, v) is a bridge.
There are several possibilities. The idea that is pursued in this algorithm is to consider the descendants and nondescendants of v in L. Descendants of v in L are vertices that can be reached following a directed path starting in v and using only edges of the spanning tree L. Contrary, nondescendants of v in L are vertices for which there cannot be constructed such a path using edges from L.
Clearly, if there is an edge in G \ {e} that goes from a nondescendant of v (in L) to v, then e cannot be a bridge, since one could delete e and replace it with that edge to construct another spanning tree. Thus, G \ {e} is still rooted at r and e could not have been a bridge. On the other hand, if no edge that goes from a nondescendant of v in L to v can be found, e must be a bridge, because deleting e leads to a graph G \ {e} where there does not exist a path to vertex v anymore.
For this to hold true, the way edges are added plays an important role. Here, the algorithm adds edges depthfirst. The depth of a vertex contained in a tree is the length of the path between the vertex and the root of the tree it is contained in. Thus, adding an edge depthfirst means that it is added to the vertex of T ∪ {e} that has the greatest depth possible, i.e., that has the greatest distance from the root node. Particularly, this ensures that the last computed spanning tree that contains T ∪ {e} (namely the tree L) has the fewest descendants of v amongst all spanning trees containing T ∪ {e}. This fact can be used to prove that this bridge test works correctly (see [6, Lemma 2, p.284] for more details).
Thus, it is important for the implementation to grow T depth-first. To do so, a stack F is used, where edges are stored that are directed from vertices in T to vertices not in T . Note that the action of removing an element from the top of a stack is referred to as popping, whereas the action of adding an element to the top of a stack is referred to as pushing. An edge e := (u, v) is always popped from the top of F if it is added to T and then, outgoing edges from v (that are not directed to vertices already contained in T ∪ {e}) are pushed onto the top of F . Also, some edges might be removed from the inner part of F while growing T . This is necessary for all edges in F that are directed to v, the newest leaf of T . To ensure the depth-first property, these edges have to be restored at the exact same place in F after all spanning trees containing T ∪ {e} have been found.
A second stack F F is used to store already processed edges since they are temporarily deleted from G but have to be restored later.
The full algorithm is stated in Algorithm 1. Note that the pseudo code uses MATLAB notation for indexing, i.e., array indexing begins at 1 and the index "end" of an array points to the last element of it or to the top of a stack. The symbol " " indicates a comment in the code. Algorithm 2 illustrates how to initialize the method.
To conclude this section, the complexity of the algorithm is stated. For a directed graph G = (V, E ) that has N spanning trees, the time complexity is O(|E |N ) and the space or memory complexity is O(|E |) (see [6,Lemma 4,p.285]). Next, it is shown how to use this method in the Pantelides algorithm.

Algorithm for computation of connections
The enumeration algorithm from the previous section has to be applied to the initial problem of finding all connections. This would replace the computation stated in line 1 of Algorithm 3 from [1, p.20]. Thus, transferring the notation, the shifting graph G S = (V S E∪ V S V , E S ), the exposed equation F j ∈ V S E and the matching M are given. It has been shown that finding all connections for F j with respect to M is equivalent to enumerating the spanning trees with root F j in the connection graph for F j with respect to M . Therefore, the connection graph H is constructed according to Definition 6 and used as input to Algorithm 2, together with F j as the root r . All spanning trees in H are returned. Given a spanning tree, one can reconstruct the corresponding connection by taking its edges (F i , F ) and inserting into each directed edge the variable node that was assigned to the equation node F by M . That yields a set of alternating paths (F i , v k , F ) as desired. The method is summarized in Algorithm 3.
To illustrate the new method, a simple and a slightly more complex example are given in the following.
restore in same place as before 16: Algorithm 3 Find all connections for F j with respect to M Input: shifting graph G S = (V S E∪ V S V , E S ), exposed node F j ∈ V S E , matching M stored in assign, colorE, colorV Output: set of all connections P construct connection graph 5: P ← Algorithm2(H , F j ) enumeration algorithm 6: for all T = (V T , E T ) ∈ P do 7: T ← E T replace spanning trees by connections 8: for all e = (F i , F ) ∈ T do 9:

It is given as
and is visualized in Figure 3.
Hence, one defines G := H and r := F 3 as the input to Algorithm 2 and enumerates all spanning trees of G rooted at r . To initialize the process, set and execute Algorithm 1.
The recursion process of Algorithm 1 can be visualized by the tree structure in Figure 4. Note that the nodes of the computation tree will be called bisections and the edges arrows to not confuse them with the nodes and edges of T or G. In general, the notion of the tree is as follows: each bisection represents the current subgraph T ⊆ G, indicated by its edges E T . As described in Section 4, one then adds an edge e ∈ G from the stack F to T and computes all spanning trees containing T ∪ {e}. Adding an edge e is represented by an arrow pointing away from a bisection, i.e., if and e = (F i m+1 , F m+1 ) is added, then this is visualized in the computation tree by an arrow pointing from Thus, the computation of all spanning trees containing T , or T ∪ {e}, is represented by the subtree (of the computation tree) rooted at the bisection representing T , or T ∪ {e}, respectively. The arrows pointing away from T are, from left to right, all edges from the stack F that are added to T . Also, remember that after the computation of all spanning trees containing T ∪{e}, it has to be checked if e is a bridge. If it is not, e is deleted from T and G. This is depicted by the red arrows pointing to the bisection that represents the addition of the next edge, together with the corresponding label indicating which edge is deleted. If it is a bridge, then all spanning trees containing T have been found and that iteration comes to an end. This is similarly depicted by a red arrow pointing to "END". Finally, each leaf in the lowest level of the computation tree is a complete and unique spanning tree.
In the case of the present example and as stated above, one starts with T containing no edge (E T = ) and pops the last element from F to add it to T , yielding e = (F 3 , F 1 ), As all spanning trees containing T shall be computed, one pops the next edge from F , here (F 3 , F 2 ). This results in e = (F 3 , F 2 ), The tree T is now a complete spanning tree as it has n −1 (here, n = 3) edges. Thus, one sets L = T and tests if e = (F 3 , F 2 ) is a bridge. The nondescendants of F 2 in L are F 3 and F 1 , and there is no edge in G that goes from a nondescendant of F 2 to F 2 besides e itself. Consequently, e is categorized as a bridge and indeed, all spanning trees containing the subtree with E T = {(F 3 , F 1 )} have been computed. The iteration ends and the algorithms returns to the setting of (4). Doing the bridge test here reveals that e = (F 3 , F 1 ) is not a bridge, since L remains unchanged and there exists the edge (F 2 , F 1 ) in G where F 2 is a nondescendant of F 1 in L. Therefore, the edge (F 3 , F 1 ) is deleted from G and T and the next iteration begins, meaning that the next edge from F is added to T : Again, all spanning trees containing T have to be computed and the next edge is popped from F , resulting in e = (F 2 , F 1 ), The tree T is a new and distinct spanning tree. One sets L = T and a test reveals that e is a bridge: F 3 is the only nondescendant of F 1 in L that does not belong to e itself, and the edge (F 3 , F 1 ) was just deleted from G, so it does not exist anymore in the current graph (although it will be restored later). All spanning trees containing the subtree with E T = {(F 3 , F 2 )} have been found. The current iteration is terminated and the algorithm returns to the iteration with the setting (5). Here, one checks if e = (F 3 , F 2 ) is a bridge and again, it is. The edge e is the only edge leading to F 2 in G. Hence, this iteration ends as well, which means that all spanning trees containing the subtree with E T = have been computed successfully, or in other words, all spanning trees existing in G. The original graph G is restored (i.e., the edge that was deleted, (F 3 , F 1 ), is added once again to G), the whole algorithm terminates and returns One can easily check by hand that these two spanning trees are the only ones existing in G.
Finally, the result, still in tree structure, has to be converted back to a set of connections. Inserting the variable nodes stored in the matching M gives By comparing P to Figure 2b and Figure 2c, it can be seen that the algorithm successfully determined all desired connections for F 3 with respect to M .  The shifting graph, after assigning {x 1 ,ẋ 1 } to F 1 , {x 2 ,ẋ 2 } to F 2 and {x 3 ,ẋ 3 } to F 3 , is shown in Figure 5a. The equation F 4 is exposed and cannot be matched directly to any equivalence class, but it is connected via alternating paths to all other equation nodes. Therefore, it holds that  The computation tree that represents the recursion structure of Algorithm 1 can be seen in Figure 6. Similarly to the last example, one can follow the different paths in the tree to retrace the construction of subtrees T by addition and deletion of edges e.

Example 16. Consider the DDAĖ
Note that even though F is initialized with all three edges outgoing from F 4 , the algorithm already terminates after the first iteration where all spanning trees containing the subtree with E T = {(F 4 , F 1 )} are computed. This is due to the fact that after deleting (F 4 , F 1 ) from G, there is no edge leading to F 1 anymore, and hence it is not possible to construct another spanning tree. The following eight spanning trees are returned:  Indeed, all possible connections for F 4 with respect to M have been found.

Numerical demonstration
The developed algorithm presented in this paper has been implemented to empirically demonstrate its effectiveness. Also, a naive depth-first method is used to compute connections in order to estimate the efficiency of the new algorithm in terms of computational complexity. The depth-first method works as described in [13, p.19]. However, it does not stop once a spanning tree is found but stores it and continues searching for other spanning trees by trying all possible combinations of edges. All computations are performed using MAT-LAB R2021a on a laptop with the processor Intel CORE i5-6267U CPU @2.90GHz (4 CPUs), ∼2.8GHz.
For simplicity, a shifting graph G S = (V S E∪ V S V , E S ) is assumed to be given where only the variable nodes v k ∈ V S V of highest shift exist for k = 1, ..., n − 1 (i.e., all other variable nodes have already been deleted) and each F i ∈ V S E is matched to v i , for i = 1, ..., n − 1. Thus, F n is exposed with respect to the matching Three different scenarios are tested. To illustrate the edge structures E S of the corresponding shifting graphs, let A ∈ R n×(n−1) be a matrix with entries First, a shifting graph is constructed such that i.e., each equation node F i , for i = 1, ..., n − 1, is connected to at most three variable nodes and F n is connected to each v k , for k = 1, ..., n − 1. The computation times for shifting graphs of this structure for different n ∈ N can be seen in Table 1. In all tables, "DFS" is the abbreviation for "depth-first search" and N denotes the number of possible connections. Some computations have been stopped after 10 minutes of computing time, which is indicated by "> 600". In these cases, computations for even higher n have not been executed. This is marked as "-" in the tables. In a second test, a scenario is created such that i.e., each equation node F i , for i = 1, ..., n − 1, is connected to n −i variable nodes and F n is again connected to each v k , for k = 1, ..., n −1. The computation times for shifting graphs of this structure can be seen in Table 2. For the third scenario, a complete graph is assumed, where each equation node is connected to all variable nodes, i.e., The computation times are listed in Table 3. The results clearly show the advantage of Algorithm 3 as it is strongly superior in terms of computation time. For all scenarios, the depth-first search algorithm is only competitive for very small system sizes n, before its computation time suddenly explodes. This has a simple reason: by naively testing all possible combinations of edges, an extreme amount of possibilities arises. Even more, the majority of connections computed by the depth-first search algorithm are duplicates, meaning that they possess the same alternating paths in different order. All of these have to be identified and deleted after the algorithm terminates. Algorithm 3, however, does not have this problem, as only unique spanning trees (and thus, connections) are computed. Therefore, it scales well with the number of possible connections N and has a huge advantage in terms of computational complexity. Nevertheless, one can also see that the problem itself is very demanding, because N increases rapidly with the system size n and already for relatively small n, one cannot compute all connections in a reasonable time anymore. There are just too many in the case of dense graphs.

Conclusion
In this work, the problem of finding all connections in the shifting step of the Pantelides algorithm for DDAEs from [1] has been discussed. A new method, based on on the reformulation of the problem into the problem of enumerating all spanning trees (or arborescences) in a directed graph, has been developed. This directed graph is constructed with the alternating paths of the shifting graph and is called connection graph. The equivalence of the solutions to these two problems has been proven in Theorem 12. That led to the possibility to exploit the fact that there already exist efficient methods to solve the enumeration problem. By introducing and implementing the method from [6], Algorithm 3 has been introduced to compute all connections in the shifting graph. Its effectiveness for the problem at hand has been shown by giving theoretical examples and its efficiency has been demonstrated by an implementation and numerical tests.
However, it was evident that the presented method is limited to small scale problems. There are several reasons for that. First, the enumeration algorithm uses a rather expensive system to add, delete and restore edges as well as to manage the different stacks of edges. The development of more efficient enumeration algorithms could improve the method in terms of computational complexity. Second, the problem of finding all connections itself scales really badly to larger system sizes as the pure number of existing connections grows exponentially with n for densely connected shifting graphs. Thus, if one restricts the DDAE to certain classes where each equation only has a limited number of variables in it, meaning that each node in the shifting graph has a limited number of edges, one could also limit the growth of the number of connections N and therefore extend the usage of the algorithm to larger system sizes. The effects of such restrictions could be further researched.
In summary, the lack of a satisfactory solution to the problem of finding all connections in the shifting step of the Pantelides algorithm for DDAEs has been overcome by this work for small problems. The new method now provides an efficient algorithm for its solution.
Code Availability: The MATLAB source code of the implementation used to compute the presented results is available as supplementary material and can be obtained under DOI:10.14464/gammas.v4i1.503.