Пример #1
0
 protected override bool NodeEnter(Node node, Arc arc)
 {
     if (arc == Arc.Invalid)
     {
         Parent.Potential[node] = 0;
     }
     else
     {
         Node other = Parent.MyGraph.Other(arc, node);
         Parent.Potential[node] = Parent.Potential[other] +
                                  (node == Parent.MyGraph.V(arc) ? Parent.ActualCost(arc) : -Parent.ActualCost(arc));
     }
     return(true);
 }
Пример #2
0
 protected override bool NodeEnter(Node node, Arc arc)
 {
     if (arc == Arc.Invalid)
     {
         Parent.Potential[node] = 0.0;
     }
     else
     {
         Node key = Parent.MyGraph.Other(arc, node);
         Parent.Potential[node] = Parent.Potential[key] + ((!(node == Parent.MyGraph.V(arc))) ? (0.0 - Parent.ActualCost(arc)) : Parent.ActualCost(arc));
     }
     return(true);
 }