public void SameEdges <TVertex, TEdge>([PexAssumeNotNull] IVertexAndEdgeListGraph <TVertex, TEdge> g)
            where TEdge : IEdge <TVertex>
        {
            var ag = GraphExtensions.ToArrayAdjacencyGraph(g);

            PexAssert.AreElementsEqual(g.Edges, ag.Edges, (l, r) => l.Equals(r));
        }
        public void SameEdgeCount <TVertex, TEdge>([PexAssumeNotNull] IVertexAndEdgeListGraph <TVertex, TEdge> g)
            where TEdge : IEdge <TVertex>
        {
            var ag = GraphExtensions.ToArrayAdjacencyGraph(g);

            Assert.AreEqual(g.EdgeCount, ag.EdgeCount);
        }
示例#3
0
        public AdjacencyGraph <TVertex, SEquatableEdge <TVertex> > ToAdjacencyGraph04 <TVertex>(IEnumerable <SEquatableEdge <TVertex> > vertexPairs)
        {
            // TODO: add assertions to method GraphExtensionsTest.ToAdjacencyGraph04(IEnumerable`1<SEquatableEdge`1<!!0>>)
            AdjacencyGraph <TVertex, SEquatableEdge <TVertex> > result
                = GraphExtensions.ToAdjacencyGraph <TVertex>(vertexPairs);

            return(result);
        }
示例#4
0
        public UndirectedGraph <TVertex, SEquatableEdge <TVertex> > ToUndirectedGraph02 <TVertex>(IEnumerable <SEquatableEdge <TVertex> > vertexPairs)
        {
            // TODO: add assertions to method GraphExtensionsTest.ToUndirectedGraph02(IEnumerable`1<SEquatableEdge`1<!!0>>)
            UndirectedGraph <TVertex, SEquatableEdge <TVertex> > result
                = GraphExtensions.ToUndirectedGraph <TVertex>(vertexPairs);

            return(result);
        }
示例#5
0
        public AdjacencyGraph <TVertex, TEdge> ToAdjacencyGraph01 <TVertex, TEdge>(IEnumerable <TEdge> edges)
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method GraphExtensionsTest.ToAdjacencyGraph01(IEnumerable`1<!!1>)
            AdjacencyGraph <TVertex, TEdge> result
                = GraphExtensions.ToAdjacencyGraph <TVertex, TEdge>(edges);

            return(result);
        }
示例#6
0
        public AdjacencyGraph <TVertex, TEdge> ToAdjacencyGraph <TVertex, TEdge>(IEnumerable <TEdge> edges, bool allowParallelEdges)
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method GraphExtensionsTest.ToAdjacencyGraph(IEnumerable`1<!!1>, Boolean)
            AdjacencyGraph <TVertex, TEdge> result
                = GraphExtensions.ToAdjacencyGraph <TVertex, TEdge>(edges, allowParallelEdges);

            return(result);
        }
示例#7
0
        public UndirectedGraph <TVertex, TEdge> ToUndirectedGraph01 <TVertex, TEdge>(IEnumerable <TEdge> edges, bool allowParralelEdges)
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method GraphExtensionsTest.ToUndirectedGraph01(IEnumerable`1<!!1>, Boolean)
            UndirectedGraph <TVertex, TEdge> result =
                GraphExtensions.ToUndirectedGraph <TVertex, TEdge>(edges, allowParralelEdges);

            return(result);
        }
示例#8
0
        public UndirectedGraph <TVertex, TEdge> ToUndirectedGraph <TVertex, TEdge>(IEnumerable <TEdge> edges)
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method GraphExtensionsTest.ToUndirectedGraph(IEnumerable`1<!!1>)
            UndirectedGraph <TVertex, TEdge> result
                = GraphExtensions.ToUndirectedGraph <TVertex, TEdge>(edges);

            return(result);
        }
示例#9
0
        public IBidirectionalGraph <TVertex, TEdge> ToBidirectionalGraph <TVertex, TEdge>(IVertexAndEdgeListGraph <TVertex, TEdge> graph)
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method GraphExtensionsTest.ToBidirectionalGraph(IVertexAndEdgeListGraph`2<!!0,!!1>)
            IBidirectionalGraph <TVertex, TEdge> result
                = GraphExtensions.ToBidirectionalGraph <TVertex, TEdge>(graph);

            return(result);
        }
        public void SameOutEdges <TVertex, TEdge>([PexAssumeNotNull] IVertexAndEdgeListGraph <TVertex, TEdge> g)
            where TEdge : IEdge <TVertex>
        {
            var ag = GraphExtensions.ToArrayAdjacencyGraph(g);

            foreach (var v in g.Vertices)
            {
                PexAssert.AreElementsEqual(g.OutEdges(v), ag.OutEdges(v), (l, r) => l.Equals(r));
            }
        }
示例#11
0
        public AdjacencyGraph <TVertex, TEdge> ToAdjacencyGraph03 <TVertex, TEdge>(
            IEnumerable <TVertex> vertices,
            Func <TVertex, IEnumerable <TEdge> > outEdgesFactory
            )
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method GraphExtensionsTest.ToAdjacencyGraph03(IEnumerable`1<!!0>, Func`2<!!0,IEnumerable`1<!!1>>)
            AdjacencyGraph <TVertex, TEdge> result
                = GraphExtensions.ToAdjacencyGraph <TVertex, TEdge>(vertices, outEdgesFactory);

            return(result);
        }
示例#12
0
        public BidirectionalGraph <TVertex, TEdge> ToBidirectionalGraph03 <TVertex, TEdge>(
            IEnumerable <TVertex> vertices,
            Func <TVertex, IEnumerable <TEdge> > outEdgesFactory,
            bool allowParallelEdges
            )
            where TEdge : IEdge <TVertex>
        {
            // TODO: add assertions to method GraphExtensionsTest.ToBidirectionalGraph03(IEnumerable`1<!!0>, Func`2<!!0,IEnumerable`1<!!1>>, Boolean)
            BidirectionalGraph <TVertex, TEdge> result
                = GraphExtensions.ToBidirectionalGraph <TVertex, TEdge>
                      (vertices, outEdgesFactory, allowParallelEdges);

            return(result);
        }