Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating Pacman Labyrinth
#3
If you want to create a random graph, there is an algorithm by David Wilson that creates a random graph such that all possible graphs have an equal chance of being chosen. Pick a random node to start with. Then pick another random node, and add an edge to the current node if it is not already in the graph. The second random node becomes the current node whether or not it was already in the graph. Repeat this process until all of the possible nodes are in the graph. At that point you have a random spanning graph. You can now add edges to that graph randomly until you have the number of edges you want.

Since pacman labyrinths tend to be symmetrical, you might want to generate a random graph and then reflect it once or twice.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Creating Pacman Labyrinth - by alehak - Oct-19-2019, 10:10 PM
RE: Creating Pacman Labyrinth - by Clunk_Head - Oct-19-2019, 10:50 PM
RE: Creating Pacman Labyrinth - by ichabod801 - Oct-20-2019, 01:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple wall collision in pacman rustyjoe 4 4,128 Aug-11-2019, 08:08 AM
Last Post: rustyjoe

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020