Ejemplo n.º 1
0
        static void TestGraphStructure()
        {
            string pathInput  = @"C:\Users\Виктория\Desktop\graph.txt";
            string pathPrint  = @"C:\Users\Виктория\Desktop\graphViz.png";
            string pathOutput = @"C:\Users\Виктория\Desktop\out.txt";

            ListOfArcs myGrapg = new ListOfArcs(pathInput, pathOutput, pathPrint);

            #region УдалениеДобавлениеДуг
            myGrapg.Smart_Add(1, 2);
            myGrapg.PrintToGraph();

            myGrapg.Smart_Add(2, 2);
            myGrapg.PrintToGraph();

            myGrapg.Smart_Delete(1);
            myGrapg.PrintToGraph();

            myGrapg.Smart_Delete(0);
            myGrapg.PrintToGraph();

            myGrapg.Smart_Add(1, 2);
            myGrapg.PrintToGraph();

            myGrapg.PrintToFile();
            myGrapg.PrintToGraph();
            #endregion
        }
Ejemplo n.º 2
0
        static void TestBreadthFirstSearchForThreeVertexes()
        {
            string pathInput  = @"C:\Users\Виктория\Desktop\graph.txt";
            string pathPrint  = @"C:\Users\Виктория\Desktop\graphViz.png";
            string pathOutput = @"C:\Users\Виктория\Desktop\out.txt";

            ListOfArcs myGrapg = new ListOfArcs(pathInput, pathOutput, pathPrint);

            myGrapg.PrintToGraph();
            ListOfEdges edgesG = new ListOfEdges(myGrapg.QuantityVertex, myGrapg.VertexI, myGrapg.VertexJ);

            edgesG.BreadthFirstSearch(3, 4, 7);
        }