In undirected graphs, in-degree and out-degree are the same.
public inDegreeOf ( object $vertex ) : integer | ||
$vertex | object | The vertex for which to retrieve in-degree information. |
return | integer |
public function process(Vertex $vertex, Digraph $graph) { if ($graph->inDegreeOf($vertex) === 0 && !$vertex instanceof Vertex\Function_) { Helper::remove($vertex, $graph); return true; } return false; }