private function getPathDFS($moduleName, $dependency, &$reversePath = array())
    {
        // does not exist in the graph
        if (!isset($this->dependencies[$moduleName])) {
            return false;
        }

        $reversePath[] = $moduleName;

        // adjacent node
        if (isset($this->dependencies[$moduleName][$dependency])) {
            $reversePath[] = $dependency;

            return true;
        }

        // DFS
        foreach ($this->dependencies[$moduleName] as $predecessor => $_) {
            if ($this->getPathDFS($predecessor, $dependency, $reversePath)) {
                return true;
            }
        }

        return false;
    }