public function addNode(&$node)
    {
        //Nodes must be an instance graph Node;
        if (!$this->isNode($node)) {
            throw new \Exception("Node must be an instance of Graph\Node", PLATFORM_ERROR);
        }
        $nodedId = $node->getId();
        if (!empty($nodedId) && !isset($this->nodeSet[$node->getId()])) {
            $this->nodeSet[$node->getId()] = &$node;
        }
        return $this;
    }