Question: ( 2 0 points ) Consider the following graph. a . ( 5 points ) Write down the adjacency matrix and adjacency lists specifying this
points Consider the following graph.
a points Write down the adjacency matrix and adjacency lists specifying this graph. Assume that the
matrix rows and columns and vertices in the adjacency lists follow in the alphabetical order of the vertex
labels.
b points Starting at vertex a and resolving ties by the vertex alphabetical order, traverse the graph by
depthfirst search and construct the corresponding depthfirst search tree. Give the order in which the
vertices were reached for the first time pushed onto the traversal stack and the order in which the vertices
became dead ends popped off the stack
points Traverse the graph of Problem by breadthfirst search and construct the corresponding
breadthfirst search tree. Start the traversal at vertex a and resolve ties by the vertex alphabetical order.
points A graph is said to be bipartite if all its vertices can be partitioned into two disjoint subsets
and so that every edge connects a vertex in with a vertex in One can also say that a graph is bipartite
if its vertices can be colored in two colors so that every edge has its vertices colored in different colors;
such graphs are also called colorable. For example, graph j is bipartite while graph ii is not.
ii
Design a DFSbased algorithm for checking whether a graph is bipartite.
Function: ismbipartitegraph
points, bonus Design a BFSbased algorithm for checking whether a graph is bipartite.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
