public function getVertex($id) { $vertices = $this->getVertices(); if (!array_key_exists($id, $vertices)) { throw new Exception("Unable to find {$id} in the Graph"); } return $vertices[$id]; }