# Answer true the maximum number of edges in an

This preview shows pages 2–5. Sign up to view the full content.

Answer TRUE. The maximum number of edges in an undirected connected graphs without self-loops and without parallel edges with 100 nodes is ( 100 2 ) = 4950. Out of these, 100 - 1 = 99 are discovery edges (form the spanning tree). This leaves a maximum of 4851 = 4950 - 99 backedges. 2. (20 pts) Consider the undirected graph on eight nodes, labelled 0 through 7, with the following 13 edges: 0-1 0-6 0-7 1-4 1-6 1-7 2-3 2-4 2-5 3-4 3-6 3-7 5-6 Suppose we run the BFS algorithm on this graph, starting at node 0 and such that BFS explores the edges incident to a node in the numerical order of the labels of the node at the other end. (a) Draw the spanning tree of discovery edges produced by this algorithm. Answer This not required for the answer, but let’s list the nodes and edges in the order they are explored: L0: 0 0-1(disc) 0-6(disc) 0-7(disc) L1: 1 6 7 1-4(disc) 1-6(cross) 1-7(cross) 6-3(disc) 6-5(disc) 7-3(cross) L2: 4 3 5 4-2(disc) 4-3(cross) 3-2(cross) 5-2(cross) L3: 2 And the spanning tree is 1 --- 0 --- 7 | | | | 4 6 | |\ | | \ 2 3 5 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
(this could result in p becoming nil) push (v,p) onto S push (w,r0) onto S where r0 is a reference to the first element in the adjacency list of w (or it’s nil if that list is empty) mark w as visited 5. (30 pts) Recall that a simple is a path in which no vertex is repeated. Give the pseudocode of an algorithm that, given a digraph G and a node

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern