using System.Collections.Generic;
public override string ToString()
return this.wartosc.ToString();
public Krawedz(Node s,Node k,int w=1)
public override string ToString()
return $"{this.start}-{this.koniec}({this.waga})";
public Node znajdzDrugi(Node n)
return this.start==n?this.koniec:this.start;
public List<Krawedz>krawedzie;
this.nodes=new List<Node>();
this.krawedzie=new List<Krawedz>();
public List<Krawedz>ZnajdzKrawedzie(Node n)
List<Krawedz>wynik=new List<Krawedz>();
for(int i=0;i<this.krawedzie.Count;i++)
var k =this.krawedzie[i];
if(k.start==n||k.koniec==n)
public static void Main()
List<Node>w=new List<Node>();
List<Krawedz>k=new List<Krawedz>();