src/Common/Abstracts/AbstractGraph.php
public function numberOfSubGraph(): int {
        if (null === $this->getNodes()) return 0;
        $c = 0;
        $v = new ArrayList();

        foreach ($this->getNodes() as $node) {
            if ($v->containsValue($node)) continue;
            $c++;
            $this->flood($node, $v);
        }
        return $c;
    }
public function numberOfSubGraph(): int {
        if (null === $this->getNodes()) return 0;
        $c = 0;
        $v = new ArrayList();

        foreach ($this->getNodes() as $node) {
            if ($v->containsValue($node)) continue;
            $c++;
            $this->flood($node, $v);
        }
        return $c;
    }
public function numberOfSubGraph ( ) : int { if ( null === $ this -> getNodes ( ) ) return 0 ; $ c = 0 ; $ v = new ArrayList ( ) ; foreach ( $ this -> getNodes ( ) as $ node ) { if ( $ v -> containsValue ( $ node ) ) continue ; $ c ++ ; $ this -> flood ( $ node , $ v ) ; } return $ c ; }
returns the number of sub graphs

@return int
returns the number of sub graphs