public void normalTest()
        {
            Graph g = RandomGraph.Generate(20, 0.5, 1);

            Assert.AreEqual(20, g.GetMap().Count);

            foreach (KeyValuePair <int, List <int> > entry in g.GetMap())
            {
                Assert.IsNotNull(entry.Value);
            }
        }
        public void tooManyConnectionsTest()
        {
            Graph g = RandomGraph.Generate(20, 1.1, 1);

            Assert.AreEqual(20, g.GetMap().Count);

            foreach (KeyValuePair <int, List <int> > entry in g.GetMap())
            {
                Assert.AreEqual(19, entry.Value.Count);
            }
        }
Esempio n. 3
0
        public void concurrencyRandomGraphTest()
        {
            int size = 60;

            foreach (SCCDetector detector in this.concurrentDetectors)
            {
                Graph g        = RandomGraph.Generate(size, 0.05, 4);
                Graph original = new Graph(g.GetMap());

                ResultSet results = detector.Compute(g);

                for (int i = 0; i < results.List.Count; i++)
                {
                    Assert.IsTrue(original.IsSCC(results.List[i]));
                }
            }
        }
Esempio n. 4
0
 private static Graph CreateRandomGraph(int n, double p, SCCDetector[] detectors, int threads)
 {
     return(RandomGraph.Generate(n, p, threads));
 }
        public void emptyTest()
        {
            Graph g = RandomGraph.Generate(0, 0, 1);

            Assert.AreEqual(0, g.GetMap().Count);
        }