public function removeEdge(&$head, &$tail, $directed = TRUE)
    {

        if (!is_a($head, "\Platform\Graph\Node") || !is_a($tail, "\Platform\Graph\Node")) {
            throw new \Platform\Exception("Nodes used to create a new Edge must be instances of \Platform\Graph\Node", PLATFORM_ERROR);
        }
        $_nodeIds = array($head->getId(), $tail->getId());
        $edges = $this->edgeSet;
        //find all edges with these two nodes incident
        foreach ($edges as $edge):
            echo $edge->getId() . "<br />";
            if (in_array($edge->getHead()->getId(), $_nodeIds) && in_array($edge->getTail()->getId(), $_nodeIds)):
                if (!$directed):
                    unset($this->edgeSet[$edge->getId()]);
                elseif ($edge->getHead()->getId() == reset($_nodeIds) && $edge->getTail()->getId() == end($_nodeIds)):
                    //Remove the value from the arcSet array
                    $this->arcSet = array_diff($this->arcSet, array($edge->getId()));
                    unset($this->edgeSet[$edge->getId()]);
                endif;
            endif;
        endforeach;

        return true;
    }