/// <summary> /// A height first search algorithm on a directed graph /// </summary> /// <param name="g">The graph to traverse</param> /// <exception cref="ArgumentNullException">g is null</exception> public HeightFirstSearchAlgorithm(IBidirectionalVertexListGraph g) { if (g == null) throw new ArgumentNullException("g"); this.visitedGraph = g; this.colors = new VertexColorDictionary(); }
public PageRankAlgorithm(IBidirectionalVertexListGraph visitedGraph) { if (visitedGraph == null) { throw new ArgumentNullException("visitedGraph"); } this.visitedGraph = visitedGraph; }
/// <summary> /// Creates a PageRank algorithm around the visited graph /// </summary> /// <param name="visitedGraph"> /// Visited <see cref="IBidirectionalVertexListGraph"/> instance. /// </param> /// <exception cref="ArgumentNullException"> /// <param name="visitedGraph"/> is a null reference (Nothing in Visual Basic). /// </exception> public PageRankAlgorithm(IBidirectionalVertexListGraph visitedGraph) { if (visitedGraph == null) { throw new ArgumentNullException("visitedGraph"); } this.visitedGraph = visitedGraph; }
/// <summary> /// A height first search algorithm on a directed graph /// </summary> /// <param name="g">The graph to traverse</param> /// <exception cref="ArgumentNullException">g is null</exception> public HeightFirstSearchAlgorithm(IBidirectionalVertexListGraph g) { if (g == null) { throw new ArgumentNullException("g"); } this.visitedGraph = g; this.colors = new VertexColorDictionary(); }
public NeighborDepthFirstSearchAlgorithm(IBidirectionalVertexListGraph g) { this.maxDepth = 0x7fffffff; if (g == null) { throw new ArgumentNullException("g"); } this.visitedGraph = g; this.colors = new VertexColorDictionary(); }
/// <summary> /// Returns an enumerable collection of the root vertices of the graph /// </summary> /// <param name="g">graph to visit</param> /// <returns>enumerable of root vertices</returns> /// <remarks> /// <para> /// Thread safe. /// </para> /// </remarks> public static IVertexEnumerable Sources( IBidirectionalVertexListGraph g ) { SourceVertexPredicate root = new SourceVertexPredicate(g); return(new FilteredVertexEnumerable( g.Vertices, root )); }
/// <summary> /// A depth first search algorithm on a directed graph /// </summary> /// <param name="g">The graph to traverse</param> /// <param name="colors">vertex color map</param> /// <exception cref="ArgumentNullException">g or colors are null</exception> public NeighborDepthFirstSearchAlgorithm( IBidirectionalVertexListGraph g, VertexColorDictionary colors ) { if (g == null) throw new ArgumentNullException("g"); if (colors == null) throw new ArgumentNullException("Colors"); this.visitedGraph = g; this.colors = colors; }
public HeightFirstSearchAlgorithm(IBidirectionalVertexListGraph g, VertexColorDictionary colors) { this.maxDepth = 0x7fffffff; if (g == null) { throw new ArgumentNullException("g"); } if (colors == null) { throw new ArgumentNullException("Colors"); } this.visitedGraph = g; this.colors = colors; }
/// <summary> /// A depth first search algorithm on a directed graph /// </summary> /// <param name="g">The graph to traverse</param> /// <param name="colors">vertex color map</param> /// <exception cref="ArgumentNullException">g or colors are null</exception> public NeighborDepthFirstSearchAlgorithm( IBidirectionalVertexListGraph g, VertexColorDictionary colors ) { if (g == null) { throw new ArgumentNullException("g"); } if (colors == null) { throw new ArgumentNullException("Colors"); } this.visitedGraph = g; this.colors = colors; }
/// <summary> /// Returns an enumerable collection of the root vertices of the graph /// </summary> /// <param name="g">graph to visit</param> /// <returns>enumerable of root vertices</returns> /// <remarks> /// <para> /// Thread safe. /// </para> /// </remarks> public static IVertexEnumerable Sources( IBidirectionalVertexListGraph g ) { SourceVertexPredicate root = new SourceVertexPredicate(g); return new FilteredVertexEnumerable( g.Vertices, root ); }