A branch-and-bound algorithm is devised to determine the optimal attack strategy to disconnect a network where the objective is to minimize the expected attacking cost. The attacker cannot launch an attack if its cost is beyond his available budget or its probability of success falls below a threshold level. The proposed branch-andbound algorithm includes, among other features, a dynamic programming-based lower bound as well as a preprocessing algorithm which aims at identifying unattackable links and removing irrelevant ones. Extensive use of the min-cut algorithm is made to derive valid upper bounds and to perform feasibility tests. Preliminary numerical implementation shows potential to provide exact solutions for medium-sized networks within reasonable time.