---
title: "Discussion on \"BFS - Breadth-First Search - easy\" | Hashnode"
description: "Discussion on \"BFS - Breadth-First Search - easy\". So what are graphs exactly ?\nlets see what Wikipedia has to say about graphs:\n\na graph is a structure amounting to a set of objects in which some pairs of the objects are in some sense \"related\". The objects correspond to mathematical abstractions ca..."
url: "https://hashnode.com/posts/bfs-breadth-first-search-easy/5c4c92ad86ae9b1b6b0e99cc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [BFS - Breadth-First Search - easy](https://hashnode.com/post/bfs-breadth-first-search-easy?utm_source=hashnode&utm_medium=feed)

So what are graphs exactly ? lets see what Wikipedia has to say about graphs: a graph is a structure amounting to a set of objects in which some pairs of the objects are in some sense "related". The objects correspond to mathematical abstractions ca...

Jan 26, 2019 · hashnode.com  
Read the article

-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#computer-science](https://hashnode.com/tag/computer-science)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)
-   [#bfs](https://hashnode.com/tag/bfs)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Benny Elgazar](https://hashnode.com/@Benny)

@Benny · Israel

  
[View profile](https://hashnode.com/@Benny)

Data-Engineer @ gett

Data enthusiast &amp; Problem solver

## Responses 1

Markdown supported · ⌘↵ to post

[Rattanak Chea](https://hashnode.com/@rattanak)

[Jan 27, 2019](https://hashnode.com/posts/bfs-breadth-first-search-easy/5c4c92ad86ae9b1b6b0e99cc/comment/5c4d43aec30d058d61cb95c6)

In the code, is it assumed that there is always a path to person\_to\_find? The while loop could potentially run infinitely if not found?

[Benny Elgazar](https://hashnode.com/@Benny)

[Jan 27, 2019](https://hashnode.com/posts/bfs-breadth-first-search-easy/5c4c92ad86ae9b1b6b0e99cc/comment/5c4d43aec30d058d61cb95c6#reply-5c4d4666b99429ff02b202f2)

Your are right, it was meant to be `while not lookup_queue.empty()`.

Thanks.
