public void SortDCT()
        {
            var g = TestGraphFactory.LoadBidirectionalGraph("GraphML/DCT8.graphml");

            var topo = new SourceFirstTopologicalSortAlgorithm <string, Edge <string> >(g);

            topo.Compute();
        }
Ejemplo n.º 2
0
        public static void SourceFirstTopologicalSort <TVertex, TEdge>
            (this IVertexAndEdgeListGraph <TVertex, TEdge> visitedGraph, IList <TVertex> vertices)
            where TEdge : IEdge <TVertex>
        {
            Contract.Requires(visitedGraph != null);
            Contract.Requires(vertices != null);

            var topo = new SourceFirstTopologicalSortAlgorithm <TVertex, TEdge>(visitedGraph);

            topo.Compute(vertices);
        }
Ejemplo n.º 3
0
        private void Sort <TVertex, TEdge>(IVertexAndEdgeListGraph <TVertex, TEdge> g)
            where TEdge : IEdge <TVertex>
        {
            var topo = new SourceFirstTopologicalSortAlgorithm <TVertex, TEdge>(g);

            try
            {
                topo.Compute();
            }
            catch (NonAcyclicGraphException)
            { }
        }
Ejemplo n.º 4
0
        public static void SourceFirstTopologicalSort <TVertex, TEdge>(
            IVertexAndEdgeListGraph <TVertex, TEdge> visitedGraph,
            IList <TVertex> vertices)
            where TEdge : IEdge <TVertex>
        {
            GraphContracts.AssumeNotNull(visitedGraph, "visitedGraph");
            GraphContracts.AssumeNotNull(vertices, "vertices");

            var topo = new SourceFirstTopologicalSortAlgorithm <TVertex, TEdge>(visitedGraph);

            topo.Compute(vertices);
        }
 public void Compute()
 {
     // filter nullabed edges out
     if (this.IgnoreAllowDBNull)
         topo = new SourceFirstTopologicalSortAlgorithm(this.VisitedGraph);
     else
     {
         FilteredVertexAndEdgeListGraph fgraph = new FilteredVertexAndEdgeListGraph(
             this.VisitedGraph,
             nonNullableRelationEdgePredicate,
             QuickGraph.Predicates.Preds.KeepAllVertices()
             );
         topo = new SourceFirstTopologicalSortAlgorithm(fgraph);
     }
     topo.Compute();
 }
        public void SortAnotherOne()
        {
            var g = new BidirectionalGraph <int, Edge <int> >();

            g.AddVertexRange(new int[5] {
                0, 1, 2, 3, 4
            });
            g.AddEdge(new Edge <int>(0, 1));
            g.AddEdge(new Edge <int>(1, 2));
            g.AddEdge(new Edge <int>(1, 3));
            g.AddEdge(new Edge <int>(2, 3));
            g.AddEdge(new Edge <int>(3, 4));

            var topo = new SourceFirstTopologicalSortAlgorithm <int, Edge <int> >(g);

            topo.Compute();
        }
        public void Sort([PexAssumeNotNull] IVertexAndEdgeListGraph <string, Edge <string> > g)
        {
            SourceFirstTopologicalSortAlgorithm <string, Edge <string> > topo = new SourceFirstTopologicalSortAlgorithm <string, Edge <string> >(g);

            topo.Compute();
        }
 public void Sort([PexAssumeNotNull]IVertexAndEdgeListGraph<string, Edge<string>> g)
 {
     SourceFirstTopologicalSortAlgorithm<string, Edge<string>> topo = new SourceFirstTopologicalSortAlgorithm<string, Edge<string>>(g);
     topo.Compute();
 }
 public void SetUp()
 {
     this.g = new AdjacencyGraph();
     this.topo = new SourceFirstTopologicalSortAlgorithm(g);
 }