private void makeKruskall()
 {
     List<Bridge> enableBridges = new List<Bridge>();
     foreach (Bridge bridge in net.bridges) {
         foreach (Port port in bridge.ports) {
             port.isEnabled = false;
         }
         if (bridge.isEnabled) {
             enableBridges.Add(bridge);
         }
     }
     kruskall = new Kruskall(enableBridges);
     minimalCost.Text = "minimal cost = " + kruskall.makeKruskall().ToString();
 }
 private void createRandomNet()
 {
     net = new Net();
     kruskall = new Kruskall(net.bridges);
     reloadViewAfterNewNet();
 }