示例#1
0
        /// <summary>
        /// Cria um grafo não direccionado complexo para teste.
        /// </summary>
        /// <returns>O grafo.</returns>
        private EdgeListGraph <int> CreateTestGraph_Undirected()
        {
            var result = new EdgeListGraph <int>();

            for (var i = 1; i <= 10; ++i)
            {
                result.AddVertex(i);
            }

            result.AddEdge(1, 2);
            result.AddEdge(1, 4);
            result.AddEdge(4, 7);
            result.AddEdge(7, 10);
            result.AddEdge(7, 9);
            result.AddEdge(2, 5);
            result.AddEdge(3, 5);
            result.AddEdge(3, 6);
            result.AddEdge(5, 8);
            result.AddEdge(6, 7);
            result.AddEdge(6, 8);
            result.AddEdge(6, 9);

            return(result);
        }