dranges.graphrange
This module offers some conversions functions from a Graph to a range.
License:
Boost License 1.0.
Authors:
Philippe Sigaud
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- enum
TraversalMode
;
- struct
GraphTraversal
(N,E,TraversalMode travmode) if (isNode!(N) && isEdge!(E));
- A lazy range struct that traverses a graph in a depth-first or breadth-first manner,
as specified at creation with the TraversalMode enum. It produces labels, not the nodes or their values.
See Also:
traversal, valueTraversal.
- GraphTraversal!(N,E,trav)
traversal
(TraversalMode trav, N, E, L)(Graph!(N,E) graph, L label);
- Generic function to create a Traversal struct. Prefer the use of depthFirst or breadthFirst.
- GraphTraversal!(N,E,TraversalMode.DepthFirst)
depthFirst
(N, E, L)(Graph!(N,E) graph, L label);
GraphTraversal!(N,E,TraversalMode.BreadthFirst)
breadthFirst
(N, E, L)(Graph!(N,E) graph, L label);
- Returns a range that traverses the graph in a depth-first or breadth-first way, from the node labeled label. The graph returns labels, not nodes.
- TMapType!("a[b].value",Repeat!(Graph!(N,E)),GraphTraversal!(N,E,TraversalMode.DepthFirst))
depthFirstValues
(N, E, L)(Graph!(N,E) graph, L label);
TMapType!("a[b].value",Repeat!(Graph!(N,E)),GraphTraversal!(N,E,TraversalMode.BreadthFirst))
breadthFirstValues
(N, E, L)(Graph!(N,E) graph, L label);
- Returns a range that traverses the graph in a depth-first or breadth-first way, from node label, and returns
the nodes value.
Note:
first try, probably horribly inefficient.
|