BFS (06/09/2024)

John is a tourist from Minas Gerais who is on vacation and want to explore the cities in UaiSo. There are 3 main cities that he would like to visit: CheeseBreadLand, DulceDeLecheTown and TorresmoCity, that are painted in blue in the map. But John only moves following a BFS order, and he only has the time to visit 5 cities. Help John optimize his management so he can visit the most possible interesting cities. Consider that the BFS always choose the neighbours in ascending order and the following map is an undirected graph.


 

To visit the most number of cities he would like, what John should do?

a) John should start his trip on city 1, so he can visit 2 cities of interest.

b) John should start his trip on city 4, so he can visit 2 cities of interest.

c) John should start his trip either on city 2 or 4, to visit 2 cities of interest.

d) John should start his trip on city 2, so he can visit 2 cities of interest.

e) None of the above

Original idea by: João Vitor Baptista Moreira

Comentários

Postar um comentário

Postagens mais visitadas deste blog

Graph Teory (23/08/2024)

Edge classification (16/08/2024)