示例#1
0
 /**
  * Visits the given object.
  *
  * @param object IObject $w An object.
  */
 public function visit(IObject $w)
 {
     $max = $this->earliestTime[0];
     foreach ($w->getIncidentEdges() as $edge) {
         $v = $edge->getV0();
         $wt = $edge->getWeight();
         $max = max($max, $this->earliestTime[$v->getNumber()] + unbox($wt));
     }
     $this->earliestTime[$w->getNumber()] = $max;
 }