Cacti with n-vertices and t cycles having extremal Wiener index

The Wiener index W(G) of a connected graph G is the sum of distances between all pairs of vertices of G. A connected graph G is said to be a cactus if each of its blocks is either a cycle or an edge. Let Gn,t be the set of all n-vertex cacti containing exactly t cycles. Liu and Lu (2007) determined the unique graph in Gn,t with the minimum Wiener index. We now establish a sharp upper bound on the Wiener index of graphs in Gn,t and identify the corresponding extremal graphs.