Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single Fork Dataset Generator #23

Open
aaron-sandoval opened this issue Feb 4, 2024 · 1 comment
Open

Single Fork Dataset Generator #23

aaron-sandoval opened this issue Feb 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@aaron-sandoval
Copy link
Member

aaron-sandoval commented Feb 4, 2024

It would be useful to be able to easily generate datasets with a single fork (3-armed hallway -< ). The starting and ending positions would be constrained to lie at the ends of different arms.

@aaron-sandoval aaron-sandoval added the enhancement New feature or request label Feb 4, 2024
@aaron-sandoval aaron-sandoval self-assigned this Feb 4, 2024
@mivanit mivanit added performance make the code go fast and removed performance make the code go fast labels Feb 4, 2024
@aaron-sandoval aaron-sandoval removed their assignment Mar 12, 2024
@aaron-sandoval
Copy link
Member Author

aaron-sandoval commented Mar 12, 2024

Possible quick and dirty algorithm:

  1. Generate hallway maze
  2. Delete one random entry in the adjacency list between c1 and c2 with the following constraints
  • Neither c1 nor c2 may be a corner cell
  • Both c1 and c2 must have at least one other neighbor which is not one of the hallway terminal cells.
  • The order of c1 and c2 is arbitrary
  1. Add an entry in the adjaceny list between c2 and some neighboring cell c3 with which no direct connection currently exists.
  2. The resulting maze has a single fork with 3 terminal cells:
  • The 2 original hallway terminal cells
  • c1

Discussion

  • This algorithm will fail for 3x3 mazes where one hallway terminal cell is in the center
  • Seems like it should be pretty robust for 4x4 and larger mazes
  • The simplicity is due to the restrictions in step 2 introducing some bias in the distribution to avoid corner terminal cells
    • If this bias is problematic, then I also have idea for a less biased but more complex algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants