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
  CS506 Assignment 3 Solution with explanation aghaJaan 1 370 01-23-2018, 11:26 AM
Last Post: Admin
  CS510 Assignment 2 Solution idea Fall 2017 aghaJaan 0 237 01-21-2018, 09:55 AM
Last Post: aghaJaan
  CS504 Assignment 1 Solution Fall 2017 Pakistani 0 358 11-27-2017, 11:13 PM
Last Post: Pakistani
  CS506 Assignment 2 Solution Fall 2017 Admin 0 403 11-23-2017, 10:51 AM
Last Post: Admin
  CS502 Assignment 1 Solution Fall 2017 Pakistani 0 352 11-16-2017, 11:53 AM
Last Post: Pakistani
  CS501 Assignment 1 Solution Fall 2017 Pakistani 0 244 11-11-2017, 11:08 AM
Last Post: Pakistani
  CS506 Assignment 1 Solution Fall 2017 Pakistani 0 489 11-08-2017, 09:41 AM
Last Post: Pakistani
  CS507 Assignment solution Rubaisha(Moody Girl) 0 360 07-25-2017, 10:23 PM
Last Post: Rubaisha(Moody Girl)
  CS502 GDB Solution 2017 Pakistani 0 1,438 02-16-2017, 09:41 AM
Last Post: Pakistani
Lightbulb Need CS502 Assignment no 1 solution Adorable Pakhtoon 3 1,349 11-17-2016, 04:21 PM
Last Post: Rubaisha(Moody Girl)



Users browsing this thread:
1 Guest(s)