public void SortDCT() { var g = TestGraphFactory.LoadBidirectionalGraph("GraphML/DCT8.graphml"); var topo = new SourceFirstTopologicalSortAlgorithm <string, Edge <string> >(g); topo.Compute(); }
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); }
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) { } }
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 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(); }