using My.Collections;
using System;

namespace Netzwerkpfad;

internal class Program
{
    static void Main(string[] args)
    {
        var graph = new ShortestPathGraph<string>(true);

        var a = graph.AddNode("A Router");
        var b = graph.AddNode("B Verstärker: +5dB");
        var c = graph.AddNode("C Router");
        var d = graph.AddNode("D Verstärker: +4dB");
        var e = graph.AddNode("E Router");

        // dB-Werte reduzieren    
        (b as dynamic).Amplification = -5;
        (d as dynamic).Amplification = -4;

        graph.AddEdge(a, b, 8);    // positive Werte optimieren 
        graph.AddEdge(b, c, 3);
        graph.AddEdge(b, d, 6);
        graph.AddEdge(c, d, 7);
        graph.AddEdge(d, e, 4);

        (var path, var distance) = graph.BellmanFord(a, e);

        Console.WriteLine($"Pfad: {string.Join(" -> ", path)}, Entfernung: -{distance} dB");

    }
}
