private void InitializeInDegrees()
 {
     foreach (TVertex vertex in VisitedGraph.Vertices)
     {
         Degrees.Add(vertex, VisitedGraph.AdjacentDegree(vertex));
         _heap.Enqueue(vertex);
     }
 }
Esempio n. 2
0
        private void InitializeInDegrees()
        {
            if (!AllowCyclicGraph && VisitedGraph.Edges.Any(edge => edge.IsSelfEdge()))
            {
                throw new NonAcyclicGraphException();
            }

            foreach (TVertex vertex in VisitedGraph.Vertices)
            {
                Degrees.Add(vertex, VisitedGraph.AdjacentDegree(vertex));
                _heap.Enqueue(vertex);
            }
        }