コード例 #1
0
 public TarjanNoBackEdges(IGraph <T, E> graph, IEnumerable <T> subset_vertices)
 {
     _graph = graph;
     _work  = subset_vertices;
     foreach (T v in _work)
     {
         if (graph.Predecessors(v).Any())
         {
             continue;
         }
         EdgeClassifier.Classify(graph, v, ref classify);
     }
     foreach (var v in _work)
     {
         Index[v]   = -1;
         LowLink[v] = -1;
     }
 }
コード例 #2
0
ファイル: TarjanNoBackEdges.cs プロジェクト: baufeng/Campy
        public TarjanNoBackEdges(IGraph <T, E> graph)
        {
            _graph = graph;
            foreach (var v in _graph.Vertices)
            {
                if (graph.Predecessors(v).Any())
                {
                    continue;
                }

                EdgeClassifier.Classify(graph, v, ref classify);
            }
            foreach (var v in _graph.Vertices)
            {
                Index[v]   = -1;
                LowLink[v] = -1;
            }
        }