subject

Consider a resource-limited variant of breadth-first search in which you can only add up to k of a vertex’s neighbors to the queue. in other 1 words, if a vertex v has k +p neighbors, then the last p vertices are left unmarked. it is as if they were not neighbors of v
(b) what is the worst-case running time of this algorithm if you use an adjacency list representation?
(c) regular bfs is guaranteed to visit all the vertices in a fully connected graph (see lecture 7 for definition). i. 5 pts draw a counter-example that shows that this guarantee does not hold for max-neighbors-bfs. ii. 5 pts briefly explain why max-neighbors-bfs will not visit some vertices in your example.
(d) extra credit: how would you need to modify maxneighbors-bfs to be able to visit all the vertices in the graph?

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:00, jarrettashlyn
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr. nextdouble(); minutestraveled = scnr. nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system. out. println("miles: " + milestraveled); } }
Answers: 2
image
Computers and Technology, 23.06.2019 19:30, wilkinsonei4069
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a, b] se pot scrie ca produs de două numere prime? “.
Answers: 1
image
Computers and Technology, 24.06.2019 00:00, Amrinderkhattra
Visualizing a game of “tag” to remember the meaning of contagious
Answers: 3
image
Computers and Technology, 24.06.2019 06:30, meganwintergirl
Ineed to know the anwser to all these questions
Answers: 2
You know the right answer?
Consider a resource-limited variant of breadth-first search in which you can only add up to k of a v...

Questions in other subjects: