Show the BFS for this graph starting from C using alphabetic

Show the BFS for this graph starting from C, using alphabetical ordering of to-nodes, so that C-A precedes C-B as an edge out of C. Also show the queue of nodes waiting to be visited, and the set of as-yet unseen nodes. Here’s a start:

Queue Unseen Stage Start 1A,B,D, E, F A, B, D, E,F) visit C visit edge CA LA] 1B,D,E,F) visit edge CB A,B] D,E,F visit A ID,E,F

Solution

BFS from C:
visit A before edges
visit edge CA
visit C before edges
visit edge CB
...
visit C after edges
...
and indicate how to nd a topological sort from this BFS trace.
Notice: To make the graph acyclic reverse the directions of the C-A and the C-Bedges

Show the BFS for this graph starting from C, using alphabetical ordering of to-nodes, so that C-A precedes C-B as an edge out of C. Also show the queue of nodes

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site