The topological descriptor Wiener index, named after the chemist Harold Wiener, is defined as half the sum of the distances between every pair of vertices of a graph. A lot of research has been devoted to finding the Wiener index by brute force method. In this paper, we compute the Wiener index of chemical structures such as sodium chloride and benzenoid without using a distance matrix.