FAQ: Graph Search: Conceptual - Breadth-First Search (BFS) Conceptual

This community-built FAQ covers the “Breadth-First Search (BFS) Conceptual” exercise from the lesson “Graph Search: Conceptual”.

Paths and Courses
This exercise can be found in the following Codecademy content:

FAQs on the exercise Breadth-First Search (BFS) Conceptual

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

The Question: How could you use BFS to find the shortest walking route between Casa Batlló and the Sagrada Familia?

Though real talk having been to Barcelona… just take the subway because that is a heck of a walk !!! I mean enjoyable and you will stop for snacks… but take the subway its faster and public transport around the world is still “getting some culture” but I digress. Also Sagrada is kind of expensive to get into FYI… if you have a student ID floating around… use it.

Also in the image there are blue dots scattered around are they extra vertices to be considered??? So this might not be the perfect answer… but based on using the cardinal tourist spots listed this is what could be an implementation of BFS…

if we take Casa Batlo as vertex uno it would visit both La Pedrera (2) and Sagrada(4) on the first pass… so objective done…You’ve got there YAY!! but obvs… the algo will visit Pedrera and Punxes and finish…

Here’s where my calamity is and possible sticking point: If we were given weights to these vertices it may very well be it’s faster to go Batlo , Pedrera, Punxes and then Sagrada… but we aren’t … so again maybe it’s because I’m having me a day but I feel the images are missing information or don’t quite suit the question asked. Because Helpful Video guy Matt even states "we’re going to use the minimum value here but that’s always the case.

4 Likes

Another awesome answer as always lol. And it’s Helpful Video guy Matt “from Ohio”, don’t forget that part! :slight_smile:

1 Like

Apologies… I shouldn’t have been so careless :upside_down_face:… That should read: Helpful-Video-Guy-Matt-From-Ohio !!

1 Like