Graphical approach to the nonintersecting string model: Star-triangle equation, inversion relation, and exact solution