A mixed nodal-mesh formulation of the PEEC method based on efficient graph algorithms