Question

Exam 3 Sample.pdf * ) Q © w E © 112 A n o 99.9% 1. Breadth-first Search a) List out the following graph using adjacency list.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a)

The adjacency list is given as:

A -> B, D, E

B -> A, C, D, E, F

C -> B, E, F

D -> A, B, E, G, H

E -> A, B, C, D, F, G, H, I

F -> B, C, E, H, I

G -> D, E, H

H -> D, E, F, G, I

I -> E, F, H

b)

A, B, E, D, C, F, G, H, I

c)

The correct option is:

The number of edges on the shortest path between s and x is at least one less than the number of edges on the shortest path between s and y.

Add a comment
Know the answer?
Add Answer to:
Exam 3 Sample.pdf * ) Q © w E © 112 A n o 99.9% 1....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (5 marks) a. The pseudo-code for breadth-first search, modified slightly from Drozdek,1 is as follows: void...

    (5 marks) a. The pseudo-code for breadth-first search, modified slightly from Drozdek,1 is as follows: void breadthFirstSearch (vertex w) for all vertices u num (u) 0 null edges i=1; num (w) i++ enqueue (w) while queue is not empty dequeue ( V= for all vertices u adjacent to v if num(u) is 0 num (u) = i++; enqueue (u) attach edge (vu) to edges; output edges; Now consider the following graph. Give the breadth-first traversal of the graph, starting from...

  • Question 3 1 pts Select all of the following that are true: Breadth-First Search only adds...

    Question 3 1 pts Select all of the following that are true: Breadth-First Search only adds each vertex to the queue once. Breadth-First Search generally uses more space compared to Depth-First search. Breadth-First Search may not find the shortest path for an unweighted graph if the graph contains a cycle. At any time during Breadth-First Search, the queue holds at most two distinct dist values from all vertices in

  • Hello, I'd like someone to help me create these, thanks! 1. Type Vertex Create and document...

    Hello, I'd like someone to help me create these, thanks! 1. Type Vertex Create and document type Vertex. Each vertex v has the following pieces of information. A pointer to a linked list of edges listing all edges that are incident on v. This list is called an adjacency list. A real number indicating v's shortest distance from the start vertex. This number is −1 if the distance is not yet known. A vertex number u. The shortest path from...

  • 4&5 0 1 2 3 1. Draw the undirected graph that corresponds to this adjacency matrix...

    4&5 0 1 2 3 1. Draw the undirected graph that corresponds to this adjacency matrix 0 0 1 1 0 1 1 1 1 0 1 1 1 2 1 1 1 0 1 3 1 0 1 1 0 1 2. Given the following directed graph, how would you represent it with an adjacency list? 3. We've seen two ways to store graphs - adjacency matrices, and adjacency lists. For a directed graph like the one shown above,...

  • 3. (8 points-7+1) Figure 4 shows an undirected graph G. Assume that the adjacency list lists the ...

    3. (8 points-7+1) Figure 4 shows an undirected graph G. Assume that the adjacency list lists the edges in alphabetical order. Figure 3: Graph for P3 (a) Apply depth first search (DFS) to graph G, and show the discovery and finish times of each vertex. In the main-loop of DFS, check the vertices in alphabetical the form dsc/fin, where dsc is the discovery time and fin is the finish time. (b) Draw the DFS tree obtained. 3. (8 points-7+1) Figure...

  • Need help, thanks! In a graph with v vertices and e edges, which of the following...

    Need help, thanks! In a graph with v vertices and e edges, which of the following maximum sizes is not correct for the shortest path computation? O v for the number of adjacency lists O e for the total size of all adjacency lists O e for the size of the dictionary O v for the size of the queue O all of the above are correct

  • 1. Startingatvertex000, perform a BFSof Q3.Assume all adjacency lists are in numericalorder.For example, (000,001) occurs before...

    1. Startingatvertex000, perform a BFSof Q3.Assume all adjacency lists are in numericalorder.For example, (000,001) occurs before (000, 010). Showthe resulting spanningtrees. Draw the directed graphs and perform a. 2. Breadth-First Search (BFS)algorithm: VTo determine the shortest paths starting at vertex a to everyother node. Show the resulting spanning tree. b. Depth-First Search (DFS) to explore the whole graph: Record the start/end time for all the vertices. show the resulting spanning forest Label the name°fthe edges. V Writethetopologicalorderofthevertices(ifnocycle-nobackedge) (Showthestate of the...

  • CSC 430              GRAPH PROJECT Implement a graph class using an adjacency matrix or an adjacency list....

    CSC 430              GRAPH PROJECT Implement a graph class using an adjacency matrix or an adjacency list. The class should have a constructor, a copy constructor, a destructor and all the methods necessary to add/delete vertices, add/delete edges… Write a menu-driven program to THOROUGHLY check your class and all the functions included in your program. You can choose the data type. Allow the user to continue with operations as long as he/she wants to. Your program should check if an operation...

  • 1- Give an example (by drawing or by describing) of the following undirected graphs (a) A...

    1- Give an example (by drawing or by describing) of the following undirected graphs (a) A graph where the degree in each vertex is even and the total number of edges is odd (b) A graph that does not have an eulerian cycle. An eulerian cycle is a cycle where every edge of the graph is visited exactly once. (c) A graph that does not have any cycles and the maximum degree of a node is 2 (minimum degree can...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT