Example #1
0
        private void Display(UndirectedFirstTopologicalSortAlgorithm <string, Edge <string> > topo)
        {
            int index = 0;

            foreach (string v in topo.SortedVertices)
            {
                Console.WriteLine("{0}: {1}", index++, v);
            }
        }
Example #2
0
        public void Compute <TVertex, TEdge>([PexAssumeNotNull] IUndirectedGraph <TVertex, TEdge> g)
            where TEdge : IEdge <TVertex>
        {
            var topo =
                new UndirectedFirstTopologicalSortAlgorithm <TVertex, TEdge>(g);

            topo.AllowCyclicGraph = true;
            topo.Compute();
        }
Example #3
0
        private void Compute <TVertex, TEdge>(IUndirectedGraph <TVertex, TEdge> g)
            where TEdge : IEdge <TVertex>
        {
            var topo =
                new UndirectedFirstTopologicalSortAlgorithm <TVertex, TEdge>(g);

            topo.AllowCyclicGraph = true;
            topo.Compute();
        }
Example #4
0
        public void Compute([PexAssumeNotNull] IUndirectedGraph <string, Edge <string> > g)
        {
            var topo =
                new UndirectedFirstTopologicalSortAlgorithm <string, Edge <string> >(g);

            topo.AllowCyclicGraph = true;
            topo.Compute();

            Display(topo);
        }