Wednesday, July 17, 2019
Arithmetic Q
Question 1 remove the following chart G. pic 1. Give the contiguity matrix and adjacency angle of the chart G. (5 marks) adjacency matrix pic adjacency heed a b c d e f b d a c e b e f a e b c d f c e 2. Give the relative incidence matrix and incidence list of the represent G. (5 marks) pic incidence matrix pic incidence list 1 2 3 4 5 6 a b a d b c b e c e c e 7 8 d e e f Question 2 Consider the graph I. offset at the vertex a and solving ties by the vertex alphabetic crop traverse the graph by breadth-first-search (BFS) and progress to the corresponding BFS tree. (5 marks) pic The order is a b e g f c d h II. Starting at the vertex a and resolving ties by the vertex alphabetical order traverse the graph by depth-first-search (DFS) and construct the corresponding BFS tree. (5 marks) pic The order is a b f e g c d h Question 3 Consider the following graph G.The denounce of an edge is the cost of the edge. 1. exploitation Prims algorithm, capture a stripped spanning tree (MST) of the graph Also write level the mixed bag of the priority line up step by step and the order in which the vertices be selected. Is the MST pull unique? (i. e. , is it the one and single MST for the graph? ) 7 marks Not unique pic 2. Using Kruskals algorithm, draw a minimum spanning tree (MST) of the graph G. Write down the order in which the edges are selected. Is the MST drawn unique? (i. e. , is it the one and only MST for the graph? ) (5 marks)Not unique pic 3. Referring to the same graph above, capture the shortest paths from the vertex a to all otherwise vertices in the graph G victimisation Dijkstras algorithm. Show the changes of the priority queue step by step and cave in the order in which edges are selected. (8 marks) pic vow in which edges are selected a-e, e-f, a-b, f-g, b-c, g-h, c-d the shortest paths from the vertex a to all other vertices a. b 4 a. c 10 a. d17 a. e1 a. f3 a. g8 a. h 16 N. B. There may be more(prenominal) t han one solution. You only need to bound one of the solutions.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.