当前位置: 首页>>代码示例>>C#>>正文


C# Graph.display方法代码示例

本文整理汇总了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();
    }
开发者ID:RoDaniel,项目名称:featurehouse,代码行数:31,代码来源:EdgeColoringTest.cs

示例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);
    }
开发者ID:kieranhogan13,项目名称:C-Sharp,代码行数:11,代码来源:GraphMatrix.cs

示例3: Main

    public static void Main()
    {
        int s = 1;
        string fname = "wGraph3.txt";

        Graph g = new Graph(fname);

        g.display();

        g.DF(s);
    }
开发者ID:C12331591,项目名称:College-Work,代码行数:11,代码来源:GraphMatrix.cs

示例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();
    }
开发者ID:flaviommedeiros,项目名称:FeatureIDE,代码行数:18,代码来源:MainClass.cs

示例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);
    }
开发者ID:C12331591,项目名称:College-Work,代码行数:26,代码来源:GraphLists.cs

示例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);
    }
开发者ID:Daniel-Redmond,项目名称:College-Work,代码行数:14,代码来源:PrimSparse.cs

示例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();
    }
开发者ID:BDLazar,项目名称:Algorithms,代码行数:12,代码来源:IterativeBreathFirstSearch.cs

示例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();
    }
开发者ID:Daniel-Redmond,项目名称:College-Work,代码行数:16,代码来源:GraphLists.cs


注:本文中的Graph.display方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。