When.com Web Search

Search results

  1. Results From The WOW.Com Content Network
  2. Depth-first search - Wikipedia

    en.wikipedia.org/wiki/Depth-first_search

    no (does not generally find shortest paths) Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. The algorithm starts at the root node (selecting some arbitrary node as the root node in the case of a graph) and explores as far as possible along each branch before backtracking.

  3. Water pouring puzzle - Wikipedia

    en.wikipedia.org/wiki/Water_pouring_puzzle

    Water pouring puzzle. Starting state of the standard puzzle; a jug filled with 8 units of water, and two empty jugs of sizes 5 and 3. The solver must pour the water so that the first and second jugs both contain 4 units, and the third is empty. Water pouring puzzles (also called water jug problems, decanting problems, [1][2] measuring puzzles ...

  4. Tarjan's strongly connected components algorithm - Wikipedia

    en.wikipedia.org/wiki/Tarjan's_strongly_connected...

    The basic idea of the algorithm is this: a depth-first search (DFS) begins from an arbitrary start node (and subsequent depth-first searches are conducted on any nodes that have not yet been found). As usual with depth-first search, the search visits every node of the graph exactly once, refusing to revisit any node that has already been visited.

  5. Iterative deepening depth-first search - Wikipedia

    en.wikipedia.org/wiki/Iterative_deepening_depth...

    Optimal. yes (for unweighted graphs) In computer science, iterative deepening search or more specifically iterative deepening depth-first search[1] (IDS or IDDFS) is a state space /graph search strategy in which a depth-limited version of depth-first search is run repeatedly with increasing depth limits until the goal is found.

  6. Tree traversal - Wikipedia

    en.wikipedia.org/wiki/Tree_traversal

    In depth-first search (DFS), the search tree is deepened as much as possible before going to the next sibling. To traverse binary trees with depth-first search, perform the following operations at each node: [3] [4] If the current node is empty then return. Execute the following three operations in a certain order: [5] N: Visit the current node.

  7. Graph traversal - Wikipedia

    en.wikipedia.org/wiki/Graph_traversal

    A depth-first search (DFS) is an algorithm for traversing a finite graph. DFS visits the child vertices before visiting the sibling vertices; that is, it traverses the depth of any particular path before exploring its breadth. A stack (often the program's call stack via recursion) is generally used when implementing the algorithm.

  8. Maze generation algorithm - Wikipedia

    en.wikipedia.org/wiki/Maze_generation_algorithm

    This algorithm, also known as the "recursive backtracker" algorithm, is a randomized version of the depth-first search algorithm. Frequently implemented with a stack, this approach is one of the simplest ways to generate a maze using a computer. Consider the space for a maze being a large grid of cells (like a large chess board), each cell ...

  9. Topological sorting - Wikipedia

    en.wikipedia.org/wiki/Topological_sorting

    An alternative algorithm for topological sorting is based on depth-first search.The algorithm loops through each node of the graph, in an arbitrary order, initiating a depth-first search that terminates when it hits any node that has already been visited since the beginning of the topological sort or the node has no outgoing edges (i.e., a leaf node):