Optimal transmission line switching and/or bus splitting is shown to contribute in relieving congestion and reducing the operation cost by rerouting power flows throughout the network. Although bus splitting may be as powerful as line switching in congestion mitigation and is typically considered a smaller disturbance compared with line switching, it has received less attention in the literature in part due to the more complicated node-breaker modeling requirement. In this paper, an optimal transmission line switching and bus splitting heuristic is presented to minimize the operation cost while respecting AC and N-1 contingency constraints. We present a two-level solution method where switching decisions are made in the upper level problem formulated as a mixed integer second order cone programming master problem, while the resulting network topology is checked against AC and N-1 contingency constraints in lower level subproblems. Line switching and bus splitting are modeled as switching actions assuming double-bus double-breaker substation arrangements where all elements at a substation, including generators, loads, lines and shunt elements, are given switches to connect to either of the busbars if the respective substation is split. We also introduce additional constraints to model a breaker-and-a-half substation scheme. Furthermore, a pre-screening step is presented to limit the search space of the problem, thus accelerating the solution process. We demonstrate the application of the proposed method on IEEE standard test systems.