예제 #1
0
파일: Program.cs 프로젝트: daywee/MAD2
        static void Main(string[] args)
        {
            var gl             = new GraphLoader();
            var graph          = gl.LoadFromCsvFile("../../../Datasets/KarateClub/KarateClub.csv");
            var kl             = new KernighanLin();
            var clusteredGraph = kl.Cluster(graph);
            var exporter       = new GraphExporter();

            exporter.ExportToCsv(clusteredGraph, "../../../Datasets/KarateClub/KarateClubClustered.csv");
        }
예제 #2
0
파일: Program.cs 프로젝트: daywee/MAD2
        static void Main(string[] args)
        {
            var gl    = new GraphLoader();
            var graph = gl.LoadFromCsvFile("../../../Datasets/KarateClub/KarateClub.csv");

            graph.NormalizeIds();

            var clusterer = new KCoreClusterer();

            clusterer.Cluster(graph, 1);
            clusterer.Cluster(graph, 2);
            clusterer.Cluster(graph, 3);
            clusterer.Cluster(graph, 4);
        }
예제 #3
0
파일: Program.cs 프로젝트: daywee/MAD2
        static void Main(string[] args)
        {
            var gl    = new GraphLoader();
            var graph = gl.LoadFromCsvFile("../../../Datasets/KarateClub/KarateClub.csv");

            graph.NormalizeIds();
            //var adjacencyMatrix = graph.GetAdjacencyMatrix();
            //var cosineSimilarityMatrix = adjacencyMatrix.GetCosineSimilarityMatrix();
            var clusterer = new HierarchicalAgglomerativeClusterer();

            clusterer.Cluster(graph);

            var exporter = new GraphExporter();
            //exporter.ExportToCsv(basic, "../../../Datasets/basicGraph.csv");
            //exporter.ExportToCsv(holmeKim, "../../../Datasets/holmeKim.csv");
        }
예제 #4
0
        static void Main(string[] args)
        {
            var gl       = new GraphLoader();
            var karate   = gl.LoadFromCsvFile("../../../Datasets/KarateClub/KarateClub.csv");
            var erdos    = gl.LoadFromEdgeListFile("../../../Datasets/Lesson07B/erdos_export");
            var barabasi = gl.LoadFromEdgeListFile("../../../Datasets/Lesson07B/barabasi_export");
            var airports = gl.LoadFromEdgeListFile("../../../Datasets/Lesson07B/airports_export");

            var    sm                      = new SirModel();
            double beta                    = 0.3;
            int    mu                      = 5;
            int    iterations              = 30;
            var    karateSirDistribution   = sm.Simulate(karate, beta, mu, iterations);
            var    erdosSirDistribution    = sm.Simulate(erdos, beta, mu, iterations);
            var    barabasiSirDistribution = sm.Simulate(barabasi, beta, mu, iterations);
            var    airportsSirDistribution = sm.Simulate(airports, beta, mu, iterations);

            ExportDistributionToCsv(karateSirDistribution, "../../../Exports/KarateClubSirDistribution.csv");
            ExportDistributionToCsv(erdosSirDistribution, "../../../Exports/ErdosSirDistribution.csv");
            ExportDistributionToCsv(barabasiSirDistribution, "../../../Exports/BarabasiSirDistribution.csv");
            ExportDistributionToCsv(airportsSirDistribution, "../../../Exports/AirportsSirDistribution.csv");
        }