Graph Algorithms Question (Design and Analysis)

95 Views Asked by At

enter image description here

I'm trying to design the algorithm and answer these two questions but can't produce a solution. I've tried drawing the pictures for the graph as well.

1

There are 1 best solutions below

0
On BEST ANSWER

I'll answer the first question, since this looks like homework, and maybe that'll inspire you. For the first problem, a greedy algorithm would work. Suppose you are tracing a simple path through this graph and you and go to some vertex not yet visited. If at $v$ you find you've visited all its neighbors, then you know you've been to its $d$ neighbors and to $v$ so you've been to at least $d+1$ vertices. So you can just start tracing through the graph, visiting a different node each time chosen arbitrarily until you cannot visit a new node, at which point you stop.