prg_graph_alg_bfs()
Abstract
Performs a breadth-first search on a graph.
Syntax
prg_graph_alg_bfs (graph_ptr, src_vertex_ptr, callback_proc, client_state_ptr)
| Argument | Type | Description |
|---|---|---|
graph_ptr |
PrgT_Graph * |
Pointer to the graph to be searched. |
src_vertex_ptr |
PrgT_Graph_Vertex * |
Pointer to the vertex from which the search will begin. |
callback_proc |
PrgT_Graph_Alg_Bfs_Callback |
The callback procedure that will be called as each vertex is encountered for the first time. Must not be NIL. |
client_state_ptr |
void * |
User-defined data that will be passed to the callback procedure each time it is called. |
Return Type
void
No return value
Header
prg_graph_alg.h
Details
This function performs a breadth-first search of the given graph, starting from the given source vertex. As each vertex is discovered, the callback procedure is invoked with the given state. The callback procedure must not be NIL.
Note: If the graph contains unconnected vertices, then all vertices will not be visited by a single call of this procedure.