using My.Collections;
using System;

namespace Stundenplanproblem;

internal class Program
{
    static void Main()
    {
        var graph = new ColoredGraph<string>();

        var prog = graph.AddNode("Programmieren | 3 | Lea  ");
        var algo = graph.AddNode("Algorithmik   | 3 | Finn ");
        var db = graph.AddNode  ("Datenbanken   | 1 | Tarek");
        var gr = graph.AddNode  ("Grundlagen    | 1 | Lea  ");
        var ki = graph.AddNode  ("KI            | 1 | Tarek");
        var net = graph.AddNode ("Netzwerke     | 1 | Lea  ");

        // 3. Semester
        graph.AddEdge(prog, algo);

        // 1. Semester
        graph.AddEdge(db, gr);
        graph.AddEdge(db, ki);
        graph.AddEdge(db, net);
        graph.AddEdge(gr, ki);
        graph.AddEdge(gr, net);
        graph.AddEdge(ki, net);

        // Lea
        graph.AddEdge(prog, gr);
        graph.AddEdge(prog, net);

        // Tarek (bereits durch 1. Semester abgedeckt)
        graph.AddEdge(db, ki);

        graph.BacktrackingColoring();

        string[] zeiten = { " 8:00 -  9:45",
                            "10:00 - 11:30",
                            "12:15 - 13:45",
                            "14:00 - 15:30" };

        foreach (dynamic node in graph.Nodes)
        {
            Console.WriteLine($"{node.Item} -> {zeiten[node.Color]} ({node.Color})");
        }

    }
}
