the considered graphs are simple, finite, and connected. For a graph $G$, $V(G)$ and $E(G)$ denote the sets of all the vertices and edges, respectively. The [*distance*]{} $d_G(x,y)$ between vertices $x$ and $y$ of a graph $G$ is the length of a shortest path between vertices $x$ and $y$ in $G$. We sometimes write $d(x,y)$ instead of $d_G(x,y)$. For a vertex $x$, we will denote by $N(x)$ the set of all the vertices in $G$ that are adjacent to $x$. The *degree* of $x$, denoted as $\deg_G(x)$ or shortly $\deg(x)$, is the cardinality of the set $N(x)$. For any $k \geq 3$, a cycle on $k$ vertices will be called a *$k$-cycle*. Moreover, the set of all $k$-cycles in $G$ is denoted as $C_k(G)$. A cycle or a path in graph $G$ will be often denoted as the sequence of its vertices. In addition, a *star graph* $S_k$, $k \geq 1$, is a complete bipartite graph $K_{1,k}$.

The Wiener polarity index is a molecular descriptor defined as the number of unordered pairs of vertices at distance three. More precisely, for a graph $G$, the *Wiener polarity index* of $G$, denoted by $W_p(G)$, is defined as $$W_p(G) = | \lbrace \lbrace 