An efficient algorithm for the All-Didirectional-Edgcs Problem is presented. The All-Bidirectional-Edges Problem is to find an edge-labelling of an undirected network, G = (V,E), with a source and a sink, such that an edge [u,v] ∈ E is labelled (u,v) or (v,u) (or both) depending on the existence of a (simple) path from the source to sink that visits the vertices u and v, in the order u,v orv,u, respectively. The algorithm presented works by partitioning the graph into a set of bridges and analyzing them recursively. The time complexity of the algorithm is shown to be O(|E| ·|V|). The problem arises naturally in the context of the simulation of an MOS transistor network, in which a transistor may operate as a unilateral or a bilateral device, depending on the voltages at its source and drain nodes. For efficient simulation, it is required to detect the set of transistors that may operate as bilateral devices. Also, this algorithm can be used in order to detect all the sneak paths in a network of pass transistor.