public function findRootNodes()
    {
        $possibleRoots = new SplObjectStorage();
        foreach ($this->nodes as $node) {
            $possibleRoots[$node] = true;
        }

        // Detect all nodes which couldn't be root
        foreach ($this->dependencies as $node) {
            $nodeDependencies = $this->dependencies[$node];
            foreach ($nodeDependencies as $dependency) {
                $possibleRoots[$dependency] = false;
            }
        }

        // Create array which contains all roots
        $rootNodes = array();
        foreach ($possibleRoots as $node) {
            if ($possibleRoots[$node]) {
                $rootNodes[] = $node;
            }
        }

        return $rootNodes;
    }