public void RouteEdges_Subgraphs() { //DisplayGeometryGraph.SetShowFunctions(); Random random = new Random(1); int ntest = 20; for (int i = 0; i < ntest; i++) { int numberOfSubgraphs = 2 + random.Next(10); int numberOfNodesInSubgraphs = 2 + random.Next(10); GeometryGraph graph = GraphGenerator.GenerateGraphWithSameSubgraphs(numberOfSubgraphs, numberOfNodesInSubgraphs); AddRootCluster(graph); SetRandomNodeShapes(graph, random); int additionalEdges = random.Next(10); for (int j = 0; j < additionalEdges; j++) { Node source = graph.Nodes[random.Next(graph.Nodes.Count)]; Node target = graph.Nodes[random.Next(graph.Nodes.Count)]; Edge edge = GraphGenerator.CreateEdge(source, target); graph.Edges.Add(edge); } Layout(graph, random); //DisplayGeometryGraph.ShowGraph(graph); RouteEdges(graph, 5 * random.NextDouble()); //DisplayGeometryGraph.ShowGraph(graph); } }
public void DisjointGraphTests() { GeometryGraph graph = GraphGenerator.GenerateGraphWithSameSubgraphs(3, 6); SugiyamaLayoutSettings settings = new SugiyamaLayoutSettings(); GraphGenerator.SetRandomNodeShapes(graph, random); WriteLine("Trying Disjoint Graph with Left To Right layer direction"); LayoutAndValidate(graph, settings, 32, 25, LayerDirection.LeftToRight); }