Click or drag to resize

topologicalSortTopologicalSortT, TDependencies Method

Namespace:  WhetStone.Looping
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static IEnumerable<T> TopologicalSort<T, TDependencies>(
	this IEnumerable<Tuple<T, TDependencies>> elements,
	bool allowMissingDependancy = false
)
where TDependencies : Object, IEnumerable<T>

Parameters

elements
Type: System.Collections.GenericIEnumerableTupleT, TDependencies
An IEnumerableT of tuples. The first element of the tuple is the element itself, the second is an ICollectionT of its dependents.
allowMissingDependancy (Optional)
Type: SystemBoolean
Whether to ignore dependencies that are not in elements.

Type Parameters

T
The type of the elements.
TDependencies
The type of the dependency collection.

Return Value

Type: IEnumerableT
All the elements in elements ordered topologically.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTupleT, TDependencies. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentExceptionIf elements contains cyclical dependencies or a dependency that does not exist in elements.
Remarks
A dependency collection can be empty or to indicate no dependency.
See Also