QuickGraph A graph with vertices of type and edges of type type of the vertices type of the edges Gets a value indicating if the graph is directed Gets a value indicating if the graph allows parallel edges Underlying filtered graph Edge predicate used to filter the edges An event involving an edge. The type of the vertex. The type of the edge. Initializes a new instance of the class. The edge. edge != null Gets the edge. The edge. The handler for events involving edges type of the vertices type of the edges A mutable indirect graph A mutable edge list graph. the vertex type the edge type A mutable graph instance type of the vertices type of the edges Clears the vertex and edges Called when the graph vertices and edges have been cleared. A graph whose edges can be enumerated type of the vertices type of the edges A set of edges The type of the vertex. The type of the edge. Determines whether the specified edge contains edge. The edge. true if the specified edge contains edge; otherwise, false. edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) Gets a value indicating whether there are no edges in this set. true if this set is empty; otherwise, false. Contract.Result<bool>() == (ithis.EdgeCount == 0) Gets the edge count. The edge count. Contract.Result<int>() == Enumerable.Count(ithis.Edges) Gets the edges. The edges. Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) A set of vertices type of the vertices An implicit set of vertices type of the vertices Determines whether the specified vertex contains vertex. The vertex. true if the specified vertex contains vertex; otherwise, false. vertex != null Gets a value indicating whether there are no vertices in this set. true if the vertex set is empty; otherwise, false. Contract.Result<bool>() == (ithis.VertexCount == 0) Gets the vertex count. The vertex count. Contract.Result<int>() == Enumerable.Count(ithis.Vertices) Gets the vertices. The vertices. Contract.Result<IEnumerable<TVertex>>() != null Adds the edge to the graph true if the edge was added, otherwise false. e != null ithis.ContainsVertex(e.Source) ithis.ContainsVertex(e.Target) ithis.ContainsEdge(e) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) Adds a set of edges to the graph. the number of edges successfully added to the graph. edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) Enumerable.All(edges, edge => ithis.ContainsVertex(edge.Source) && ithis.ContainsVertex(edge.Target) ) Enumerable.All(edges, edge => ithis.ContainsEdge(edge)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(edges, edge => !ithis.ContainsEdge(edge))) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() Removes from the graph true if was successfully removed; otherwise false. e != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsEdge(e)) !ithis.ContainsEdge(e) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - (Contract.Result<bool>() ? 1 : 0) Removes all edges that match . A pure delegate that takes an and returns true if the edge should be removed. the number of edges removed. predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Edges, e => predicate(e))) Enumerable.All(ithis.Edges, e => !predicate(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.Result<int>() Raised when an edge is added to the graph. Raised when an edge has been removed from the graph. A mutable vertex set An undirected graph A mutable vertex and edge set Adds the vertices and edge to the graph. true if the edge was added, otherwise false. edge != null ithis.ContainsEdge(edge) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(edge)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) Adds a set of edges (and it's vertices if necessary) the number of edges added. edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() A implicit directed graph datastructure The type of the vertex. The type of the edge. Determines whether there are out-edges associated to . The vertex. true if has no out-edges; otherwise, false. v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) Gets the count of out-edges of The vertex. The count of out-edges of v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) Gets the out-edges of . The vertex. An enumeration of the out-edges of . v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) Tries to get the out-edges of v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) Gets the out-edge of at position . The vertex. The index. The out-edge at position v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) An struct based implementation. The type of the vertex. An undirected edge. Invariant: source must be less or equal to target (using the default comparer) type of the vertices A directed edge type of the vertices Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null Initializes a new instance of the class. The source. The target. source != null target != null Comparer<TVertex>.Default.Compare(source, target) <= 0 Contract.ValueAtReturn(out this).Source.Equals(source) Contract.ValueAtReturn(out this).Target.Equals(target) Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Contract.Result<bool>() == (this.Source.Equals(other.Source) && this.Target.Equals(other.Target)) Indicates whether this instance and a specified object are equal. Another object to compare to. true if and this instance are the same type and represent the same value; otherwise, false. Returns the hash code for this instance. A 32-bit signed integer that is the hash code for this instance. Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null A functional implicit undirected graph type of the vertices type of the edges Interface implemented by graph services A edge depth first search algorithm for directed graphs This is a variant of the classic DFS algorithm where the edges are color marked instead of the vertices. Creates a new algorithm with an (optional) host. if null, host is set to the this reference visitedGraph != null A reversed edge type of the vertices type of the edges A directed graph datastructure where out-edges can be traversed, i.e. a vertex set + implicit graph. The type of the vertex. The type of the edge. An struct based implementation. type of the vertex. type of the tag An instance holding a tag Gets or sets the tag Raised when the tag is changed Initializes a new instance of the class. The source. The target. The tag. source != null target != null Comparer<TVertex>.Default.Compare(source, target) <= 0 Contract.ValueAtReturn(out this).Source.Equals(source) Contract.ValueAtReturn(out this).Target.Equals(target) Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null A disjoint-set data structure Creates a new set for the value value != null !ithis.Contains(value) ithis.Contains(value) ithis.SetCount == Contract.OldValue(ithis.SetCount) + 1 ithis.ElementCount == Contract.OldValue(ithis.ElementCount) + 1 Finds the set containing the value value != null ithis.Contains(value) Gets a value indicating if left and right are contained in the same set left != null right != null ithis.Contains(left) ithis.Contains(right) Merges the sets from the two values true if left and right were unioned, false if they already belong to the same set left != null ithis.Contains(left) right != null ithis.Contains(right) Gets a value indicating whether the value is in the data structure Gets the current number of sets Gets the current number of elements. A single-source shortest path algorithm for undirected graph with positive distance. Raises the event. edge that raised the event Invoked when the distance label for the target vertex is decreased. The edge that participated in the last relaxation for vertex v is an edge in the shortest paths tree. An algorithm that exposes events to compute a distance map between vertices type of the vertices type of the edges A* single-source shortest path algorithm for directed graph with positive distance. type of a vertex type of an edge Raises the event. edge that raised the event Invoked when the distance label for the target vertex is decreased. The edge that participated in the last relaxation for vertex v is an edge in the shortest paths tree. Wilson-Propp Cycle-Popping Algorithm for Random Tree Generation. Gets or sets the random number generator used in RandomTree. number generator value != null An struct based implementation. The type of the vertex. Initializes a new instance of the class. The source. The target. source != null target != null Contract.ValueAtReturn(out this).Source.Equals(source) Contract.ValueAtReturn(out this).Target.Equals(target) Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null A mutable vertex list graph A mutable incidence graph Removes all out edges of where evalutes to true. v != null ithis.ContainsVertex(v) predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.OutEdges(v), ve => predicate(ve))) Enumerable.All(ithis.OutEdges(v), ve => !predicate(ve)) Trims the out edges of vertex v != null ithis.ContainsVertex(v) ithis.OutDegree(v) == 0 Trims excess storage allocated for edges type of a vertex type of an edge An algorithm observer type of the algorithm Attaches to the algorithm events and returns a disposable object that can be used to detach from the events algorithm != null Contract.Result<IDisposable>() != null Edmond and Karp maximum flow algorithm for directed graph with positive capacities and flows. type of a vertex type of an edge Abstract base class for maximum flow algorithms. Computes the maximum flow between Source and Sink. The default implementation. The type of the vertex. Initializes a new instance of the class. The source. The target. source != null target != null this.Source.Equals(source) this.Target.Equals(target) Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null A mutable directed graph data structure efficient for sparse graph representation where out-edge need to be enumerated only. type of the vertices type of the edges this.edgeCount >= 0 A directed graph where vertices and edges can be enumerated efficiently. type of the vertices type of the edges An incidence graph whose edges can be enumerated type of the vertices type of the edges A mutable vertex and edge list graph Adds a range of edges to the graph the count edges that were added edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() Adds the edge to the graph the edge to add true if the edge was added; false if it was already part of the graph e != null ithis.ContainsVertex(e.Source) ithis.ContainsVertex(e.Target) ithis.ContainsEdge(e) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) Gets a value indicating whether this instance is edges empty. true if this instance is edges empty; otherwise, false. Contract.Result<bool>() == (ithis.EdgeCount == 0) Gets the edge count. The edge count. Contract.Result<int>() == Enumerable.Count(ithis.Edges) Gets the edges. The edges. Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) A mutable bidirectional directed graph type of the vertices type of the edges A directed graph datastructure that is efficient to traverse both in and out edges. The type of the vertex. The type of the edge. A directed graph datastructure that is efficient to traverse both in and out edges. The type of the vertex. The type of the edge. Determines whether has no in-edges. The vertex true if has no in-edges; otherwise, false. v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) Gets the number of in-edges of The vertex. The number of in-edges pointing towards v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) Gets the collection of in-edges of . The vertex The collection of in-edges of v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) Tries to get the in-edges of v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) Gets the in-edge at location . The vertex. The index. v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) Gets the degree of , i.e. the sum of the out-degree and in-degree of . The vertex The sum of OutDegree and InDegree of v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) Removes in-edges of that match predicate . Number of edges removed v != null predicate != null ithis.ContainsVertex(v) ithis.ContainsVertex(v) Enumerable.All(ithis.InEdges(v), e => predicate(e)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.InEdges(v), e => predicate(e))) ithis.InDegree(v) == Contract.OldValue(ithis.InDegree(v)) - Contract.Result<int>() Clears in-edges of v != null ithis.ContainsVertex(v) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.OldValue(ithis.InDegree(v)) ithis.InDegree(v) == 0 Clears in-edges and out-edges of v != null ithis.ContainsVertex(v) !ithis.ContainsVertex(v) An struct based implementation. The type of the vertex. Initializes a new instance of the class. The source. The target. source != null target != null Contract.ValueAtReturn(out this).Source.Equals(source) Contract.ValueAtReturn(out this).Target.Equals(target) Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Contract.Result<bool>() == (this.Source.Equals(other.Source) && this.Target.Equals(other.Target)) Indicates whether this instance and a specified object are equal. Another object to compare to. true if and this instance are the same type and represent the same value; otherwise, false. Returns the hash code for this instance. A 32-bit signed integer that is the hash code for this instance. Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null A dictionary of vertices to a list of edges Gets a clone of the dictionary. The vertices and edges are not cloned. Contract.Result<IVertexEdgeDictionary<TVertex, TEdge>>() != null A edge depth first search algorithm for implicit directed graphs This is a variant of the classic DFS where the edges are color marked. Triggers the StartVertex event. Triggers the StartEdge event. Triggers DiscoverEdge event Triggers the TreeEdge event. Triggers the BackEdge event. Triggers the ForwardOrCrossEdge event. Triggers the ForwardOrCrossEdge event. Does a depth first search on the vertex u edge to explore current exploration depth se cannot be null se != null depth >= 0 Initializes the algorithm before computation. Gets the vertex color map Vertex color () dictionary Gets or sets the maximum exploration depth, from the start vertex. Defaulted at int.MaxValue. Maximum exploration depth. Invoked on the source vertex once before the start of the search. Invoked on the first edge of a test case Invoked on each edge as it becomes a member of the edges that form the search tree. If you wish to record predecessors, do so at this event point. Invoked on the back edges in the graph. Invoked on forward or cross edges in the graph. (In an undirected graph this method is never called.) Invoked on a edge after all of its out edges have been added to the search tree and all of the adjacent vertices have been discovered (but before their out-edges have been examined). An edge factory delegate Extension methods for populating graph datastructures Wraps a dictionary into a vertex and edge list graph type of the vertices type of the edges dictionary != null Enumerable.All(dictionary.Values, v => v != null) Wraps a dictionary into a vertex and edge list graph type of the vertices type of the edges dictionary != null keyValueToOutEdges != null Creates an instance of DelegateIncidenceGraph. type of the vertices type of the edges tryGetOutEdges != null Creates an instance of DelegateIncidenceGraph. type of the vertices type of the edges tryGetOutEdges != null tryGetInEdges != null Creates an instance of DelegateIncidenceGraph. type of the vertices type of the edges getOutEdges != null Converts a Func that returns a reference type into a tryfunc func != null Creates an instance of DelegateIncidenceGraph. type of the vertices type of the edges vertices != null tryGetOutEdges != null Enumerable.All(vertices, v => { IEnumerable<TEdge> edges; return tryGetOutEdges(v, out edges); }) Creates an instance of DelegateIncidenceGraph. type of the vertices type of the edges vertices != null getOutEdges != null Wraps a dictionary into an undirected list graph type of the vertices type of the edges dictionary != null Enumerable.All(dictionary.Values, v => v != null) Wraps a dictionary into an undirected graph type of the vertices type of the edges dictionary != null keyValueToOutEdges != null Creates an instance of DelegateIncidenceGraph. type of the vertices type of the edges vertices != null tryGetAdjacentEdges != null Enumerable.All(vertices, v => { IEnumerable<TEdge> edges; return tryGetAdjacentEdges(v, out edges); }) Creates an instance of DelegateIncidenceGraph. type of the vertices type of the edges vertices != null getAdjacentEdges != null Converts a jagged array of sources and targets into a graph edges != null edges.Length == 2 edges[0] != null edges[1] != null edges[0].Length == edges[1].Length Contract.Result<AdjacencyGraph<TVertex, SEquatableEdge<TVertex>>>() != null Creates an immutable array adjacency graph from the input graph type of the vertices type of the edges graph != null Creates an immutable array bidirectional graph from the input graph type of the vertices type of the edges graph != null Creates an immutable array undirected graph from the input graph type of the vertices type of the edges graph != null Wraps a adjacency graph (out-edge only) into a bidirectional graph. type of the vertices type of the edges graph != null Converts a sequence of edges into an undirected graph type of the vertices type of the edges edges != null Enumerable.All(edges, e => e != null) Converts a sequence of edges into an undirected graph type of the vertices type of the edges edges != null Enumerable.All(edges, e => e != null) Converts a set of edges into a bidirectional graph. The type of the vertex. The type of the edge. The edges. if set to true, the graph allows parallel edges. edges != null EnumerableContract.ElementsNotNull(edges) Converts a set of edges into a bidirectional graph. The type of the vertex. The type of the edge. The edges. edges != null EnumerableContract.ElementsNotNull(edges) Converts a set of edges into an adjacency graph. The type of the vertex. The type of the edge. The edges. if set to true, the graph allows parallel edges. edges != null EnumerableContract.ElementsNotNull(edges) Converts a set of edges into an adjacency graph. The type of the vertex. The type of the edge. The edges. edges != null EnumerableContract.ElementsNotNull(edges) Converts a set of vertices into an adjacency graph, using an edge factory. The type of the vertex. The type of the edge. The vertices. The out edges factory. if set to true, the graph allows parallel edges. vertices != null outEdgesFactory != null EnumerableContract.ElementsNotNull(vertices) Converts a set of vertices into an adjacency graph, using an edge factory. The type of the vertex. The type of the edge. The vertices. The out edges factory. Converts a set of vertices into a bidirectional graph, using an edge factory. The type of the vertex. The type of the edge. The vertices. The out edges factory. if set to true, the graph allows parallel edges. vertices != null outEdgesFactory != null EnumerableContract.ElementsNotNull(vertices) Converts a set of vertices into a bidirectional graph, using an edge factory The type of the vertex. The type of the edge. The vertices. The out edges factory. Converts a sequence of vertex pairs into an adjancency graph type of the vertices vertexPairs != null Converts a sequence of vertex pairs into an bidirectional graph type of the vertices vertexPairs != null Converts a sequence of vertex pairs into an bidirectional graph type of the vertices vertexPairs != null Creates an immutable compressed row graph representation of the visited graph type of the vertices type of the edges visitedGraph != null Debug only assertions and assumptions A tagged undirected edge. The type of the vertex. Type type of the tag The default implementation. The type of the vertex. Initializes a new instance of the class. The source. The target. source != null target != null Comparer<TVertex>.Default.Compare(source, target) <= 0 this.source.Equals(source) this.target.Equals(target) Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null Initializes a new instance of the class. The source. The target. the tag Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Raised when the tag is changed Gets or sets the tag Binary heap Indexing rules: parent index: index ¡ 1)/2 left child: 2 * index + 1 right child: 2 * index + 2 Reference: http://dotnetslackers.com/Community/files/folders/data-structures-and-algorithms/entry28722.aspx type of the value type of the priority metric Floyd-Warshall all shortest path algorith, type of the vertices type of the edges Dijkstra single-source shortest path algorithm for directed graph with positive distance. type of a vertex type of an edge Common services available to algorithm instances Residual capacities map Reversed edges map Colors used in vertex coloring algorithms Usually initial color, Usually intermidiate color, Usually finished color A mutable directed graph data structure efficient for sparse graph representation where out-edge and in-edges need to be enumerated. Requires twice as much memory as the adjacency graph. type of the vertices type of the edges A delegate-based incidence graph type of the vertices type of the edges A delegate-based implicit graph type of the vertices type of the edges Specifies the order in which a Heap will Dequeue items. Items are Dequeued in Increasing order from least to greatest. Items are Dequeued in Decreasing order, from greatest to least. Performs an action on each item in a list, used to shortcut a "foreach" loop Type contained in List List to enumerate over Lambda Function to be performed on all elements in List Performs an action on each item in a list, used to shortcut a "foreach" loop Type contained in List List to enumerate over Lambda Function to be performed on all elements in List Determines of a Node has had a child cut from it before Determines the depth of a node Updates the degree of a node, cascading to update the degree of the parents if nessecary parentNode != null Updates the Next pointer, maintaining the heap by folding duplicate heap degrees into eachother Takes O(lg(N)) time amortized Given two nodes, adds the child node as a child of the parent node parentNode != null childNode != null A breath first search algorithm for undirected graphs A cloneable edge type of the vertex type of the edge Clones the edge content to a different pair of and vertices The source vertex of the new edge The target vertex of the new edge A clone of the edge with new source and target vertices source != null target != null Contract.Result<TEdge>() != null Contract.Result<TEdge>().Source.Equals(source) Contract.Result<TEdge>().Target.Equals(target) Gets the parent of is the root of the graph. Gets the parent of is the root of the graph. Gets a value indicating if is a cross edge. Gets a value indicating whether exists really or is just an induced edge. Gets a value indicating if is a predecessor of true if is a predecessor of Gets the number of edges between and . is a predecessor of or the otherway round. Gets a value indicating if is inner node or a leaf. true if not a leaf Gets the collection of children from Gets the collection of children from Gets the roots of the hierarchy Ensures that System.Diagnostics.Contracts namespace exists A cloneable list of edges Trims excess allocated space Gets a clone of this list Contract.Result<IEdgeList<TVertex, TEdge>>() != null A depth and height first search algorithm for directed graphs This is a modified version of the classic DFS algorithm where the search is performed both in depth and height. Computes the dominator map of a directed graph Thomas Lengauer and Robert Endre Tarjan A fast algorithm for finding dominators in a flowgraph ACM Transactions on Programming Language and Systems, 1(1):121-141, 1979. type of the vertices type of the edges A functional implicit undirected graph type of the vertices type of the edges Directed graph representation using a Compressed Sparse Row representation (http://www.cs.utk.edu/~dongarra/etemplates/node373.html) type of the vertices type of a vertex type of an edge A depth first search algorithm for implicit directed graphs Raises the event. vertex that raised the event Raises the event. vertex that raised the event Raises the event. edge that raised the event Raises the event. edge that raised the event Raises the event. edge that raised the event Raises the event. edge that raised the event Raises the event. vertex that raised the event Gets the vertex color map Vertex color () dictionary Gets or sets the maximum exploration depth, from the start vertex. Defaulted at int.MaxValue. Maximum exploration depth. Invoked on the source vertex once before the start of the search. Invoked when a vertex is encountered for the first time. Invoked on every out-edge of each vertex after it is discovered. Invoked on each edge as it becomes a member of the edges that form the search tree. If you wish to record predecessors, do so at this event point. Invoked on the back edges in the graph. Invoked on forward or cross edges in the graph. (In an undirected graph this method is never called.) Invoked on a vertex after all of its out edges have been added to the search tree and all of the adjacent vertices have been discovered (but before their out-edges have been examined). A depth first search algorithm for directed graph type of a vertex type of an edge Initializes a new instance of the algorithm. visited graph Initializes a new instance of the algorithm. visited graph vertex color map Initializes a new instance of the algorithm. algorithm host visited graph vertex color map Initializes a new instance of the algorithm. algorithm host visited graph vertex color map Delegate that takes the enumeration of out-edges and reorders them. All vertices passed to the method should be enumerated once and only once. May be null. colors != null adjacentEdgeEnumerator != null An equatable, tagged, edge type of the vertices An equatable edge implementation type of the vertices A tagged edge as value type. type of the vertices Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Indicates whether the current object is equal to another object of the same type. An object to compare with this object. true if the current object is equal to the parameter; otherwise, false. Contract.Result<bool>() == (this.Source.Equals(other.Source) && this.Target.Equals(other.Target)) Indicates whether this instance and a specified object are equal. Another object to compare to. true if and this instance are the same type and represent the same value; otherwise, false. Returns the hash code for this instance. A 32-bit signed integer that is the hash code for this instance. A delegate based bidirectional implicit graph An immutable undirected graph data structure based on arrays. type of the vertices type of the edges Returns self type of a vertex type of an edge Offline least common ancestor in a rooted tre Reference: Gabow, H. N. and Tarjan, R. E. 1983. A linear-time algorithm for a special case of disjoint set union. In Proceedings of the Fifteenth Annual ACM Symposium on theory of Computing STOC '83. ACM, New York, NY, 246-251. DOI= http://doi.acm.org/10.1145/800061.808753 type of the vertices type of the edges A single-source shortest path algorithm for directed acyclic graph. type of a vertex type of an edge Bellman Ford shortest path algorithm. The Bellman-Ford algorithm solves the single-source shortest paths problem for a graph with both positive and negative edge weights. If you only need to solve the shortest paths problem for positive edge weights, Dijkstra's algorithm provides a more efficient alternative. If all the edge weights are all equal to one then breadth-first search provides an even more efficient alternative. Raises the event. vertex that raised the event Raises the event. edge that raised the event Raises the event. edge that raised the event Raises the event. edge that raised the event Raises the event. edge that raised the event Applies the Bellman Ford algorithm Does not initialize the predecessor and distance map. Indicates if a negative cycle was found Invoked on each vertex in the graph before the start of the algorithm. Invoked on every edge in the graph |V| times. Invoked if the distance label for the target vertex is not decreased. Invoked during the second stage of the algorithm, during the test of whether each edge was minimized. If the edge is minimized then this function is invoked. Invoked during the second stage of the algorithm, during the test of whether each edge was minimized. If the edge was not minimized, this function is invoked. This happens when there is a negative cycle in the graph. Constructed predecessor map Requests the component to cancel its computation Resets the cancel state Raised when the cancel method is called Gets a value indicating if a cancellation request is pending. Raised when the cancel state has been reseted Resets the cancel state Raised when the cancel state has been reseted Best first frontier search Algorithm from Frontier Search, Korkf, Zhand, Thayer, Hohwald. type of the vertices type of the edges This algorithm modifies a bipartite graph into a related graph, where each Vertex in one partition is connected to a newly added "SuperSource" and each Vertex in the other partition is connected to a newly added "SuperSink" When the maximum flow of this related graph is computed, the edges used for the flow are also those which make up the maximum match for the bipartite graph. An edge factory Disjoint-set implementation with path compression and union-by-rank optimizations. optimization this.setCount >= 0 this.setCount <= this.elements.Count Adds a new set value != null !ithis.Contains(value) ithis.Contains(value) ithis.SetCount == Contract.OldValue(ithis.SetCount) + 1 ithis.ElementCount == Contract.OldValue(ithis.ElementCount) + 1 Finds the parent element, and applies path compression element != null Contract.Result<Element>() != null An immutable directed graph data structure efficient for large sparse graph representation where out-edge need to be enumerated only. type of the vertices type of the edges Returns self since this class is immutable type of a vertex type of an edge A factory of identifiable edges. A tagged edge as value type. type of the vertices Returns a that represents the current . A that represents the current . Contract.Result<string>() != null An immutable directed graph data structure efficient for large sparse graph representation where out-edge need to be enumerated only. type of the vertices type of the edges Constructs a new ArrayBidirectionalGraph instance from a IBidirectionalGraph instance visitedGraph != null Returns self since this class is immutable A depth first search algorithm for directed graph type of a vertex type of an edge this.MaxDepth > 0 Initializes a new instance of the algorithm. visited graph Initializes a new instance of the algorithm. visited graph vertex color map Initializes a new instance of the algorithm. algorithm host visited graph Initializes a new instance of the algorithm. algorithm host visited graph vertex color map Initializes a new instance of the algorithm. algorithm host visited graph vertex color map Delegate that takes the enumeration of out-edges and reorders them. All vertices passed to the method should be enumerated once and only once. May be null. colors != null outEdgeEnumerator != null Construct an eulerian trail builder Looks for a new path to add to the current vertex. true if found a new path, false otherwize Computes the number of eulerian trail in the graph. number of eulerian trails g != null Merges the temporary circuit with the current circuit true if all the graph edges are in the circuit Adds temporary edges to the graph to make all vertex even. Removes temporary edges Computes the set of eulerian trails that traverse the edge set. This method returns a set of disjoint eulerian trails. This set of trails spans the entire set of edges. Eulerian trail set Computes a set of eulerian trail, starting at that spans the entire graph. This method computes a set of eulerian trail starting at that spans the entire graph.The algorithm outline is as follows: The algorithms iterates throught the Eulerian circuit of the augmented graph (the augmented graph is the graph with additional edges to make the number of odd vertices even). If the current edge is not temporary, it is added to the current trail. If the current edge is temporary, the current trail is finished and added to the trail collection. The shortest path between the start vertex and the target vertex of the temporary edge is then used to start the new trail. This shortest path is computed using the BreadthFirstSearchAlgorithm. start vertex eulerian trail set, all starting at s s is a null reference. Eulerian trail not computed yet. s != null type of a vertex type of an edge Various extension methods to build algorithms Returns the method that implement the access indexer. dictionary != null Contract.Result<Func<TKey, TValue>>() != null Gets the vertex identity. Returns more efficient methods for primitive types, otherwise builds a dictionary The type of the vertex. The graph. graph != null Gets the edge identity. The type of the vertex. The type of the edge. The graph. graph != null Computes a depth first tree. The type of the vertex. The type of the edge. The visited graph. The root. visitedGraph != null root != null visitedGraph.ContainsVertex(root) Contract.Result<TryFunc<TVertex, IEnumerable<TEdge>>>() != null Computes the k-shortest path from using Hoffman-Pavley algorithm. type of the vertices type of the edges visitedGraph != null edgeWeights != null source != null && visitedGraph.ContainsVertex(source) target != null && visitedGraph.ContainsVertex(target) pathCount > 1 Gets the list of sink vertices type of the vertices type of the edges visitedGraph != null Gets the list of root vertices type of the vertices type of the edges visitedGraph != null Gets the list of isolated vertices (no incoming or outcoming vertices) type of the vertices type of the edges visitedGraph != null Gets the list of roots type of the vertices type of the edges visitedGraph != null Creates a topological sort of a undirected acyclic graph. type of the vertices type of the edges the input graph has a cycle visitedGraph != null Creates a topological sort of a undirected acyclic graph. type of the vertices type of the edges the input graph has a cycle visitedGraph != null vertices != null Creates a topological sort of a directed acyclic graph. type of the vertices type of the edges the input graph has a cycle visitedGraph != null Creates a topological sort of a directed acyclic graph. type of the vertices type of the edges the input graph has a cycle visitedGraph != null vertices != null Computes the connected components of a graph type of the vertices type of the edges number of components g != null components != null Computes the incremental connected components for a growing graph (edge added only). Each call to the delegate re-computes the component dictionary. The returned dictionary is shared accross multiple calls of the method. type of the vertices type of the edges g != null Computes the weakly connected components of a graph type of the vertices type of the edges number of components g != null components != null Computes the strongly connected components of a graph type of the vertices type of the edges number of components g != null Contract.ValueAtReturn(out components) != null Clones a graph to another graph type of the vertices type of the edges g != null vertexCloner != null edgeCloner != null clone != null Condensates the strongly connected components of a directed graph type of the vertices type of the edges g != null Condensates the weakly connected components of a graph type of the vertices type of the edges g != null Create a collection of odd vertices graph to visit colleciton of odd vertices g is a null reference g != null Gets a value indicating whether the graph is acyclic Performs a depth first search to look for cycles. type of the vertices type of the edges g != null Given a edge cost map, computes the predecessor cost. type of the vertices type of the edges predecessors != null edgeCosts != null Computes the minimum spanning tree using Prim's algorithm. Prim's algorithm is simply implemented by calling Dijkstra shortest path. type of the vertices type of the edges visitedGraph != null weights != null Computes the minimum spanning tree using Kruskal's algorithm. type of the vertices type of the edges visitedGraph != null weights != null Computes the offline least common ancestor between pairs of vertices in a rooted tree using Tarjan algorithm. Reference: Gabow, H. N. and Tarjan, R. E. 1983. A linear-time algorithm for a special case of disjoint set union. In Proceedings of the Fifteenth Annual ACM Symposium on theory of Computing STOC '83. ACM, New York, NY, 246-251. DOI= http://doi.acm.org/10.1145/800061.808753 type of the vertices type of the edges visitedGraph != null root != null pairs != null visitedGraph.ContainsVertex(root) Enumerable.All(pairs, p => visitedGraph.ContainsVertex(p.Source)) Enumerable.All(pairs, p => visitedGraph.ContainsVertex(p.Target)) Computes the Edmonds-Karp maximums flow for a graph with positive capacities and flows. The type of the vertex. The type of the edge. The visited graph. The edge capacities. The source. The sink. The flow predecessors. the edge factory visitedGraph != null edgeCapacities != null source != null sink != null !source.Equals(sink) A distance recorder for directed tree builder algorithms type of a vertex type of an edge The handler for events involving two edges Gets a copy of the connected components. Key is the number of components, Value contains the vertex -> component index map. Contract.Result<KeyValuePair<int, IDictionary<TVertex, int>>>().Key == this.ComponentCount Contract.Result<KeyValuePair<int, IDictionary<TVertex, int>>>().Value.Count == this.VisitedGraph.VertexCount The computation state of a graph algorithm The algorithm is not running The algorithm is running An abort has been requested. The algorithm is still running and will cancel as soon as it checks the cancelation state The computation is finished succesfully. The computation was aborted Used internally Gets a value indicating if the edge is a self edge. type of the vertices type of the edges edge != null Contract.Result<bool>() == (edge.Source.Equals(edge.Target)) Given a source vertex, returns the other vertex in the edge type of the vertices type of the edges must not be a self-edge edge != null vertex != null !edge.Source.Equals(edge.Target) edge.Source.Equals(vertex) || edge.Target.Equals(vertex) Contract.Result<TVertex>() != null Contract.Result<TVertex>().Equals(edge.Source.Equals(vertex) ? edge.Target : edge.Source) Gets a value indicating if is adjacent to (is the source or target). type of the vertices type of the edges edge != null vertex != null Creates a vertex pair (source, target) from the edge type of the vertices type of the edges edge != null Contract.Result<SEquatableEdge<TVertex>>().Source.Equals(edge.Source) Contract.Result<SEquatableEdge<TVertex>>().Target.Equals(edge.Target) Checks that is a predecessor of type of the vertices type of the edges predecessors != null root != null vertex != null typeof(TEdge).IsValueType || Enumerable.All(predecessors.Values, e => e != null) Tries to get the predecessor path, if reachable. type of the vertices type of the edges predecessors != null v != null typeof(TEdge).IsValueType || Enumerable.All(predecessors.Values, e => e != null) !Contract.Result<bool>() || (Contract.ValueAtReturn<IEnumerable<TEdge>>(out result) != null && (typeof(TEdge).IsValueType || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out result), e => e != null)) ) Returns the most efficient comporer for the particular type of TEdge. If TEdge implements IUndirectedEdge, then only the (source,target) pair has to be compared; if not, (source, target) and (target, source) have to be compared. type of the vertices type of the edges Gets a value indicating if the vertices of edge match (source, target) or (target, source) type of the vertices type of the edges edge != null source != null target != null Gets a value indicating if the vertices of edge match (source, target) type of the vertices type of the edges edge != null source != null target != null Comparer<TVertex>.Default.Compare(source, target) <= 0 Returns a reversed edge enumeration Wraps a vertex list graph (out-edges only) and caches the in-edge dictionary. type of the vertices type of the edges Hoffman and Pavley K-shortest path algorithm. Reference: Hoffman, W. and Pavley, R. 1959. A Method for the Solution of the Nth Best Path Problem. J. ACM 6, 4 (Oct. 1959), 506-514. DOI= http://doi.acm.org/10.1145/320998.321004 type of the vertices type of the edges A delegate-based incidence graph type of the vertices type of the edges A vertex predicate that detects vertex with no in or out edges. type of the vertices type of the edges An struct based implementation. The type of the vertex. Initializes a new instance of the class. The source. The target. source != null target != null Comparer<TVertex>.Default.Compare(source, target) <= 0 Contract.ValueAtReturn(out this).Source.Equals(source) Contract.ValueAtReturn(out this).Target.Equals(target) Returns a that represents the current . A that represents the current . Contract.Result<string>() != null Gets the source vertex Contract.Result<TVertex>() != null Gets the target vertex Contract.Result<TVertex>() != null A breath first search algorithm for directed graphs type of a vertex type of an edge A distance recorder for undirected tree builder algorithms type of a vertex type of an edge Exception raised when an algorithm detects a non-strongly connected graph. A factory of identifiable vertices. A vertex factory delegate. Combines two hashcodes in a strong way. Combines three hashcodes in a strong way. type of a vertex type of an edge source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) Contract.Result<bool>() == (ithis.VertexCount == 0) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<bool>() == (ithis.EdgeCount == 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) baseGraph != null v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) Contract.Result<IEnumerable<TVertex>>() != null Contract.Result<int>() == Enumerable.Count(ithis.Edges) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) Contract.Result<TVertex>() != null Contract.Result<TVertex>() != null source != null target != null source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) tryGetInEdges != null v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) vertex != null pred != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Vertices, v => pred(v))) Enumerable.All(ithis.Vertices, v => !pred(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - Contract.Result<int>() predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Edges, e => predicate(e))) Enumerable.All(ithis.Edges, e => !predicate(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.Result<int>() v != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsVertex(v)) !ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - (Contract.Result<bool>() ? 1 : 0) Contract.Result<IEnumerable<TVertex>>() != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) v != null ithis.ContainsVertex(v) !ithis.ContainsVertex(v) vertexInEdges != null vertexOutEdges != null edgeCount >= 0 v != null Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsVertex(v)) ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + (Contract.Result<bool>() ? 1 : 0) edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) Enumerable.All(edges, edge => ithis.ContainsVertex(edge.Source) && ithis.ContainsVertex(edge.Target) ) Enumerable.All(edges, edge => ithis.ContainsEdge(edge)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(edges, edge => !ithis.ContainsEdge(edge))) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) e != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsEdge(e)) !ithis.ContainsEdge(e) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - (Contract.Result<bool>() ? 1 : 0) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) e != null ithis.ContainsVertex(e.Source) ithis.ContainsVertex(e.Target) ithis.ContainsEdge(e) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) v != null ithis.ContainsVertex(v) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.OldValue(ithis.InDegree(v)) ithis.InDegree(v) == 0 Contract.Result<bool>() == (ithis.VertexCount == 0) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) Contract.Result<bool>() == (ithis.EdgeCount == 0) vertexComparer != null edge != null ithis.ContainsEdge(edge) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(edge)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) v != null predicate != null ithis.ContainsVertex(v) ithis.ContainsVertex(v) Enumerable.All(ithis.InEdges(v), e => predicate(e)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.InEdges(v), e => predicate(e))) ithis.InDegree(v) == Contract.OldValue(ithis.InDegree(v)) - Contract.Result<int>() v != null ithis.ContainsVertex(v) predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.OutEdges(v), ve => predicate(ve))) Enumerable.All(ithis.OutEdges(v), ve => !predicate(ve)) vertexEdgesDictionaryFactory != null vertices != null Enumerable.All(vertices, v => v != null) Enumerable.All(vertices, v => ithis.ContainsVertex(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + Contract.Result<int>() source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) vertexPredicate != null edgeFactory != null source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) Contract.Result<int>() == Enumerable.Count(ithis.Edges) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) GraphContract.InVertexSet(this, v) edgeFactory != null v != null ithis.ContainsVertex(v) ithis.OutDegree(v) == 0 Contract.Result<bool>() == (ithis.VertexCount == 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) Contract.Result<bool>() == (ithis.EdgeCount == 0) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<int>() == Enumerable.Count(ithis.Edges) v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) originalGraph != null v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) Contract.Result<IEnumerable<TVertex>>() != null v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) start >= 0 start <= end Contract.ValueAtReturn(out this).Start == start Contract.ValueAtReturn(out this).End == end Contract.Result<int>() >= 0 source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) Contract.Result<bool>() == (ithis.EdgeCount == 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) vertex != null Contract.Result<int>() == Enumerable.Count(ithis.Vertices) visitedGraph != null Contract.Result<CompressedSparseRowGraph<TVertex>>() != null edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) Contract.Result<int>() == Enumerable.Count(ithis.Edges) outEdgeStartRanges != null outEdges != null Contract.Result<IEnumerable<TVertex>>() != null Contract.Result<bool>() == (ithis.VertexCount == 0) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) path != null typeof(TEdge).IsValueType || Enumerable.All(path, e => e != null) path != null typeof(TEdge).IsValueType || Enumerable.All(path, e => e != null) IsPath<TVertex, TEdge>(path) path != null typeof(TEdge).IsValueType || Enumerable.All(path, e => e != null) Object.Equals(this.Tag, tag) host != null visitedGraph != null edgeWeights != null source != null visitedGraph != null edgeWeights != null costHeuristic != null source != null visitedGraph != null vertexPredicate != null visitedGraph != null root != null visitedGraph.ContainsVertex(root) Contract.Result<TryFunc<TVertex, IEnumerable<TEdge>>>() != null visitedGraph != null visitedGraph != null visitedGraph != null edgeWeights != null source != null visitedGraph != null root != null visitedGraph.ContainsVertex(root) Contract.Result<TryFunc<TVertex, IEnumerable<TEdge>>>() != null visitedGraph != null edgeWeights != null source != null visitedGraph != null vertices != null visitedGraph != null root != null visitedGraph.ContainsVertex(root) Contract.Result<TryFunc<TVertex, IEnumerable<TEdge>>>() != null visitedGraph != null edgeWeights != null source != null queue != null distances != null path != null goalVertex != null this.VisitedGraph.ContainsVertex(goalVertex) rootVertex != null goalVertex != null this.VisitedGraph.ContainsVertex(rootVertex) this.VisitedGraph.ContainsVertex(goalVertex) queue != null root != null successors != null distances != null path != null EdgeExtensions.IsAdjacent<TVertex, TEdge>(path[0], root) 0 <= startEdge && startEdge < path.Length parentPath != null 0 <= deviationIndex && deviationIndex < parentPath.Length deviationEdge != null weight >= 0 Contract.Result<string>() != null edgeWeights != null queue != null queue.Count == 0 successors != null distances != null root != null path != null successors != null startVertex != null path[path.Count - 1].Target.Equals(this.goalVertex) Contract.Result<int>() == Enumerable.Count(this.ComputedShortestPaths) path != null Enumerable.All(path, e => e != null) distanceRelaxer != null value > 1 this.ShortestPathCount == value condensatedGraph != null vertexPredicate != null vertexFactory != null edgeFactory != null Contract.Result<object>() != null Contract.Result<TGraph>() != null this.State == ComputationState.NotRunning Enum.IsDefined(typeof(ComputationState), Contract.Result<ComputationState>()) visitedGraph != null serviceType != null this.State == ComputationState.Running || this.State == ComputationState.Aborted source != null sink != null visitedGraph != null vertexFactory != null edgeFactory != null source != null visitedGraph.ContainsVertex(source) sink != null visitedGraph.ContainsVertex(sink) v != null vertex != null vertex != null visitedGraph != null vertexFactory != null edgeFactory != null source != null visitedGraph.ContainsVertex(source) sink != null visitedGraph.ContainsVertex(sink) capacities != null edge != null value != null value != null capacities != null vertexFactory != null edgeFactory != null v != null e != null v != null visitedGraph != null edgeFactory != null weights != null edges != null g != null u != null edgeChain != null root != null this.VisitedGraph.ContainsVertex(root) next != null visitedGraph != null edgeChain != null root != null value != null root != null distances != null vertices != null algorithm != null Contract.Result<IDisposable>() != null e != null rootVertex != null rootVertex != null vertices != null vertices != null vertices != null vertices != null root != null goal != null goalVertex != null e != null vertex != null edges != null depth >= 0 value > 0 root != null colors != null edgeWeights != null distanceRelaxer != null colors != null u != null vertexQueue != null vertexColors != null outEdgeEnumerator != null vertex != null edges != null depth >= 0 value > 0 root != null v != null v != null v != null vertexQueue != null vertexColors != null e != null u != null e != null e != null Contract.Result<object>() != null Enum.IsDefined(typeof(ComputationState), Contract.Result<ComputationState>()) vertexPredecessors != null algorithm != null Contract.Result<IDisposable>() != null vertices != null algorithm != null Contract.Result<IDisposable>() != null vertexPredecessors != null algorithm != null Contract.Result<IDisposable>() != null vertexPredecessors != null algorithm != null Contract.Result<IDisposable>() != null edgePredecessors != null endPathEdges != null algorithm != null Contract.Result<IDisposable>() != null edgeWeights != null distanceRelaxer != null distances != null algorithm != null Contract.Result<IDisposable>() != null discoverTimes != null discoverTimes != null finishTimes != null algorithm != null Contract.Result<IDisposable>() != null edgeWeights != null distanceRelaxer != null distances != null algorithm != null Contract.Result<IDisposable>() != null action != null edges != null algorithm != null Contract.Result<IDisposable>() != null args != null 0 <= this.ComponentCount && this.ComponentCount <= this.VisitedGraph.VertexCount Enumerable.All(this.VisitedGraph.Vertices, v => 0 <= this.Components[v] && this.Components[v] < this.ComponentCount) components != null components != null u != null v != null this.DiscoverTimes[u] < this.DiscoverTimes[v] ? Contract.Result<TVertex>().Equals(u) : Contract.Result<TVertex>().Equals(v) this.ComponentCount >= 0 this.VisitedGraph.VertexCount == 0 || this.ComponentCount > 0 Enumerable.All(this.VisitedGraph.Vertices, v => this.Components.ContainsKey(v)) this.VisitedGraph.VertexCount == this.Components.Count Enumerable.All(this.Components.Values, c => c <= this.ComponentCount) components != null Contract.Result<TGraph>() != null pairs != null root != null pairs != null g != null rnd != null g.VertexCount > 0 vertices != null rnd != null count > 0 g != null vertexFactory != null edgeFactory != null rnd != null vertexCount > 0 edgeCount >= 0 !(!g.AllowParallelEdges && !selfEdges) || edgeCount <= vertexCount * (vertexCount -1) // directed graph g != null rnd != null g.EdgeCount > 0 edges != null rnd != null count > 0 g != null vertexFactory != null edgeFactory != null rnd != null vertexCount > 0 edgeCount >= 0 !(!g.AllowParallelEdges && !selfEdges) || edgeCount <= vertexCount * (vertexCount - 1) / 2 rootVertex != null this.VisitedGraph.ContainsVertex(rootVertex) this.VertexColors[rootVertex] == GraphColor.White e != null source != null target != null (e.Source.Equals(source) && e.Target.Equals(target)) || (e.Source.Equals(target) && e.Target.Equals(source)) weights != null distanceRelaxer != null vertex != null rootVertex != null this.VisitedGraph.ContainsVertex(rootVertex) this.VertexColors[rootVertex] == GraphColor.White s != null this.VisitedGraph.ContainsVertex(s) args != null args != null rootVertex != null this.VisitedGraph.ContainsVertex(rootVertex) this.VertexColors[rootVertex] == GraphColor.White costHeuristic != null e != null weights != null distanceRelaxer != null vertex != null weights != null distanceRelaxer != null weights != null distanceRelaxer != null source != null target != null !this.edgeStored || this._edge != null !this.predecessorStored || this._predecessor != null edge != null Contract.Result<string>() != null predecessor != null source != null target != null edgeWeights != null vertex != null ithis.AdjacentDegree(vertex) == 0 vertex != null predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.AdjacentEdges(vertex), e => predicate(e))) Enumerable.All(ithis.AdjacentEdges(vertex), v => !predicate(v)) Contract.Result<bool>() == (ithis.VertexCount == 0) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<bool>() == (ithis.EdgeCount == 0) Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) vertices != null Enumerable.All(vertices, v => { IEnumerable<TEdge> edges; return tryGetAdjacentEdges(v, out edges); }) Contract.Result<IEnumerable<TVertex>>() != null edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsVertex(v)) !ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - (Contract.Result<bool>() ? 1 : 0) v != null Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsVertex(v)) ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + (Contract.Result<bool>() ? 1 : 0) vertices != null Enumerable.All(vertices, v => v != null) Enumerable.All(vertices, v => ithis.ContainsVertex(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + Contract.Result<int>() pred != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Vertices, v => pred(v))) Enumerable.All(ithis.Vertices, v => !pred(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - Contract.Result<int>() this.edgeCount >= 0 edges != null edge != null vertex != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.AdjacentEdges(v)) pred != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Vertices, v => pred(v))) Enumerable.All(ithis.Vertices, v => !pred(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - Contract.Result<int>() predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Edges, e => predicate(e))) Enumerable.All(ithis.Edges, e => !predicate(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.Result<int>() v != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsVertex(v)) !ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - (Contract.Result<bool>() ? 1 : 0) args != null Contract.Result<IEnumerable<TVertex>>() != null v != null Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsVertex(v)) ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + (Contract.Result<bool>() ? 1 : 0) edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) Enumerable.All(edges, edge => ithis.ContainsVertex(edge.Source) && ithis.ContainsVertex(edge.Target) ) Enumerable.All(edges, edge => ithis.ContainsEdge(edge)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(edges, edge => !ithis.ContainsEdge(edge))) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() Contract.Result<bool>() == (ithis.EdgeCount == 0) e != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsEdge(e)) !ithis.ContainsEdge(e) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - (Contract.Result<bool>() ? 1 : 0) e != null ithis.ContainsVertex(e.Source) ithis.ContainsVertex(e.Target) ithis.ContainsEdge(e) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && ithis.ContainsEdge(edge.Source, edge.Target) && (edge.Source.Equals(v) || edge.Target.Equals(v)) ) Contract.Result<bool>() == (ithis.VertexCount == 0) args != null v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.AdjacentDegree(v) == 0) source != null target != null Contract.Result<EdgeEqualityComparer<TVertex, TEdge>>() != null Contract.Result<EdgeEqualityComparer<TVertex, TEdge>>() != null edgeEqualityComparer != null vertexComparer != null edge != null ithis.ContainsEdge(edge) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(edge)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) vertex != null ithis.AdjacentDegree(vertex) == 0 vertex != null predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.AdjacentEdges(vertex), e => predicate(e))) Enumerable.All(ithis.AdjacentEdges(vertex), v => !predicate(v)) vertices != null Enumerable.All(vertices, v => v != null) Enumerable.All(vertices, v => ithis.ContainsVertex(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + Contract.Result<int>() source != null target != null Contract.Result<bool>() == Enumerable.Any(ithis.AdjacentEdges(source), e => e.Target.Equals(target) || e.Source.Equals(target)) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null ithis.ContainsVertex(v) Contract.Result<TEdge>() != null Contract.Result<TEdge>().Source.Equals(v) || Contract.Result<TEdge>().Target.Equals(v) Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Edges, e => predicate(e))) Enumerable.All(ithis.Edges, e => !predicate(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.Result<int>() source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) Contract.Result<bool>() == (ithis.EdgeCount == 0) Contract.Result<bool>() == (ithis.VertexCount == 0) vertex != null 0 <= v && v < this.VertexCount Contract.Result<int>() == Enumerable.Count(ithis.Vertices) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) 0 <= v && v < this.VertexCount vertexCount > 0 edgeCount >= 0 edges != null vertexCount == edges.GetLength(0) vertexCount == edges.GetLength(1) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) Contract.Result<IEnumerable<TVertex>>() != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) 0 <= v && v < this.VertexCount source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) 0 <= v && v < this.VertexCount edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) Enumerable.All(edges, edge => ithis.ContainsVertex(edge.Source) && ithis.ContainsVertex(edge.Target) ) Enumerable.All(edges, edge => ithis.ContainsEdge(edge)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(edges, edge => !ithis.ContainsEdge(edge))) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) e != null ithis.ContainsVertex(e.Source) ithis.ContainsVertex(e.Target) ithis.ContainsEdge(e) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) Contract.Result<int>() == Enumerable.Count(ithis.Edges) v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) e != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsEdge(e)) !ithis.ContainsEdge(e) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - (Contract.Result<bool>() ? 1 : 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) Contract.Result<bool>() == (0 <= 0 && v > this.VertexCount) Contract.Result<bool>() == (Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges) != null) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) vertexCount > 0 v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) 0 <= v && v < this.VertexCount v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) Contract.Result<bool>() == (ithis.EdgeCount == 0) vertex != null Contract.Result<int>() == Enumerable.Count(ithis.Vertices) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) Contract.Result<IEnumerable<TVertex>>() != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) Contract.Result<int>() == Enumerable.Count(ithis.Edges) vertexEdges != null edgeCount >= 0 v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) Contract.Result<bool>() == (ithis.VertexCount == 0) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) vertexOutEdges != null edgeCount >= 0 edgeCount == Enumerable.Sum(vertexOutEdges, kv => (kv.Value == null) ? 0 : kv.Value.Length) Contract.Result<bool>() == (ithis.EdgeCount == 0) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) Contract.Result<int>() == Enumerable.Count(ithis.Edges) visitedGraph != null Contract.Result<IEnumerable<TVertex>>() != null Contract.Result<bool>() == (ithis.VertexCount == 0) v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) Contract.Result<bool>() == (ithis.VertexCount == 0) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<bool>() == (ithis.EdgeCount == 0) Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) vertices != null Enumerable.All(vertices, v => { IEnumerable<TEdge> edges; return tryGetOutEdges(v, out edges); }) Contract.Result<IEnumerable<TVertex>>() != null edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) this.count > -1 this.header != null this.tail != null owner != null Contract.Result<object>() == this.Model[this.CurrentIndex] (object)Contract.Result<T>() == this.Model[this.CurrentIndex] this.Model == Contract.OldValue(this.Model) this.CurrentIndex < this.Model.Length this.CurrentIndex >= 0 this.CurrentIndex == Contract.OldValue(this.CurrentIndex) + 1 Contract.Result<object>() == this.Model[this.CurrentIndex] Contract.Result<IEnumerator>() != null Contract.Result<IEnumerator>().Model == this.Model Contract.Result<IEnumerator>().CurrentIndex == -1 Contract.Result<IEnumerator<T>>() != null Contract.Result<IEnumerator<T>>().Model == ((IEnumerable)this).Model q != null this.Comparison(key, this.KeyMaxValue) < 0 h != null v != null comparison != null 0 < maximumErrorRate && maximumErrorRate <= 0.5 element != null Contract.Result<Element>() != null left != null ithis.Contains(left) right != null ithis.Contains(right) element != null root != null elementCapacity >= 0 && elementCapacity < int.MaxValue value != null ithis.Contains(value) left != null right != null ithis.Contains(left) ithis.Contains(right) left != null right != null Contract.Result<bool>() ? Contract.OldValue(this.SetCount) - 1 == this.SetCount : Contract.OldValue(this.SetCount) == this.SetCount this.FindNoCompression(left) == this.FindNoCompression(right) Contract.Result<IEdgeList<TVertex, TEdge>>() != null valueCount >= 0 valueCount == 0 || (values != null && valueCount == Enumerable.Count(values)) distances != null distanceComparison != null values != null distanceComparison != null i >= 0 && i < this.count && j >= 0 && j < this.count && i != j Contract.Result<IEnumerator>() != null Contract.Result<IEnumerator>().Model == this.Model Contract.Result<IEnumerator>().CurrentIndex == -1 Contract.Result<object>() == this.Model[this.CurrentIndex] (object)Contract.Result<T>() == this.Model[this.CurrentIndex] this.Model == Contract.OldValue(this.Model) this.CurrentIndex < this.Model.Length this.CurrentIndex >= 0 this.CurrentIndex == Contract.OldValue(this.CurrentIndex) + 1 Contract.Result<object>() == this.Model[this.CurrentIndex] Contract.Result<IEnumerator<T>>() != null Contract.Result<IEnumerator<T>>().Model == ((IEnumerable)this).Model i >= 0 & i < this.count & j >= 0 & j < this.count & i != j capacity >= 0 priorityComparison != null list != null node != null node != null Contract.Result<IEnumerator>() != null Contract.Result<IEnumerator>().Model == this.Model Contract.Result<IEnumerator>().CurrentIndex == -1 Contract.Result<IEnumerator<T>>() != null Contract.Result<IEnumerator<T>>().Model == ((IEnumerable)this).Model node != null values != null converter != null Contract.Result<IEnumerator>() != null Contract.Result<IEnumerator>().Model == this.Model Contract.Result<IEnumerator>().CurrentIndex == -1 node != null node != null Contract.Result<IEnumerator<T>>() != null Contract.Result<IEnumerator<T>>().Model == ((IEnumerable)this).Model other != null Contract.Result<IVertexEdgeDictionary<TVertex, TEdge>>() != null distances != null distanceComparison != null Contract.Result<bool>() == (ithis.EdgeCount == 0) vertex != null predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Edges, e => predicate(e))) Enumerable.All(ithis.Edges, e => !predicate(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.Result<int>() Contract.Result<IEnumerable<TVertex>>() != null edges != null Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) Enumerable.All(edges, edge => ithis.ContainsVertex(edge.Source) && ithis.ContainsVertex(edge.Target) ) Enumerable.All(edges, edge => ithis.ContainsEdge(edge)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(edges, edge => !ithis.ContainsEdge(edge))) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() e != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsEdge(e)) !ithis.ContainsEdge(e) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - (Contract.Result<bool>() ? 1 : 0) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<bool>() == (ithis.VertexCount == 0) e != null ithis.ContainsVertex(e.Source) ithis.ContainsVertex(e.Target) ithis.ContainsEdge(e) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) Contract.Result<TVertex>() != null source != null target != null Contract.Result<TVertex>() != null Contract.Result<TVertex>() != null Contract.Result<TVertex>() != null originalEdge != null Contract.Result<string>() != null v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.AdjacentDegree(v) == 0) source != null target != null Contract.Result<EdgeEqualityComparer<TVertex, TEdge>>() != null v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && ithis.ContainsEdge(edge.Source, edge.Target) && (edge.Source.Equals(v) || edge.Target.Equals(v)) ) source != null target != null Contract.Result<bool>() == Enumerable.Any(ithis.AdjacentEdges(source), e => e.Target.Equals(target) || e.Source.Equals(target)) v != null ithis.ContainsVertex(v) Contract.Result<TEdge>() != null Contract.Result<TEdge>().Source.Equals(v) || Contract.Result<TEdge>().Target.Equals(v) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.AdjacentEdges(v)) Contract.Result<bool>() == (ithis.VertexCount == 0) source != null target != null Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<EdgeEqualityComparer<TVertex, TEdge>>() != null Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<bool>() == (ithis.EdgeCount == 0) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.AdjacentEdges(v)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && ithis.ContainsEdge(edge.Source, edge.Target) && (edge.Source.Equals(v) || edge.Target.Equals(v)) ) graph != null Contract.Result<IEnumerable<TVertex>>() != null source != null target != null Contract.Result<bool>() == Enumerable.Any(ithis.AdjacentEdges(source), e => e.Target.Equals(target) || e.Source.Equals(target)) v != null ithis.ContainsVertex(v) Contract.Result<TEdge>() != null Contract.Result<TEdge>().Source.Equals(v) || Contract.Result<TEdge>().Target.Equals(v) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.AdjacentDegree(v) == 0) vertex != null pred != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Vertices, v => pred(v))) Enumerable.All(ithis.Vertices, v => !pred(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - Contract.Result<int>() predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.Edges, e => predicate(e))) Enumerable.All(ithis.Edges, e => !predicate(e)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - Contract.Result<int>() v != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsVertex(v)) !ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) - (Contract.Result<bool>() ? 1 : 0) args != null Contract.Result<IEnumerable<TVertex>>() != null v != null Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsVertex(v)) ithis.ContainsVertex(v) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + (Contract.Result<bool>() ? 1 : 0) edges != null typeof(TEdge).IsValueType || Enumerable.All(edges, edge => edge != null) Enumerable.All(edges, edge => ithis.ContainsVertex(edge.Source) && ithis.ContainsVertex(edge.Target) ) Enumerable.All(edges, edge => ithis.ContainsEdge(edge)) Contract.Result<int>() == Contract.OldValue(Enumerable.Count(edges, edge => !ithis.ContainsEdge(edge))) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + Contract.Result<int>() v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) e != null Contract.Result<bool>() == Contract.OldValue(ithis.ContainsEdge(e)) !ithis.ContainsEdge(e) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) - (Contract.Result<bool>() ? 1 : 0) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) Contract.Result<bool>() == (ithis.VertexCount == 0) args != null v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) vertexEdgesDictionaryFactory != null edge != null ithis.ContainsEdge(edge) ithis.AllowParallelEdges || Contract.Result<bool>() == Contract.OldValue(!ithis.ContainsEdge(edge)) ithis.EdgeCount == Contract.OldValue(ithis.EdgeCount) + (Contract.Result<bool>() ? 1 : 0) v != null ithis.ContainsVertex(v) predicate != null Contract.Result<int>() == Contract.OldValue(Enumerable.Count(ithis.OutEdges(v), ve => predicate(ve))) Enumerable.All(ithis.OutEdges(v), ve => !predicate(ve)) vertexComparer != null vertices != null Enumerable.All(vertices, v => v != null) Enumerable.All(vertices, v => ithis.ContainsVertex(v)) ithis.VertexCount == Contract.OldValue(ithis.VertexCount) + Contract.Result<int>() source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) vertexEdges != null edgeCount >= 0 v != null ithis.ContainsVertex(v) ithis.OutDegree(v) == 0 tryGetOutEdges != null v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.AdjacentDegree(v) == 0) source != null target != null Contract.Result<EdgeEqualityComparer<TVertex, TEdge>>() != null source != null target != null Contract.Result<bool>() == Enumerable.Any(ithis.AdjacentEdges(source), e => e.Target.Equals(target) || e.Source.Equals(target)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.AdjacentEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && ithis.ContainsEdge(edge.Source, edge.Target) && (edge.Source.Equals(v) || edge.Target.Equals(v)) ) tryGetAdjacenyEdges != null v != null ithis.ContainsVertex(v) Contract.Result<TEdge>() != null Contract.Result<TEdge>().Source.Equals(v) || Contract.Result<TEdge>().Target.Equals(v) Object.Equals(this.Tag,tag) Contract.Result<bool>() == (ithis.VertexCount == 0) source != null target != null Contract.Result<EdgeEqualityComparer<TVertex, TEdge>>() != null Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<bool>() == (ithis.EdgeCount == 0) source != null target != null Contract.Result<bool>() == Enumerable.Any(ithis.AdjacentEdges(source), e => e.Target.Equals(target) || e.Source.Equals(target)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.AdjacentEdges(v)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && ithis.ContainsEdge(edge.Source, edge.Target) && (edge.Source.Equals(v) || edge.Target.Equals(v)) ) visitedGraph != null Contract.Result<IEnumerable<TVertex>>() != null edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null ithis.ContainsVertex(v) Contract.Result<TEdge>() != null Contract.Result<TEdge>().Source.Equals(v) || Contract.Result<TEdge>().Target.Equals(v) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.AdjacentDegree(v) == 0) elements != null Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<bool>() == (ithis.EdgeCount == 0) Contract.Result<int>() == Enumerable.Count(ithis.Edges) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null dictionary != null Contract.Result<bool>() == (ithis.VertexCount == 0) Contract.Result<IEnumerable<TVertex>>() != null Contract.Result<int>() == Enumerable.Count(ithis.Vertices) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) source != null target != null ithis.ContainsVertex(source) ithis.ContainsVertex(target) e != null residualCapacities != null visitedGraph != null v != null !Contract.Result<bool>() || (Contract.ValueAtReturn(out edges) != null && Enumerable.All(Contract.ValueAtReturn(out edges), e => e.Source.Equals(v))) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.OutDegree(v) == 0) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All(Contract.Result<IEnumerable<TEdge>>(), e => e.Source.Equals(v)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count<TEdge>(ithis.OutEdges(v)) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.OutDegree(v) Enumerable.ElementAt(ithis.OutEdges(v), index).Equals(Contract.Result<TEdge>()) source != null target != null Contract.Result<EdgeEqualityComparer<TVertex, TEdge>>() != null Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<bool>() == (ithis.EdgeCount == 0) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) vertex != null v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.AdjacentEdges(v)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && ithis.ContainsEdge(edge.Source, edge.Target) && (edge.Source.Equals(v) || edge.Target.Equals(v)) ) Contract.Result<IEnumerable<TVertex>>() != null Contract.Result<bool>() == (ithis.VertexCount == 0) source != null target != null Contract.Result<bool>() == Enumerable.Any(ithis.AdjacentEdges(source), e => e.Target.Equals(target) || e.Source.Equals(target)) v != null ithis.ContainsVertex(v) Contract.Result<TEdge>() != null Contract.Result<TEdge>().Source.Equals(v) || Contract.Result<TEdge>().Target.Equals(v) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.AdjacentDegree(v) == 0) v != null visitedGraph!=null vertex != null Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<bool>() == (ithis.EdgeCount == 0) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == (ithis.InDegree(v) == 0) Contract.Result<int>() == Enumerable.Count(ithis.Edges) v != null ithis.ContainsVertex(v) index >= 0 && index < ithis.InDegree(v) Contract.Result<TEdge>().Equals(Enumerable.ElementAt(ithis.InEdges(v), index)) v != null ithis.ContainsVertex(v) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All( Contract.Result<IEnumerable<TEdge>>(), edge => edge != null && edge.Target.Equals(v) ) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == Enumerable.Count(ithis.InEdges(v)) v != null ithis.ContainsVertex(v) Contract.Result<int>() == ithis.InDegree(v) + ithis.OutDegree(v) v != null ithis.ContainsVertex(v) Contract.Result<bool>() == ithis.ContainsVertex(v) !Contract.Result<bool>() || Contract.ValueAtReturn(out edges) != null !Contract.Result<bool>() || Enumerable.All( Contract.ValueAtReturn<IEnumerable<TEdge>>(out edges), edge => edge != null && edge.Target.Equals(v) ) Contract.Result<bool>() == (ithis.VertexCount == 0) Contract.Result<IEnumerable<TEdge>>() != null Enumerable.All<TEdge>(Contract.Result<IEnumerable<TEdge>>(), e => e != null) Contract.Result<int>() == Enumerable.Count(ithis.Edges) Contract.Result<IEnumerable<TVertex>>() != null Contract.Result<bool>() == (ithis.EdgeCount == 0) edge != null Contract.Result<bool>() == Contract.Exists(ithis.Edges, e => e.Equals(edge)) Contract.Result<int>() == Enumerable.Count(ithis.Vertices) baseGraph != null vertexPredicate != null edgePredicate != null e != null residualCapacities != null reversedEdges != null g != null v != null left != null right != null g != null e != null g != null e != null left != null right != null vertex != null