コード例 #1
0
        private void OnGrayTarget([NotNull] TEdge edge)
        {
            Debug.Assert(edge != null);

            bool decreased = Relax(edge);

            if (decreased)
            {
                _vertexQueue.Update(edge.Target);
                AssertHeap();
                OnTreeEdge(edge);
            }
            else
            {
                OnEdgeNotRelaxed(edge);
            }
        }
コード例 #2
0
        private void OnGrayTarget([NotNull] TEdge edge)
        {
            Debug.Assert(edge != null);

            bool decreased = Relax(edge);

            if (decreased)
            {
                TVertex target   = edge.Target;
                double  distance = GetVertexDistance(target);

                _costs[target] = DistanceRelaxer.Combine(distance, CostHeuristic(target));
                _vertexQueue.Update(target);
                OnTreeEdge(edge);
            }
            else
            {
                OnEdgeNotRelaxed(edge);
            }
        }