The complexity and volatility of power system operation increases when larger parts of the power production is based on distributed and non-controllable renewable energy sources. Ensuring stable and secure operation becomes more difficult in these modern power systems. For security assessment, the results of traditional offline simulations may become obsolete prior to the completion of the assessment. In contrast, real-time stability and security assessment aims at online computation, and it is therefore dependent on very fast computation of properties of the grid operating state. The paper develops the reduce-factor-solve approach to real-time computation of two key components in real-time assessment methods, network reduction and calculation of Thevenin impedances. The aim is to allow online stability assessment for very complex networks. The theoretical foundation behind the reduce-factor-solve approach is described together with the ability to handle both algorithms in a common framework. By exploiting parallelization of the reduce and solve steps in combination with fast matrix factorization, Thevenin impedances and reduced networks are computed much faster than previous approaches. The reduce-factor-solve algorithm is evaluated on power grids of varying complexity to show that Thevenin impedance computation and network reduction for complex power systems can be performed on a milliseconds time scale.