本文整理汇总了C#中Graph.Print方法的典型用法代码示例。如果您正苦于以下问题:C# Graph.Print方法的具体用法?C# Graph.Print怎么用?C# Graph.Print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph.Print方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
System.Console.Out.WriteLine("========= BasicGraph ========");
Graph g = new Graph();
g.Add(new Node(1), new Node(2));
g.Add(new Node(3), new Node(4));
g.Print();
System.Console.Out.WriteLine();
}
示例2: Main
static void Main(string[] args)
{
Graph web = new Graph();
web.AddNode(id:"80 Feet Road", data:null);
web.AddNode(id: "CMH Road", data: null);
web.AddNode(id: "Halasaru", data: null);
web.AddNode(id: "Trinity", data: null);
web.AddNode(id: "MG Road", data: null);
web.AddNode(id: "100 Feet Road", data: null);
web.AddNode(id: "Domlur Flyover", data: null);
web.AddNode(id: "Victoria Road", data: null);
web.AddEdge(web.Nodes["80 Feet Road"], web.Nodes["CMH Road"]);
web.AddEdge(web.Nodes["CMH Road"], web.Nodes["Halasaru"]);
web.AddEdge(web.Nodes["Halasaru"], web.Nodes["Trinity"]);
web.AddEdge(web.Nodes["Trinity"], web.Nodes["MG Road"]);
web.AddEdge(web.Nodes["80 Feet Road"], web.Nodes["100 Feet Road"]);
web.AddEdge(web.Nodes["100 Feet Road"], web.Nodes["Domlur Flyover"]);
web.AddEdge(web.Nodes["Domlur Flyover"], web.Nodes["Victoria Road"]);
web.AddEdge(web.Nodes["Victoria Road"], web.Nodes["Trinity"]);
web.Print();
}
示例3: Main
static void Main()
{
Graph graph = new Graph();
graph.Read();
graph.Print();
}