Generalization of the spanning-tree technique

The spanning-tree technique is generalized to topologically nontrivial cases, to obtain a general method for common topological problems. Tractability and elementary numerical approaches are addressed and two numerical examples are presented.