public void MST1() { GraphTheory g = new GraphTheory(); int[,] input = new int[6, 6]; input[1, 2] = 8; input[2, 1] = 8; input[1, 3] = 32; input[3, 1] = 32; input[2, 3] = 2; input[3, 2] = 2; input[2, 4] = 4; input[4, 2] = 4; input[3, 4] = 16; input[4, 3] = 16; input[4, 5] = 1; input[5, 5] = 1; //var gt = g.BuildGraph(input, 5); Assert.AreEqual(15, g.MST(input, 5)); }
public void MST() { GraphTheory g = new GraphTheory(); int[,] input = new int[6, 6]; input[1, 2] = 2; input[2, 1] = 2; input[1, 4] = 6; input[4, 1] = 6; input[2, 3] = 3; input[3, 2] = 3; input[2, 4] = 8; input[4, 2] = 8; input[2, 5] = 5; input[5, 2] = 5; input[3, 5] = 7; input[5, 3] = 7; input[4, 5] = 9; input[5, 5] = 9; //var g = d.BuildGraph(input, 5); Assert.AreEqual(16, g.MST(input, 5)); }