Abstract.Two algorithms based upon a tree-cotree decomposition, called in this paper spanning tree technique (STT) and generalized spanning tree technique (GSTT), have been shown to be useful in computational electromagnetics. The aim of this paper is to give a rigorous description of the GSTT in terms of homology and cohomology theories, together with an analysis of its termination. In particular, the authors aim to show, by concrete counterexamples, that various problems related with both STT and GSTT algorithms exist. The counterexamples clearly demonstrate that the failure of STT and GSTT is not an exceptional event, but something that routinely occurs in practical applications.Key words. algebraic topology, scalar potential in multiply connected regions, tree-cotree decomposition, belted tree, computational topology, homology theory, cohomology theory, homology and cohomology generators, homology-cohomology duality AMS subject classifications. 65N30, 78M10, 78M25, 55N99, 55M05, 55N33 DOI. 10.1137/0907663341. Introduction. The tree-cotree decomposition arises from graph theory and consists in partitioning the edges of a graph into a spanning tree and its complement, referred to as the cotree. The idea of taking advantage of the tree-cotree decomposition is at the root of electric network theory [1], [2]. It has been used, for example, to generate a maximal set of independent Kirchhoff's equations for the network analysis (see, for example, [3] [10]. The tree-cotree decomposition became popular in computational electromagnetics after [11]. It had been widely used as a gauging technique to set well-posed magnetostatic and magneto-quasi-static boundary value problems (BVP). Nowadays, such gauging techniques have lost their importance, since the ungauged formulations were shown to be more effective, improving the condition number of the matrix for the linear system of equations; see, for example, [12].More recently, two algorithmic techniques based upon the tree-cotree decomposition have been shown to be quite useful in computational electromagnetics. The first one, introduced in [13] (see also [14], [15], [16] and referred to as spanning tree technique (STT) in this paper, is commonly employed in order to compute the socalled generalized source magnetic fields, needed to enforce the source currents when solving magnetostatic and magneto-quasi-static BVP formulated by using a magnetic scalar potential. In this application, the STT is used to compute a 1-cochain when its coboundary 2-cochain is given as input.