コード例 #1
0
        internal Pseudograph(
            IReadOnlyAdjacencyLists <T, IReadOnlyCollection <E>, E> adjacencyLists,
            IReadOnlyCollection <E> edges)
        {
            this.adjacencyLists = adjacencyLists;

            this.Vertices = new CollectionSetAdapter <T>(this.adjacencyLists.Keys);
            this.Edges    = edges;
        }
コード例 #2
0
 public static IEnumerable <StronglyConnected.IReadOnlyGraph <T, W, E> > CalculateStronglyConnectedComponents <T, W, E, L>(
     IReadOnlyAdjacencyLists <T, L, E> adjacencyLists,
     IReadOnlySet <E> edgeSet)
     where E : IReadOnlyEdge <T, W>
     where L : IReadOnlyCollection <E>
 {
     // TODO: Implement Tarjan's algorithm
     throw new NotImplementedException();
 }
コード例 #3
0
 public static IEnumerable <StronglyConnected.IReadOnlyPseudograph <T, W, E> > CalculateStronglyConnectedComponents <T, W, E, L>(
     IReadOnlyAdjacencyLists <T, L, E> adjacencyLists,
     IReadOnlyCollection <E> edgeCollection)
     where E : IReadOnlyEdge <T, W>
     where L : IReadOnlyCollection <E>
 {
     // A pseudograph is just a graph with parallel edges, so the algorithm for calculating the strongly
     // connected components shouldn't be any different than the algorithm for a regular graph. Could probably
     // figure out some way of calling the normal IReadOnlyGraph version here.
     throw new NotImplementedException();
 }
コード例 #4
0
 public static IEnumerable <WeaklyConnected.IReadOnlyGraph <T, W, E> > CalculateWeaklyConnectedComponents <T, W, E, L>(
     IReadOnlyAdjacencyLists <T, L, E> adjacencyLists,
     IReadOnlySet <E> edgeSet)
     where E : IReadOnlyEdge <T, W>
     where L : IReadOnlyCollection <E>
 {
     // TODO: A directed graph's weakly connected components are the same as an undirected graph's connected
     // components. So, to calculate the weakly connected components, we can just ignore the directionality of
     // the supplied edges and perform an undirected DFS.
     throw new NotImplementedException();
 }