Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7640449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:40:25+00:00 2026-05-31T08:40:25+00:00

The two most common ways to traverse a graph are breadth-first search and depth-first

  • 0

The two most common ways to traverse a graph are breadth-first search and depth-first search. Both of these search algorithms follow a common template:

  • Create a worklist W, seeded with the start node s.
  • While the worklist isn’t empty:
    • Remove the first element of the worklist; call it v.
    • If v is not visited:
      • Mark v as visited.
      • For each node u directly connected to v, add u to W.

In a breadth-first search, the worklist W is implemented as a FIFO queue, while in depth-first search it’s a LIFO stack. If W is a priority queue, you get uniform-cost search.

A while back I asked a question about a data structure for choosing random elements out of a bag. If you implement the above worklist W using this random bag, then you get a “random-first search” algorithm that randomly explores the nodes in the graph starting with the initial node.

My question is this: are there any known algorithms that use this type of search? That is, are there algorithms that work by generating a random spanning tree of the graph in this fashion?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T08:40:26+00:00Added an answer on May 31, 2026 at 8:40 am

    Automatic puzzle generation is an application for which random-first search is a useful strategy.

    Suppose you wish to generate an instance of a combinatorial puzzle like Sudoku. One approach is to generate a random, completely solved, instance, and then remove numbers as long as there’s still a unique solution. How do you generate that random solved instance in the first place? You start with an empty grid and apply a random-first solving algorithm. In fact, it proves to be fairly easy to use the same code for both generation and solution, by switching between random-first and best-first strategies for picking the next number to try.

    This is exactly what we did when writing the Nintendo DS game Zendoku, and I wrote a detailed article about our approach.

    See also this answer discussing maze generation using randomized Prim’s algorithm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that this is subjective, but I'd like to follow the most common
I`m writing binary search tree template for two reasons - learning C++ and learning
As far I know, the two most common methods of reading character-based data from
I am looking for an algorithm that could find the two most distant elements
I'm trying to write a query that will pull back the two most recent
I have two controllers which share most of their code (but must be, nonetheless,
Which of theese two alternatives do you find yourself using most often, and which
What is the most efficient way for checking for equality of two m *
Given two date ranges, what is the simplest or most efficient way to determine
The thing I hate most in CSS3 is that there is always two properties

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.