summaryrefslogtreecommitdiffstats
path: root/src/CS340.Plotter/Program.cs
blob: 9e9a52a73cd014591f4bfd5395370e987212b621 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Graph;
using Graph.IO;
using TSP;

namespace Plotter
{
    static class Program
    {
        /// <summary>
        ///  The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Run();
            Application.Run(new Plot());
        }

        static void Run()
        {
            foreach (string file in Directory.GetFiles("graphs/"))
            {
                Tour bruteForce = Solve.BruteForce(file, 0);
                Debug.WriteLine(bruteForce);

                // Graph mst = graph.MST(0);
                // GraphFile.Print(mst, new ConsoleWriter());
                // Console.WriteLine(
                //     graph.Vertices.Sum(vertex =>
                //         vertex.Edges.FirstOrDefault(edge => edge.V == vertex.Parent).Weight));

                // mst.Vertices.ForEach(vertex =>
                // {
                //     Console.Write($"{vertex.Id}");
                //     vertex.Edges.ForEach(edge => Console.Write($" {edge.V} {edge.Weight.ToString("F1")}"));
                //     Console.WriteLine();
                // });
                // Console.WriteLine(mst.Vertices
                //        .Sum(vertex => vertex.Edges
                //        .FirstOrDefault(edge => edge.V == vertex.Parent).Weight));
            }
        }
    }
}