Extremal graphs with respect to the vertex PI index