In this assignment, the words graph and digraph will refer to
undirected and directed graphs; respectively. Assume the default
method to represent a graph or digraph is by using adjacency lists
(unless it is stated explicitly otherwise).
Q1)
a) Draw a digraph on 4 nodes {x1,x2,x3,x4} such that no pair of them
have equal in-degrees and no pair of them have equal out-degrees.
b) Can we generalize part(a) to a digraph with n nodes, where >= 2.
Explain briefly.
Q2)
Perform DFS of the graph G given below starting at the node
x1. Draw the edges of the tree formed during DFS assuming
that the nodes along the adjacency lists are arranged as
follows.
Find the type of each edge classified by the DFS assuming
That the nodes along the adjacency lists are arranged as
shown below.
————————–
Node L[node]
————————–
x1 x2, x3
x2 x1, x4, x5, x3
x3 x2, x1, x4
x4 x2, x6, x5, x3
x5 x2, x4, x6
x6 x4, x5
————————–
x1
O
/ \
/ \
x2 O—–O x3
|\ /
| \ /
| \/
| /\
| / \
|/ \
x4 O—–O x5
\ /
\ /
O x6
Graph G
Q3)
Perform BFS of the graph given in the preceding question
starting at node the x1. Assume the same adjacency lists,
and find the type of each edge after the BFS is completed.
Q4)
a) Find any topological sort for the DAG G given below.
b) In general, how many topological sorts for G are there?
a d
O——>——–O
| |
| |
\|/ \|/
| |
| |
O——>——–O—->—–O e
b c |
|
\|/
|
|
O f
DAG “G”
Q5)
Explain how to apply Depth-first-search method to check if a
given graph is connected. You should present your idea first;
then the algorithms, and state (without proof) the complexity
of your method. (Notice Depth first search method consists of
two parts or functions: DFSforest(G) and DFS(G,x) as covered.)
Q6)
Modify the depth first search method given for digraphs so that
if a back arc is encountered, the algorithm should print the
message “cyclic”
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Achiever Papers is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Dissertation Writing Service Works
First, you will need to complete an order form. It's not difficult but, if anything is unclear, you may always chat with us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order form
Once we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignment
As soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download