Ejemplo n.º 1
0
        public void RunMst(string path)
        {
            EdgeWeightedGraph G = new EdgeWeightedGraph(path);
            MST mst             = Factory.GetMST(G);

            foreach (var e in mst.Edges())
            {
                Console.WriteLine(e);
            }
            Console.WriteLine(mst.Weight());
        }
Ejemplo n.º 2
0
        public void Run(string path)
        {
            HttpClient client = new HttpClient();

            client.Timeout = TimeSpan.FromHours(1);
            using (var stream = client.GetAsync(path).Result.Content.ReadAsStreamAsync().Result)
            {
                Stopwatch         watch1 = Stopwatch.StartNew();
                EdgeWeightedGraph G      = new EdgeWeightedGraph(stream);
                Console.WriteLine(watch1.Elapsed);

                Stopwatch watch = Stopwatch.StartNew();
                MST       mst   = Factory.GetMST(G);
                Console.WriteLine(watch.Elapsed);
            }
        }