CS502 Assignment 3 Solution
#1
CS502 Design and Analysis of Algorithms
Assignment 3 Solution - Spring 2017

Question. 1  Consider the following Directed Acyclic Graph.
[Image: dvLRV2c.jpg]

Run BFS on this graph by taking node ‘1’ as source node and list the vertices in order while running BFS.
 
Note: Write a list of vertices only, no need to show the intermediate steps.

Answer: 1, 3, 4, 8

Question. 2
 
Two directed graphs are given below Graph (A) & Graph (B), You are required to answer the following questions
1.      Is “Graph (A)” a connected graph? State Yes / No with valid reason
2.      Is “Graph (B)” contains a Hamiltonian cycle? State Yes / No with valid reason
 
 [Image: w3zvPmJ.png][Image: yAxKbmk.png]

                        Graph (A)                                                                                Graph (B)


Answer:

  1. No, because 1 is not connected with 5 directly and also 5 is not connected with 3 directly.
  2. Yes, 1, 2, 3, 4, 1 creates a Hamiltonian cycle.
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  CS504 Assignment 1 Solution Fall 2017 Pakistani 0 216 11-27-2017, 11:13 PM
Last Post: Pakistani
  CS506 Assignment 2 Solution Fall 2017 Admin 0 224 11-23-2017, 10:51 AM
Last Post: Admin
  CS502 Assignment 1 Solution Fall 2017 Pakistani 0 207 11-16-2017, 11:53 AM
Last Post: Pakistani
  CS501 Assignment 1 Solution Fall 2017 Pakistani 0 138 11-11-2017, 11:08 AM
Last Post: Pakistani
  CS506 Assignment 1 Solution Fall 2017 Pakistani 0 364 11-08-2017, 09:41 AM
Last Post: Pakistani
  CS507 Assignment solution Rubaisha(Moody Girl) 0 270 07-25-2017, 10:23 PM
Last Post: Rubaisha(Moody Girl)
  CS502 GDB Solution 2017 Pakistani 0 1,095 02-16-2017, 09:41 AM
Last Post: Pakistani
Lightbulb Need CS502 Assignment no 1 solution Adorable Pakhtoon 3 1,195 11-17-2016, 04:21 PM
Last Post: Rubaisha(Moody Girl)
  CS502 assignment 1 Solution 2016 Rubaisha(Moody Girl) 0 1,516 11-17-2016, 04:18 PM
Last Post: Rubaisha(Moody Girl)
  Cs 504 assignment solution dil 2 977 08-01-2016, 08:33 PM
Last Post: iqra



Users browsing this thread:
1 Guest(s)