Breadth-first search (BFS) is an algorithm used to explore nodes and edges in a graph or tree data structure. It starts at a selected node, called the "root," and explores all its neighboring nodes at the present depth before moving on to nodes at the next depth level. This systematic approach ensures that all nodes at a given distance from the root are visited before any nodes further away.
BFS is commonly implemented using a queue data structure, which helps keep track of the nodes to be explored next. This method is particularly useful for finding the shortest path in unweighted graphs, making it a fundamental technique in computer science and artificial intelligence.