Algorithm to Count the Number of Signed Paths in an Electrical Network via Boolean Formulas