Пример #1
0
        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
        static void Main(string[] args)
        {
            var gg = new GraphGenerator();
            //var basic = gg.GenerateBasicModel(1000, 10, 2, 0.97);
            var holmeKim = gg.GenerateHolmeKimModel(300, 10, 2, 0.9);

            var exporter = new GraphExporter();

            //exporter.ExportToCsv(basic, "../../../Datasets/basicGraph.csv");
            exporter.ExportToCsv(holmeKim, "../../../Datasets/holmeKim.csv");
        }
Пример #3
0
        static void Main(string[] args)
        {
            var dl   = new DataLoader();
            var data = dl.LoadData("../../../Datasets/Iris/iris.data");
            //var data = dl.LoadData("../../../Datasets/Iris/iris.data").Take(10).ToList();
            var converter  = new GraphConverter();
            var graphER    = converter.ConvertUsingERadius(data, 0.75);
            var graphKnn   = converter.ConvertUsingKnn(data, 5);
            var graphERKnn = converter.ConvertUsingERadiusWithKnn(data, 0.75, 5);
            var exporter   = new GraphExporter();

            //exporter.ExportToPajak(graph, "../../../Datasets/Iris/epsilonIris.net");
            exporter.ExportToCsv(graphER, "../../../Datasets/Iris/epsilonIris.csv");
            exporter.ExportToCsv(graphKnn, "../../../Datasets/Iris/knnIris.csv");
            exporter.ExportToCsv(graphERKnn, "../../../Datasets/Iris/epsilonKnnIris.csv");
        }
Пример #4
0
        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");
        }
Пример #5
0
        static void Main(string[] args)
        {
            var gg  = new GraphGenerator();
            var lsm = gg.GenerateLinkSelectionModel(500);
            var cm  = gg.GenerateCopyingModel(500, 0.5);

            var exporter = new GraphExporter();

            exporter.ExportToCsv(lsm, "../../../Datasets/lsm.csv");
            exporter.ExportToCsv(cm, "../../../Datasets/cm.csv");

            var agingPositive = gg.GenerateBarabasiAlbertModelWithAging(10, 2, 1, 10);
            var agingNegative = gg.GenerateBarabasiAlbertModelWithAging(10, 2, 1, 10);

            exporter.ExportToCsv(agingPositive, "../../../Exports/barabasiAgingPositive.csv");
            exporter.ExportToCsv(agingNegative, "../../../Exports/barabasiAgingNegative.csv");
        }
Пример #6
0
        static void Main(string[] args)
        {
            var generator = new GraphGenerator();
            var ba        = generator.GenerateBarabasiAlbertModel(1000, 10, 2);
            var er        = generator.GenerateErdosRenyiModel(1000, 0.00398);

            var baRnsSample = ba.CreateRnsSample(0.15);
            var baRdnSample = ba.CreateRdnSample(0.15);

            var erRnsSample = er.CreateRnsSample(0.15);
            var erRdnSample = er.CreateRdnSample(0.15);

            var exporter = new GraphExporter();

            exporter.ExportDegreeToCsv(ba, "../../../Exports/ba.csv");
            exporter.ExportDegreeToCsv(er, "../../../Exports/er.csv");
            exporter.ExportDegreeToCsv(baRnsSample, "../../../Exports/baRnsSample.csv");
            exporter.ExportDegreeToCsv(baRdnSample, "../../../Exports/baRdnSample.csv");
            exporter.ExportDegreeToCsv(erRnsSample, "../../../Exports/erRnsSample.csv");
            exporter.ExportDegreeToCsv(erRdnSample, "../../../Exports/erRdnSample.csv");
        }