[PBQP] Move invalid graph nodeId/edgeId methods into base class.