我想使用快速图找到下图的最小生成树。我浏览了提供的手册,但我真的不明白该怎么做。这是我的代码:
static void Main(string[] args)
{
var g = new UndirectedGraph<int, TaggedUndirectedEdge<int,int>>();
var e1 = new TaggedUndirectedEdge<int, int>(1, 2, 57);
var e2 = new TaggedUndirectedEdge<int, int>(1, 4, 65);
var e3 = new TaggedUndirectedEdge<int, int>(2, 3, 500);
var e4 = new TaggedUndirectedEdge<int, int>(2, 4, 1);
var e5 = new TaggedUndirectedEdge<int, int>(3, 4, 78);
var e6 = new TaggedUndirectedEdge<int, int>(3, 5, 200);
g.AddVerticesAndEdge(e1);
g.AddVerticesAndEdge(e2);
g.AddVerticesAndEdge(e3);
g.AddVerticesAndEdge(e4);
g.AddVerticesAndEdge(e5);
g.AddVerticesAndEdge(e6);
foreach (var v in g.Edges)
Console.WriteLine(v);
}
感谢您的帮助。