A new approach of the automatic contingency selection and ranking with the network flow programming (NFP) is presented in this paper. NFP is adaptable to change the network topology as the transmission or generation branches arc in single or multiple outage. Thus the fast calculation of the contingency states by NFP cm provide the urgent information in real time N- 1 security analysis. In the paper, automatic contingency selection and ranking forP- and Q-type subproblem arc solved by an unified network flow model and algorithm. It is based on the existence of weak coupling between real and reactive quantities in power systems. The performance indices to assess the severity of contingencies are defined as the total real and reactive load required to be curtailed. The proposed ACS technique including the model and its algorithm are examined with IEEE 5-, 14-, 30-, 57- and 118- bus test systems on M-340. And the encouraging results are given in the paper.