breadthFirstSearch

A generic breadth-first search algorithm that can be customised using a visitor.

template breadthFirstSearch(GraphT, VertexDescriptorT, VisitorT = NullVisitor!GraphT, ColourMapT = Colour[VertexDescriptorT], QueueT = FifoQueue!(VertexDescriptorT))
void
breadthFirstSearch
(
ref const(GraphT) graph
,
VertexDescriptorT source
,
ref ColourMapT colourMap
,
VisitorT visitor = VisitorT.init
,
QueueT queue = QueueT.init
)

Members

Functions

breadthFirstSearch
void breadthFirstSearch(const(GraphT) graph, VertexDescriptorT source, ColourMapT colourMap, VisitorT visitor, QueueT queue)

Parameters

GraphT

The type of the graph object to traverse. Must model the incidence graph concept.

VertexDescriptorT

The descriptor type for vertices in a GraphT.

VisitorT

The visitor type.

ColourMapT

The type of the property map that will be used to control the graph traversal. Must model a property map that stores Colours keyed by a VertexDescriptorT.

QueueT

The type of the queue used to order the expansion of vertices. Changing the queue type can be used to customise the behaviour of the search (e.g. using a priority queue rather than the default FIFO queue.

Meta