本文整理汇总了C#中Graph.display方法的典型用法代码示例。如果您正苦于以下问题:C# Graph.display方法的具体用法?C# Graph.display怎么用?C# Graph.display使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph.display方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
Graph edgeColorTestGraph = new Graph();
Vertex v1 = new Vertex();
v1.name = "v1";
Vertex v2 = new Vertex();
v2.name = "v2";
Vertex v3 = new Vertex();
v3.name = "v3";
Vertex v4 = new Vertex();
v4.name = "v4";
Vertex v5 = new Vertex();
v5.name = "v5";
edgeColorTestGraph.AddVertex(v1);
edgeColorTestGraph.AddVertex(v2);
edgeColorTestGraph.AddVertex(v3);
edgeColorTestGraph.AddVertex(v4);
edgeColorTestGraph.AddVertex(v5);
edgeColorTestGraph.AddEdge(v1, v2);
edgeColorTestGraph.AddEdge(v1, v3);
edgeColorTestGraph.AddEdge(v1, v4);
edgeColorTestGraph.AddEdge(v2, v5);
edgeColorTestGraph.AddEdge(v3, v4);
edgeColorTestGraph.AddEdge(v5, v4);
edgeColorTestGraph.display();
edgeColorTestGraph.edgeColoring();
edgeColorTestGraph.display();
}
示例2: Main
public static void Main()
{
int s = 2; //needed to increase by one in order to skip having @ for 0
string fname = "wGraph2.txt";
Graph g = new Graph(fname);
g.display();
g.DF(s);
}
示例3: Main
public static void Main()
{
int s = 1;
string fname = "wGraph3.txt";
Graph g = new Graph(fname);
g.display();
g.DF(s);
}
示例4: Main
public static void Main( string[] args ) {
Graph g = new Graph();
Vertex pre = null;
for(int i = 0; i < 10; i++) {
Vertex v = new Vertex();
v.assignName("vertex " + i);
g.AddVertex(v);
if(pre != null) {
g.AddEdge(pre, v);
}
pre = v;
}
g.run(g.GetVertices().next());
g.display();
System.Console.In.Read();
}
示例5: Main
public static void Main()
{
int s = 1;
string fname = "wGraph3.txt";
Graph g = new Graph(fname);
g.display();
g.DF(s);
Console.WriteLine();
g.iterativeDF(s);
fname = "wGraph2.txt";
g = new Graph(fname);
g.display();
g.DF(s);
Console.WriteLine();
g.iterativeDF(s);
}
示例6: Main
public static void Main()
{
int s = 4;
int[] mst;
string fname = "myGraph.txt";
Graph g = new Graph(fname);
g.display();
Console.WriteLine();
mst = g.MST_Prim(s);
g.showMST(mst);
}
示例7: Main
public static void Main()
{
int s = 1;
string fname = "wGraph3.txt";
Graph g = new Graph(fname);
g.display();
g.BF(s);
Console.ReadLine();
}
示例8: Main
public static void Main()
{
int s = 7;
string fname = "wgraph2.txt";
Graph g = new Graph(fname);
g.display();
Console.WriteLine();
Console.WriteLine("Depth First, using Linked Lists - Recursive");
g.DF(s);
Console.WriteLine();
Console.WriteLine("Depth First, using Linked Lists - Iterative");
g.dfIter(s);
Console.ReadKey();
}