Exemplo n.º 1
0
        public void TestRandomGraphs()
        {
            DirectoryInfo dir = new DirectoryInfo(startupPath + "dataset/random/");

            foreach (FileInfo fi in dir.GetFiles())
            {
                // output.WriteLine(fi.FullName);

                Graph g = rd.createGraphFromPath(fi.FullName);
                Assert.InRange <Int32>(g.HalAlgorithm(), 3, g.getC());
                Assert.True(g.isProperCyclicColoring());
            }
        }
Exemplo n.º 2
0
        public void TestFacebookGraphs()
        {
            // run for all Graphs from facebook dataset
            string folderPath = startupPath + "/dataset/facebook/";

            string[] fileArray = Directory.GetFiles(folderPath, "*.edges");
            foreach (var f in fileArray)
            {
                output.WriteLine(f);
                if (f.Contains("1912.edges"))
                {
                    // we dont know yet why it executes for a long time
                    continue;
                }
                Graph g        = rd.createGraphFromPath(f);
                int   noColors = g.HalAlgorithm(showProgress: false);
                //System.Console.WriteLine("getV: " + g.getV());
                //System.Console.WriteLine("fbColors: " + noColors);
                Boolean isProper = g.isProperCyclicColoring();
                if (isProper)
                {
                    output.WriteLine("ok");
                }
                else
                {
                    output.WriteLine("wrong");
                }
                Assert.True(isProper);
                Assert.InRange <Int32>(noColors, 3, g.getC());
            }
        }