Editing 2407: Depth and Breadth

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 10: Line 10:
 
{{w|Tree (data structure)|Tree structure}}s are one of the most common data structures used in computer science.  The common ways of enumerating items arranged in a tree is either {{w|Depth-first search|depth-first}}, or {{w|Breadth-first search|breadth-first}}, which are depicted accurately in the comic.  Randall humorously combines the words, to produce "brepth-first", "deadth-first", "bread-first", and "death-first" search algorithms.
 
{{w|Tree (data structure)|Tree structure}}s are one of the most common data structures used in computer science.  The common ways of enumerating items arranged in a tree is either {{w|Depth-first search|depth-first}}, or {{w|Breadth-first search|breadth-first}}, which are depicted accurately in the comic.  Randall humorously combines the words, to produce "brepth-first", "deadth-first", "bread-first", and "death-first" search algorithms.
  
βˆ’
Depth-first search explores down a full branch of the tree before working back to a higher level. This type of tree structure was already discussed as inefficient for human needs in [[761: DFS]]. The "opposite" of this is breadth-first search, which explores each level of the tree at a time.
+
Depth-first search explores down the full branches of the tree before exploring the higher levels of the tree. The "opposite" of this is breadth-first search, which explores each level of the tree at a time. This type of tree structure was already discussed as inefficient for human needs in [[761: DFS]].
  
βˆ’
In the "brepth-first" algorithm, a depth-first and a breadth-first search are hybridized where the left-most node is visited more frequently than the right node, but the right node is still visited.  This might be good for exploring data that is loosely but not strictly weighted to the left, or where data in deeper nodes needs some time to be loaded before it can be used. As implied by [[761: DFS]], this might be the best algorithm for a human to employ, where one can explore several topics briefly before deciding which one to explore more deeply, rather than blindly following the first rabbit hole to an absurd conclusion. Informed search algorithms like {{w|A* search algorithm|A* search}}, {{w|Beam search}}, and other {{w|Best-first search}} algorithms show this type of behavior by expanding the most ''promising'' node in the current set (under some appropriate metrics).
+
In the "brepth-first" algorithm, a depth-first and a breadth-first search are hybridized where the left-most node is visited more frequently than the right node, but the right node is still visited.  This might be good for exploring data that is loosely but not strictly weighted to the left, or where data in deeper nodes needs some time to be loaded before it can be used. As implied by [[761: DFS]], this might be the best algorithm for a human to employ, where one can be just as knowledgeable as needs be in just enough topics to hold conversation or be quick to act in case of danger during a date. Informed search algorithms like [https://en.wikipedia.org/wiki/A*_search_algorithm A* search], [https://en.wikipedia.org/wiki/Beam_search Beam search] and other [https://en.wikipedia.org/wiki/Best-first_search Best-first search] algorithms show this type of behavior by expanding the most ''promising'' node in the current set (under some appropriate metrics).
  
 
The nature of the "deadth-first" algorithm is unclear and inefficient, since it searches the same nodes multiple times before moving to an entirely different region of the tree.  It might be useful in a context where examining nodes has some probability of returning a noisy or incorrect result, such as searching for small objects that may be overlooked.
 
The nature of the "deadth-first" algorithm is unclear and inefficient, since it searches the same nodes multiple times before moving to an entirely different region of the tree.  It might be useful in a context where examining nodes has some probability of returning a noisy or incorrect result, such as searching for small objects that may be overlooked.

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)