src/Hal/Component/Tree/GraphDeduplicated.php
public function addEdge(Node $from, Node $to)
    {
        $key = $from->getUniqueId().'->'.$to->getUniqueId();

        if (isset($this->edgesMap[$key])) {
            return $this;
        }

        $this->edgesMap[$key] = true;

        return parent::addEdge($from, $to);
    }
public function addEdge(Node $from, Node $to)
    {
        $key = $from->getUniqueId().'->'.$to->getUniqueId();

        if (isset($this->edgesMap[$key])) {
            return $this;
        }

        $this->edgesMap[$key] = true;

        return parent::addEdge($from, $to);
    }
@param Node $from
@param Node $to

@return $this