- Screening virtual and synthetic combinatorial libraries may facilitate rapid drug lead discovery by selecting subsets of molecules according to their similarity or dissimilarity toward specific compound collections. Topological indices computed from atomic connectivities or graph distances are increasingly used as structural descriptors in order to maximize the molecular diversity of libraries or to quantify the drug-like character of compounds. In this paper we present efficient equations for the computation of several distance-based topological indices of a molecular graph from the distance invariants of its subgraphs. These equations offer an effective way to compute for non-weighted molecular graphs the Wiener index, even/odd Wiener index, resistance distance index, Wiener polynomial, and even/odd Wiener polynomial. Using a simple and fast algorithm one can compute these topological indices for very large virtual combinatorial libraries without computing the indices from the atomic scale up for each individual compound - rather only distance-based indices of the building blocks are needed to generate the topological indices of the compound assembled from the building blocks.