Ejemplo n.º 1
0
        public bool Test([NotNull] TVertex vertex)
        {
            if (vertex == null)
            {
                throw new ArgumentNullException(nameof(vertex));
            }

            return(_visitedGraph.IsInEdgesEmpty(vertex) &&
                   _visitedGraph.IsOutEdgesEmpty(vertex));
        }
Ejemplo n.º 2
0
 private static IEnumerable <TVertex> RootsIterator <TVertex, TEdge>(
     IBidirectionalGraph <TVertex, TEdge> visitedGraph)
     where TEdge : IEdge <TVertex>
 {
     foreach (var v in visitedGraph.Vertices)
     {
         if (visitedGraph.IsInEdgesEmpty(v))
         {
             yield return(v);
         }
     }
 }
Ejemplo n.º 3
0
        public static IEnumerable <TVertex> Roots <TVertex, TEdge>(
            IBidirectionalGraph <TVertex, TEdge> visitedGraph)
            where TEdge : IEdge <TVertex>
        {
            GraphContracts.AssumeNotNull(visitedGraph, "visitedGraph");

            foreach (var v in visitedGraph.Vertices)
            {
                if (visitedGraph.IsInEdgesEmpty(v))
                {
                    yield return(v);
                }
            }
        }