b there's also an edge b->a) * * @return boolean * @uses Graph::getEdges() * @uses EdgeDirected::getVertexStart() * @uses EdgeDirected::getVertedEnd() * @uses Vertex::hasEdgeTo() */ public function isSymmetric() { // check all edges foreach ($this->graph->getEdges() as $edge) { // only check directed edges (undirected ones are symmetric by definition) if ($edge instanceof EdgeDirected) { // check if end also has an edge to start if (!$edge->getVertexEnd()->hasEdgeTo($edge->getVertexStart())) { return false; } } } return true; } }