set->getEdges() as $edge) { if ($edge instanceof EdgeDirected) { return true; } } return false; } /** * checks whether the graph has any undirected edges * * This method is intentionally not named "isUndirected()", * because that might be misleading in regards to empty and/or mixed graphs. * * @return boolean */ public function hasUndirected() { foreach ($this->set->getEdges() as $edge) { if ($edge instanceof EdgeUndirected) { return true; } } return false; } /** * checks whether this is a mixed graph (contains both directed and undirected edges) * * @return boolean * @uses self::hasDirected() * @uses self::hasUndirected() */ public function isMixed() { return ($this->hasDirected() && $this->hasUndirected()); } }