Exemplo n.º 1
0
 public function __construct(SimpleGraph $oGraph, GraphNode $oSourceNode, GraphNode $oSinkNode)
 {
     $sId = $oSourceNode->GetId() . '-to-' . $oSinkNode->GetId();
     parent::__construct($oGraph, $sId, $oSourceNode, $oSinkNode);
 }
 /**
  * INTERNAL USE ONLY
  * @param GraphEdge $oEdge
  * @throws SimpleGraphException
  */
 public function _RemoveEdge(GraphEdge $oEdge)
 {
     if (!array_key_exists($oEdge->GetId(), $this->aEdges)) {
         throw new SimpleGraphException('Cannot remove edge (id=' . $oEdge->GetId() . ') from the graph. The edge was not found.');
     }
     $oEdge->GetSourceNode()->_RemoveOutgoingEdge($oEdge);
     $oEdge->GetSinkNode()->_RemoveIncomingEdge($oEdge);
     unset($this->aEdges[$oEdge->GetId()]);
 }