Stack Exchange
open access
CC BY-SA
Graph searching: Breadth-first vs. depth-first
When searching graphs, there are two easy algorithms: breadth-first and depth-first (Usually done by adding all adjactent graph nodes to a queue (breadth-first) or stack (depth-first)). Now, are there any advantages of one over another? The ones I could think of: If you expect your data to be pretty far down inside the graph, depth-first might find it earlier, as you are going down into the deeper parts of the graph very fast. Conversely, if you expect your data to be pretty far up in the graph, breadth-first might give the result earlier. Is there anything I have missed or does it mostly come down to personal preference?
Conceptio Open Archive
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
This document is indexed with metadata only: full text is not available in the archive for this record. Open the official source ↗
Related documents
- What are the reasons to learn different algorithms / data structures serving the same purpose?#796539
- Distance and resistance on random series-parallel graphs: logarithmic speeds and near-critical asymptotics#1049536
- AT&T/Neda's Efficient Short Remote Operations (ESRO) Protocol Specification Version 1.2#136889
- Right Ventricular Pacing in Pulmonary Arterial Hypertension#1093874
- Noson Yanofsky 403p (2013) द्वारा 'कारण की बाहरी सीमा' की समीक्षा Review of 'The Outer Limits of Reason' by Noson Yanofsky (संशोधित 2019)#770199
Record · ID 796549
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive