• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:25
CEST 10:25
KST 17:25
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed17Weekly Cups (July 7-13): Classic continues to roll8Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
Esports World Cup 2025 - Brackets Revealed The Memories We Share - Facing the Final(?) GSL RSL Revival patreon money discussion thread Who will win EWC 2025? The GOAT ranking of GOAT rankings
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond) RSL: Revival, a new crowdfunded tournament series $5,100+ SEL Season 2 Championship (SC: Evo)
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Flash Announces (and Retracts) Hiatus From ASL BW General Discussion Soulkey Muta Micro Map? [ASL19] Finals Recap: Standing Tall
Tourneys
[Megathread] Daily Proleagues CSL Xiamen International Invitational 2025 ACS Season 2 Qualifier Cosmonarchy Pro Showmatches
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread CCLP - Command & Conquer League Project The PlayStation 5
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Korean Music Discussion Movie Discussion! [Manga] One Piece Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 643 users

[Math Puzzle] Day13

Blogs > evanthebouncy!
Post a Reply
Normal
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
Last Edited: 2009-06-08 04:29:09
June 08 2009 03:05 GMT
#1
from me: Please leave some comments as they mean a lot <3.

Last day's puzzle was first solved by Konfustikator, while Pseudo_Utopia might be easier to understand.

+ Show Spoiler [solution] +

Total color is 6, consider row_y which looks like
row_y = {(0,y), (1,y), (2,y), ... (6,y)}
clearly, row_y is a row with y axis value of y, and its x values ranges from 0 to 6.
Since each row has 7 elements, then 2 of them must be the same color.

Now consider this area formed by
{row_0, row_1, row_2, ... row_6^7}

This is a huge tall rectangle with height 6^7+1 and width 7. Since with 6 colors, all rows of 7 elements have 6^7 kinds of coloring scheme, then with a height of 6^7+1 two rows, say row_i, row_j must have identical coloring scheme.

Then since both row_i and row_j has 1 color that's repeated, that color will form the rectangle, whos verticies are identical color.

Considering draw out a picture if this is not intuitive enough, but this is a very clean solution.


Today's puzzle is a bit into the computer science side, but still fairly math oriented. It is as follows.

You have a maze, here is how it's constructed:
the maze is made within a rectangular grid of size mxn, where m and n are arbitarily chosen natural numbers.
Of any grid, it can either be part a path or a wall.
From any point inside the maze, provided that it's not a wall, will have a way out.
Then clearly, to walk outside of a maze, you'll have to go up, down, left, right in some way.

You also have a robot, here's the property of the robot:
You can code the robot to move in a certain way. For instance, coding it with the sequence:
left, left, up, up will make the robot attempt to move left twice, and up twice.
If the robot is blocked on the left, executing the move "left" multiple times will not move the robot.
The robot has no sense of perception, that is to say:
-It cannot know if it hits a wall
-It cannot know where it is inside the maze
-It does not know how far it has walked

Your Job:
Code the robot in such a way that for ANY valid maze [that is to say, for any m, n maze size and for any valid maze construction of that size] the robot will eventually be able to get out.
The fine print:
By ANY valid maze it means that regardless of size of m, n, and regardless of maze design, the robot will be able to move outside the maze eventually. That is to say, while you are coding, you cannot assume a certain m, n, or design.

Some example pictures:
[image loading]

Here is an example of a valid maze, with the maze area being black and white, and the outside area colored green. where the robot starts at the red point, and executing the instruction:
up-up-down-down-right-right-left-left
then ends up at point blue.

Again, post anything that comes across your mind, and if you're confident that you have the answer, put it in a spoiler. GL!
Again, leave a comment, it'll be much appreciated and kept me doing these blogs.

Edit:
No "random move" algorithms please.


Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Zozma
Profile Blog Joined November 2008
United States1626 Posts
June 08 2009 03:34 GMT
#2
Hmm. Left, down, right, up(times infinity) would ensure that our robot friend could always make progress, but if he gets caught in four open squares it wouldn't work. This is an interesting one, but I don't think I know enough to solve it. T_T
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 03:38 GMT
#3
Far worse than that, even in the example with the red dot, LDRU repeated endlessly just results in it moving back and forth between the dot and the square below it.

My first thought on reading the question was "yay implement BFS ezpz" and then I got to the part where the robot can't sense anything. ;; Trying to think of some kind of psuedo-BFS (or more likely DFS in this case) I could implement without feedback.
Malongo
Profile Blog Joined November 2005
Chile3472 Posts
June 08 2009 03:49 GMT
#4
I just noted that doing the Zig-Zag route up-right m*n times puts the robot in some "accumulation points" at corners. Im thinking about up-right m*n times then twisting the direction so the up-right becomes left-up. I think the brute force solution is some sort of up-right, left-up, down-left, right-down (each one m*n times) and then if you do the same again the robot ends up at the same square so you can do repeat but this time in other direction. Damn its hard to explain.
Help me! im still improving my English. An eye for an eye makes the whole world blind. M. G.
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 03:50 GMT
#5
Spoilering in case I'm getting close to the answer, but I don't think I'm there yet.

+ Show Spoiler +
Thinking about it more, psuedo-BFS may be the way to go after all. Because of the maze definition, there is some sequence of moves that will get the robot out. You could have it essentially attempt all possible combinations in a logical order (i.e. U; R; D; L; UU; UR; UD; UL; RU... etc.) that's easily written through loops, and do the inverse after each attempt (i.e. say it tries the sequence UDLRUDUDRR, the inverse would be LLUDUDLRUD) to attempt to return to the starting point, then start the next sequence. The problem with that is that since you have no feedback, performing the inverse sequence of moves is unlikely to return you to the starting position.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
June 08 2009 03:54 GMT
#6
On June 08 2009 12:50 Macavenger wrote:
Spoilering in case I'm getting close to the answer, but I don't think I'm there yet.

+ Show Spoiler +
Thinking about it more, psuedo-BFS may be the way to go after all. Because of the maze definition, there is some sequence of moves that will get the robot out. You could have it essentially attempt all possible combinations in a logical order (i.e. U; R; D; L; UU; UR; UD; UL; RU... etc.) that's easily written through loops, and do the inverse after each attempt (i.e. say it tries the sequence UDLRUDUDRR, the inverse would be LLUDUDLRUD) to attempt to return to the starting point, then start the next sequence. The problem with that is that since you have no feedback, performing the inverse sequence of moves is unlikely to return you to the starting position.


You can't do inverse.
For instance, say your robot has a wall on the immediate left.
The sequence LLL will be inversed to RRR, yet LLLRRR will certainly NOT make you go back to the original point.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 03:56 GMT
#7
For Malongo:

+ Show Spoiler +
I looked at a couple of approaches very similar to that, and I don't think it quite works. Running some test cases on the example provided, the collection points can end up not being anywhere near the exit, and having no direct path between any collection point and the exit. If you got lucky and tried R-D followed by L-D immediately from the start, you'd get it, but you can't assume that kind of luck, and the starting position shown is not actually a collection point itself, so you can't really get back to it. Unless there's some way of juggling the order of attempts I haven't thought of, I don't think what you have is going to reliably produce a solution.
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 03:56 GMT
#8
On June 08 2009 12:54 evanthebouncy! wrote:
Show nested quote +
On June 08 2009 12:50 Macavenger wrote:
Spoilering in case I'm getting close to the answer, but I don't think I'm there yet.

+ Show Spoiler +
Thinking about it more, psuedo-BFS may be the way to go after all. Because of the maze definition, there is some sequence of moves that will get the robot out. You could have it essentially attempt all possible combinations in a logical order (i.e. U; R; D; L; UU; UR; UD; UL; RU... etc.) that's easily written through loops, and do the inverse after each attempt (i.e. say it tries the sequence UDLRUDUDRR, the inverse would be LLUDUDLRUD) to attempt to return to the starting point, then start the next sequence. The problem with that is that since you have no feedback, performing the inverse sequence of moves is unlikely to return you to the starting position.


You can't do inverse.
For instance, say your robot has a wall on the immediate left.
The sequence LLL will be inversed to RRR, yet LLLRRR will certainly NOT make you go back to the original point.

I said that in my explanation It's why I said I didn't think I had it yet.
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 04:03:42
June 08 2009 03:57 GMT
#9
randomly choose the direction. even if it takes ages, at some point you will get out :o
You can reach the rainbow. I'll be there to help.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
June 08 2009 04:02 GMT
#10
On June 08 2009 12:56 Macavenger wrote:
Show nested quote +
On June 08 2009 12:54 evanthebouncy! wrote:
On June 08 2009 12:50 Macavenger wrote:
Spoilering in case I'm getting close to the answer, but I don't think I'm there yet.

+ Show Spoiler +
Thinking about it more, psuedo-BFS may be the way to go after all. Because of the maze definition, there is some sequence of moves that will get the robot out. You could have it essentially attempt all possible combinations in a logical order (i.e. U; R; D; L; UU; UR; UD; UL; RU... etc.) that's easily written through loops, and do the inverse after each attempt (i.e. say it tries the sequence UDLRUDUDRR, the inverse would be LLUDUDLRUD) to attempt to return to the starting point, then start the next sequence. The problem with that is that since you have no feedback, performing the inverse sequence of moves is unlikely to return you to the starting position.


You can't do inverse.
For instance, say your robot has a wall on the immediate left.
The sequence LLL will be inversed to RRR, yet LLLRRR will certainly NOT make you go back to the original point.

I said that in my explanation It's why I said I didn't think I had it yet.

HAHHA i read everything but your last sentence. >_<
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 04:04 GMT
#11
+ Show Spoiler +
Also, you might want to revise the question a wee bit, since I think technically if you just tell the robot to choose a random direction at each move, statistically it will get out eventually... but I don't think that's really in the spirit of the problem.
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 04:16:21
June 08 2009 04:14 GMT
#12
+ Show Spoiler +
loop LU * i, RU * i, RD * i, LD * i with i increasing every cycle from 1 to max(m,n) and reset i to 1 when if it reaches the upper boundary.

I guess you can trap this as well but I'm too tired to think properly :o
You can reach the rainbow. I'll be there to help.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
June 08 2009 04:16 GMT
#13
On June 08 2009 13:14 ven_ wrote:
+ Show Spoiler +
loop LU * i, RU * i, RD * i, LD * i with i increasing every cycle from 1 to max(m,n) and reset i to 1 when if it reaches the upper boundary.

I guess you can trap this as well but I'm too tired to think properly :o

It does not know what is a boundry.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
June 08 2009 04:17 GMT
#14
On June 08 2009 13:04 Macavenger wrote:
Also, you might want to revise the question a wee bit, since I think technically if you just tell the robot to choose a random direction at each move, statistically it will get out eventually... but I don't think that's really in the spirit of the problem.

done
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
ven
Profile Blog Joined December 2008
Germany332 Posts
June 08 2009 04:20 GMT
#15
On June 08 2009 13:16 evanthebouncy! wrote:
Show nested quote +
On June 08 2009 13:14 ven_ wrote:
+ Show Spoiler +
loop LU * i, RU * i, RD * i, LD * i with i increasing every cycle from 1 to max(m,n) and reset i to 1 when if it reaches the upper boundary.

I guess you can trap this as well but I'm too tired to think properly :o

It does not know what is a boundry.

Well, the algorithm does. I'm referring to i reaching max(m,n).
You can reach the rainbow. I'll be there to help.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
June 08 2009 04:26 GMT
#16
On June 08 2009 13:20 ven_ wrote:
Show nested quote +
On June 08 2009 13:16 evanthebouncy! wrote:
On June 08 2009 13:14 ven_ wrote:
+ Show Spoiler +
loop LU * i, RU * i, RD * i, LD * i with i increasing every cycle from 1 to max(m,n) and reset i to 1 when if it reaches the upper boundary.

I guess you can trap this as well but I'm too tired to think properly :o

It does not know what is a boundry.

Well, the algorithm does. I'm referring to i reaching max(m,n).

Ah I should probably fix it...
By "Arbitary" I mean the algorithm provider does not know the size of m and n... I'll go fix it now. Thx.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
illu
Profile Blog Joined December 2008
Canada2531 Posts
June 08 2009 04:27 GMT
#17
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.
:]
ven
Profile Blog Joined December 2008
Germany332 Posts
June 08 2009 04:31 GMT
#18
On June 08 2009 13:27 illu wrote:
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.

You don't know where the walls are.
You can reach the rainbow. I'll be there to help.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
June 08 2009 04:32 GMT
#19
On June 08 2009 13:27 illu wrote:
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.


Too technical, i have no clue what you just said.
just reading your (1) though: you cannot garentee that you "moved" in a sense that the robot does not know if its attempted move is not blocked by the wall.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 04:37 GMT
#20
On June 08 2009 13:32 evanthebouncy! wrote:
Show nested quote +
On June 08 2009 13:27 illu wrote:
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.


Too technical, i have no clue what you just said.
just reading your (1) though: you cannot garentee that you "moved" in a sense that the robot does not know if its attempted move is not blocked by the wall.

+ Show Spoiler +
It's been a couple years since I worked with Turning machines and non-determinism, so I'm a bit rusty, but reading his solution, I'm quite certain it correctly proves the existence of an algorithm. Non-deterministic Turing Machines can do some pretty interesting things, and can easily have paths that lead nowhere, which would be the equivalent of attempting to move into a wall.
illu
Profile Blog Joined December 2008
Canada2531 Posts
Last Edited: 2009-06-08 04:42:51
June 08 2009 04:37 GMT
#21
On June 08 2009 13:32 evanthebouncy! wrote:
Show nested quote +
On June 08 2009 13:27 illu wrote:
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.


Too technical, i have no clue what you just said.
just reading your (1) though: you cannot garentee that you "moved" in a sense that the robot does not know if its attempted move is not blocked by the wall.


You said it's more or less computer science. This is really standard stuffs. In fact I am not even a computer scientist and I know it.

EDIT:
just reading your (1) though: you cannot garentee that you "moved" in a sense that the robot does not know if its attempted move is not blocked by the wall.

That is irrevalent. So long as there is one possible path for an exit in finite time non-deterministic turing machine will give a pass. Try wiki on turing machines first.
:]
Zozma
Profile Blog Joined November 2008
United States1626 Posts
June 08 2009 04:38 GMT
#22
Alright... I don't have anything yet, but a few observations are:

The sequence has to include up, right, left, and down, otherwise you can be trapped.

There has to be net motion in one direction in the case of a 1000x1000 maze with no walls or something.

Up, right, left, down does not work. In other words, you need multiple moves to up, right, left, down in some sequence?

If this is something I had no chance of getting in the first place, I would be pretty sad. It's midnight, so I'm going to try again tomorrow.



evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
June 08 2009 04:41 GMT
#23
On June 08 2009 13:37 illu wrote:
Show nested quote +
On June 08 2009 13:32 evanthebouncy! wrote:
On June 08 2009 13:27 illu wrote:
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.


Too technical, i have no clue what you just said.
just reading your (1) though: you cannot garentee that you "moved" in a sense that the robot does not know if its attempted move is not blocked by the wall.


You said it's more or less computer science. This is really standard stuffs. In fact I am not even a computer scientist and I know it.

I c, lemme do some search on it.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 04:48:31
June 08 2009 04:46 GMT
#24
On June 08 2009 13:37 Macavenger wrote:
Show nested quote +
On June 08 2009 13:32 evanthebouncy! wrote:
On June 08 2009 13:27 illu wrote:
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.


Too technical, i have no clue what you just said.
just reading your (1) though: you cannot garentee that you "moved" in a sense that the robot does not know if its attempted move is not blocked by the wall.

+ Show Spoiler +
It's been a couple years since I worked with Turning machines and non-determinism, so I'm a bit rusty, but reading his solution, I'm quite certain it correctly proves the existence of an algorithm. Non-deterministic Turing Machines can do some pretty interesting things, and can easily have paths that lead nowhere, which would be the equivalent of attempting to move into a wall.

His approach doesn't work. He can't move into a direction that isn't a wall because he doesn't know where they are. Even if he knew where the walls were it wouldn't be much different from a NDTM that moved into any direction at all and it would accept. This is nothing else than using a random direction every step.
You can reach the rainbow. I'll be there to help.
illu
Profile Blog Joined December 2008
Canada2531 Posts
June 08 2009 04:51 GMT
#25
On June 08 2009 13:46 ven_ wrote:
Show nested quote +
On June 08 2009 13:37 Macavenger wrote:
On June 08 2009 13:32 evanthebouncy! wrote:
On June 08 2009 13:27 illu wrote:
Pretty easy.

+ Show Spoiler +

Since at any point there is one way out, we can create a non-deterministic Turing Machine as follows:

1. At each position, move to any of the other possible positions that are not walls.

Then this Turing Machine will always accept, by construction of the maze. We know that non-determinism gives no extra computation powers so we can come up with an algorithm by a Turing Machine to create this path, which executes on finite time.

The actual algorithm is extremely simple so I won't get too detailed in this. (wiki if you like). Just go with a breadth-first search and you will get a path that allows you to exit. As shown before this algorithm will complete on finite time which is what we want.


Too technical, i have no clue what you just said.
just reading your (1) though: you cannot garentee that you "moved" in a sense that the robot does not know if its attempted move is not blocked by the wall.

+ Show Spoiler +
It's been a couple years since I worked with Turning machines and non-determinism, so I'm a bit rusty, but reading his solution, I'm quite certain it correctly proves the existence of an algorithm. Non-deterministic Turing Machines can do some pretty interesting things, and can easily have paths that lead nowhere, which would be the equivalent of attempting to move into a wall.

His approach doesn't work. He can't move into a direction that isn't a wall because he doesn't know where they are. Even if he knew where the walls were it wouldn't be much different from a NDTM that moves into any direction at all and it would accept. This is nothing else than using a random direction every step.


But there is always one way to exit, so when we expand our tree diagram we will have one accepting state somewhere. So I think my NDTM will accept any solvable mazes.
:]
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 04:55 GMT
#26
ven brings up a good point that it might be equivalent to a random solution, though.

Need to be less rusty, argh D:
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 05:01:50
June 08 2009 04:58 GMT
#27
That's not the issue. Your turing machine would work with information that it doesn't have (where the walls are). Also as far as I understand the question we have to provide a deterministic algorithm to solve the maze which your non-deterministic TM doesn't do. :o
You can reach the rainbow. I'll be there to help.
Zozma
Profile Blog Joined November 2008
United States1626 Posts
Last Edited: 2009-06-08 05:13:39
June 08 2009 05:10 GMT
#28
Alright. This came to me while I was lying awake. I haven't thought too deeply about it, and I haven't even bothered to check it, but something like this:

+ Show Spoiler +
Okay. This is a bit hard to put in words. First: move along the "x-axis" the maximum number of times that you can + 1. Second, move along the "y-axis" the maximum number of times that you can in the maze + 1. Then use the same process reversing the directions along both axes.
(For instance, in a 100x100 maze, you would move right 101 times first, and then move down 101 times, or move left 101 times and then down 101 times, or whatever. Thus, you can exit the maze if it's "blank")

Now, this should allow you to end up going directly to the furthest possible space "To the left" or "upwards". Now the problem that I saw was that you can end up in a shape where the robot can move 50 times left, 0 times upward, 50 times right, 0 times downward- if he gets stuck in two shapes like [ and ].

To counter that, inject a random single move in any direction between every two long moves.


Even if this isn't it, hopefully I'm at least on to something.
ven
Profile Blog Joined December 2008
Germany332 Posts
June 08 2009 05:13 GMT
#29
On June 08 2009 14:10 Zozma wrote:
Alright. This came to me while I was lying awake. I haven't thought too deeply about it, and I haven't even bothered to check it, but something like this:

+ Show Spoiler +
Okay. This is a bit hard to put in words. First: move along the "x-axis" the maximum number of times that you can + 1. Second, move along the "y-axis" the maximum number of times that you can in the maze + 1. Then use the same process reversing the directions along both axes. Now, this should allow you to end up going directly to the furthest possible space "To the left" or "upwards". Now the problem that I saw was that you can end up in a shape like

[ r ]

R is the robot. He moves left 50 times or something, moves up forty times, and then moves right 50 times: an infinite loop.

To counter that, inject a random single move in any direction between every two long moves.


Even if this isn't it, hopefully I'm at least on to something.

You don't know the maximum number. I had a similar idea but without knowing how many times you can move you wouldn't know when to stop.
You can reach the rainbow. I'll be there to help.
Zozma
Profile Blog Joined November 2008
United States1626 Posts
Last Edited: 2009-06-08 05:15:14
June 08 2009 05:14 GMT
#30
+ Show Spoiler +
Yeah you do... Because the grid is only MxN, you can just use those numbers, right? If he runs into a wall, it's all good, he'll just stop there and continue going eventually in the next direction.
ven
Profile Blog Joined December 2008
Germany332 Posts
June 08 2009 05:17 GMT
#31
On June 08 2009 12:05 evanthebouncy! wrote:
The fine print:
By ANY valid maze it means that regardless of size of m, n, and regardless of maze design, the robot will be able to move outside the maze eventually. That is to say, while you are coding, you cannot assume a certain m, n, or design.

You can reach the rainbow. I'll be there to help.
Macavenger
Profile Blog Joined January 2008
United States1132 Posts
June 08 2009 05:18 GMT
#32
Yeah, not knowing m and n for the given maze really makes this more challenging. The only direction I can think to go with it at this point is some kind of spiraling thing, where you loop from 1 to k steps in each direction, then from k to 1, then increment k and repeat. Then you have to come up with some kind of crazy reordering of directions you're trying to avoid the collection points trap we were discussing early, I would think.
ven
Profile Blog Joined December 2008
Germany332 Posts
June 08 2009 05:19 GMT
#33
Yeah, I had the same idea of spiraling movement in my mind. Those pesky walls totally disrupting it of course :p
You can reach the rainbow. I'll be there to help.
Muirhead
Profile Blog Joined October 2007
United States556 Posts
Last Edited: 2009-06-08 05:55:46
June 08 2009 05:44 GMT
#34
+ Show Spoiler +
Suppose we are given the maze but not the starting position. Then we can solve the puzzle by looking at each possible starting position in turn. In short, we pick some box and assume the robot started there, giving it commands to solve the puzzle. Then, we pick a second box to assume the robot started in, see where the robot would be after our commands based on the first assumption, and give it commands to exit the maze. Etc.

Since the set of possible mazes is countable, we can adjoin the solutions for every given maze end to end and be done.
starleague.mit.edu
moriya
Profile Joined March 2009
United States54 Posts
Last Edited: 2009-06-08 07:01:28
June 08 2009 06:06 GMT
#35
Now I doubt that within finite steps the solution can be achieved...

The spiral path may be promising solution, if there exsits a solution.
evandi
Profile Joined June 2008
United States266 Posts
June 08 2009 06:25 GMT
#36
On June 08 2009 14:13 ven_ wrote:
Show nested quote +
On June 08 2009 14:10 Zozma wrote:
Alright. This came to me while I was lying awake. I haven't thought too deeply about it, and I haven't even bothered to check it, but something like this:

+ Show Spoiler +
Okay. This is a bit hard to put in words. First: move along the "x-axis" the maximum number of times that you can + 1. Second, move along the "y-axis" the maximum number of times that you can in the maze + 1. Then use the same process reversing the directions along both axes. Now, this should allow you to end up going directly to the furthest possible space "To the left" or "upwards". Now the problem that I saw was that you can end up in a shape like

[ r ]

R is the robot. He moves left 50 times or something, moves up forty times, and then moves right 50 times: an infinite loop.

To counter that, inject a random single move in any direction between every two long moves.


Even if this isn't it, hopefully I'm at least on to something.

You don't know the maximum number. I had a similar idea but without knowing how many times you can move you wouldn't know when to stop.


You don't have to know the maximum number. If you could guarantee that you had an algorithm capable of solving it for a given width/height you could run some loops varying the width height, increasing the maximum number the width and height can take each run through and then running the algorithm for those values. You would have to cover all of the possible width height combinations until you actually get to the real width/height.
evandi
Profile Joined June 2008
United States266 Posts
June 08 2009 07:09 GMT
#37
On June 08 2009 15:06 moriya wrote:
Now I doubt that within finite steps the solution can be achieved...

The spiral path may be promising solution, if there exsits a solution.


Muirhead solved it.
omG.[RaYnE]
Profile Joined October 2007
Philippines100 Posts
June 08 2009 07:18 GMT
#38
sure hope the op has an answer not just a trick question that has no answer to it
omG.[RaYnE] ---> rayne_ph :D
Monoxide
Profile Blog Joined January 2007
Canada1190 Posts
June 08 2009 09:33 GMT
#39
On June 08 2009 16:18 omG.[RaYnE] wrote:
sure hope the op has an answer not just a trick question that has no answer to it


evan's questions are always legit. Most of them are difficult(to me at least), but all of them have "real" answers.
DeathSpank
Profile Blog Joined February 2009
United States1029 Posts
June 08 2009 09:52 GMT
#40
+ Show Spoiler +
easy. bruteforce this shit. put your instructions in a dynamic array. Go through all the possibilities of instructions for the current size of the the array. ++the size of the array and you'll have it... eventually.
yes.
Cambium
Profile Blog Joined June 2004
United States16368 Posts
June 08 2009 09:57 GMT
#41
To those of you who gave generic CS solutions (be it greedy, breadth-depth search, etc.), it doesn't work because you don't know the "exit condition" because the robot doesn't know when it has hit a wall and could not move further. Your program will most likely result in an infinite loop.
When you want something, all the universe conspires in helping you to achieve it.
DeathSpank
Profile Blog Joined February 2009
United States1029 Posts
June 08 2009 10:02 GMT
#42
On June 08 2009 18:57 Cambium wrote:
To those of you who gave generic CS solutions (be it greedy, breadth-depth search, etc.), it doesn't work because you don't know the "exit condition" because the robot doesn't know when it has hit a wall and could not move further. Your program will most likely result in an infinite loop.

well then its going to do that anyways. I'm sure I could do the math to figure out the limit I need for my solution but I really am to lazy. Programmers are lazy dudes. No one would ever program anything without an exit condition. Even if you found a correct solution you would never know when you hit the exit. So you would keep going and going. The robot can't know where it is. I therefor assume that the robot will exit automatically when I have reached my destination.
yes.
Ivs
Profile Joined January 2008
Australia139 Posts
Last Edited: 2009-06-08 14:20:22
June 08 2009 14:12 GMT
#43
+ Show Spoiler +

I'll have a go at this.

Result 1: Given any two start position in a fixed maze and two robots on one each, there exists a finite instruction such that, when executed simultaneously by the two robots (and no collision between the robots, so they are like probes on mining mode), they will eventually stack.

Assume the contrary. Find two starting positions with the minimal shortest path (ie, for each pair calculate the shorest path, then find the pair with the minimal value) such that the above fails. Call the two squares A and B and put robots there. Say the Euclidean (ie, measure with ruler distance) distance between them currently be say, d.

Now let the robot at A move towards B using the shortest path and let the other robot replicate the moves. The shortest path between robots does not increase during this whole time since one robot is reducing it. The shortest path also does not decrease by our minimal assumption. When the first robot gets up to position B, let the other be at position C. Now the path looks just like the original, because as one robot was "erasing" the path, the other one was "tracing" an identical one. Hence the Vector BC = Vector AB. And C is now 2d distance away from A.

We can continue this process and yield points D, E, F etc which gets further away from A by d each time. This is a contradiction since our maze is finite.

Result 2: Given a fixed maze and a robot on each square of the maze, there exists a finite instruction such that, when executed simultaneously by all robots, they will all stack.

This follows directly from Result 1. We just pick out any two separated robots, use Result 1 to stack them. Since once stacked they don't unstack, we can just pretend they are one robot. Repeat until all robots are stacked.

For a particular maze, define the sequence of moves found in Result 2 the "imba sequence"

Now after performing the "imba sequence", say the stacked robots are on a square S (which only depends on the "imba sequence" and not the start points). For any other square T, we can just now 1a2a3a our stacked robots there. Call this sequence of moves "attack-T sequence".

Final Result: Define our algorithm as follows:

List out all possible strings made up of U,D,L,R of length k, for all k. Concatenate them all together (so list all the possible strings of length 1, then 2, then 3 etc). It's clear that this big string has countable length. We'll prove that this algorithm satisfies the problem.

For any square T on the maze, combine our "imba sequence" with our "attack-T sequence", call it "bisu sequence" or something. Clearly the sequence is finite, so it appears in our algorithm somewhere. Consider performing the algorithm up to the start of "bisu sequence". Now no matter where the robot is, the "bisu sequence" will bring it to square T. And since this works for any T, no matter where the end of the maze is, as long as it's finite, the robot will get there in finite number of moves.


Hopefully it is correct :-).

Edit: Just read Muirhead's, It's much shorter/nicer :-). At least this is different and has a few additional results.
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 14:53:29
June 08 2009 14:49 GMT
#44
+ Show Spoiler +
Start with a length of 1. Follow every possible sequence with that length. Increase length by 1. Repeat.

Example: U, R, D, L, (length+1), UU UR UD UL, (length+1), UUU, UUR, UUD, UUL, URU, URR, URD, URL, UDU, UDR, UDD, UDL, ULU, ULR, ULD, ULL, (length+1), etc..

This way we'll create every possible path through the maze. It doesn't matter that we change positions between the tries because for every position there is a solution and as soon as our path is long enough we will eventually find the exit path that matches our current position.

This would be easier if we had knowledge about the maze size because we could just always use the longest possible path for our length but since we don't have that we increase our path length until we reach the one that we need.
You can reach the rainbow. I'll be there to help.
WhenHellfreezes
Profile Joined November 2008
United States81 Posts
June 08 2009 19:15 GMT
#45
On June 08 2009 23:49 ven_ wrote:
Start with a length of 1. Follow every possible sequence with that length. Increase length by 1. Repeat.

Example: U, R, D, L, (length+1), UU UR UD UL, (length+1), UUU, UUR, UUD, UUL, URU, URR, URD, URL, UDU, UDR, UDD, UDL, ULU, ULR, ULD, ULL, (length+1), etc..

This way we'll create every possible path through the maze. It doesn't matter that we change positions between the tries because for every position there is a solution and as soon as our path is long enough we will eventually find the exit path that matches our current position.

This would be easier if we had knowledge about the maze size because we could just always use the longest possible path for our length but since we don't have that we increase our path length until we reach the one that we need.


There is a problem with your assumptions. That it doesn't matter that we change positions is incorrect for example consider the length of three. It is possible that after doing UUU, UUR, UUD, that you moved to a spot such that UUU is the correct way to exit but you won't do that sequence again since you already did it in your rotation. The way to fix that would be to have every permutation of sequences for each length. Thus for every length i you would have (4^i)! sequences of lengths i. The total sum of moves in this sequence passes 1 mil within just like 5-6 lengths. Therefore a random algorithm would be loads better. I seriously don't understand why you are disallowing that.
Doom!
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 19:30:32
June 08 2009 19:24 GMT
#46
I do say that it will follow every possible arrangement of sequences for each length. So it will repeat ifself again. It will in fact repeat every previously used sequence 4 times per increase in length.
You can reach the rainbow. I'll be there to help.
WhenHellfreezes
Profile Joined November 2008
United States81 Posts
June 08 2009 19:39 GMT
#47
You missed what I'm saying completly.

You have every possible sequence of moves of length 3 as per what you said. But what I'm saying is that there are 4^3 such sequences and that you need to have every such possible arrangment of those sequences in order to fix the problem of not knowing where you are.

You need to write every permutation of these 4^3 sequences or (4^3)! sequences of length 3.

I'm saying that you stop at 4^3 and you need (4^3)!.
Doom!
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 20:29:56
June 08 2009 20:29 GMT
#48
No, I don't stop anywhere. The length will increase indefinitely. The example only shows the first 3 steps in order to show how it works. It doesn't stop there.
You can reach the rainbow. I'll be there to help.
WhenHellfreezes
Profile Joined November 2008
United States81 Posts
June 08 2009 21:28 GMT
#49
no i know that you continue past 3. I'm saying that you to have your step for each length be longer.
Doom!
moriya
Profile Joined March 2009
United States54 Posts
June 08 2009 21:59 GMT
#50
Such a solution tells nothing about the core of questions...
I thought the original question is to ask a gernal solution for every possible box. For example, in 1D case the solution is UDDUUUDDDDUUUUU...How to prove that there is no such a sequence for 2D case?
On June 08 2009 16:09 evandi wrote:
Show nested quote +
On June 08 2009 15:06 moriya wrote:
Now I doubt that within finite steps the solution can be achieved...

The spiral path may be promising solution, if there exsits a solution.


Muirhead solved it.

Muirhead
Profile Blog Joined October 2007
United States556 Posts
Last Edited: 2009-06-08 22:19:09
June 08 2009 22:11 GMT
#51
My solution is exactly the equivalent of UDDUUUDDDDUUUUU... in the 1-dimensional case.
I provide a single sequence which solves every possible maze.

All solutions posted are either like mine and Ivs's, grossly inefficient but nicely deterministic, or they are based on randomness. The random solutions are in many senses nicer but are "only" guaranteed to succeed with probability 1. Which you prefer depends on whether you want to be a practical computer scientists or an AWESOME MATHEMATICIAN ^^.

Though to be honest, I don't know enough (any) comp sci. Could someone summarize how fast my algorithm runs compared to a random algorithm?
starleague.mit.edu
ven
Profile Blog Joined December 2008
Germany332 Posts
Last Edited: 2009-06-08 23:04:15
June 08 2009 23:01 GMT
#52
You didn't really provide any actual algorithm.
But even then, any algorithm to solve a maze of this kind would be so horribly inefficient and slow that it doesn't make sense to compare their runtime.
You can reach the rainbow. I'll be there to help.
Muirhead
Profile Blog Joined October 2007
United States556 Posts
June 08 2009 23:54 GMT
#53
Sure I provided an actual algorithm
starleague.mit.edu
Ivs
Profile Joined January 2008
Australia139 Posts
June 09 2009 02:04 GMT
#54
I don't think it is obvious that

On June 08 2009 23:49 ven_ wrote:
+ Show Spoiler +

This way we'll create every possible path through the maze. It doesn't matter that we change positions between the tries because for every position there is a solution and as soon as our path is long enough we will eventually find the exit path that matches our current position.



Every possible path does occur, but you haven't shown that upon the positional change, the right path will follow.

For example, considers two squares A and B, let the classes of sequences that finish the maze be c(A) and c(B). Each member c(A) and c(B) does occur infinitely often, but you could have say, each element of c(B) only follows position A and each of c(A) only follows position B. To complete it you would need to show that the sets c(A) and c(B) have common elements, which they in fact do.
Daveed
Profile Blog Joined December 2006
United States236 Posts
June 09 2009 17:32 GMT
#55
@ Muirhead:
I know that this problem doesn't specify it, but generally, robots should be constrained by processing ability and memory. Keeping an enumeration of 2^{m*n} possible mazes should be out of the question. As a math solution, this would work, but I don't think the quantifiers of the problem were set up as well as they could have been.

That being said, I believe some variant of bugnav should do the trick.
Muirhead
Profile Blog Joined October 2007
United States556 Posts
June 09 2009 17:52 GMT
#56
Hrm I'm pretty sure that to execute my solution the robot would only need to keep one maze in its head at a time, though it would need to remember a set of directions corresponding to every square on the maze.
starleague.mit.edu
mmp
Profile Blog Joined April 2009
United States2130 Posts
Last Edited: 2009-06-09 19:49:56
June 09 2009 19:02 GMT
#57
On June 08 2009 14:44 Muirhead wrote:
+ Show Spoiler +
Suppose we are given the maze but not the starting position. Then we can solve the puzzle by looking at each possible starting position in turn. In short, we pick some box and assume the robot started there, giving it commands to solve the puzzle. Then, we pick a second box to assume the robot started in, see where the robot would be after our commands based on the first assumption, and give it commands to exit the maze. Etc.

Since the set of possible mazes is countable, we can adjoin the solutions for every given maze end to end and be done.


Interesting that you can try exhaustively on all mazes without worrying where the previous maze left your robit, since you are guessing from an unknown starting location. Counter intuitive, but cool once you think about it.

Worst-case runtime:
+ Show Spoiler +

Let B be the enumeration of possible mazes. This isn't exactly 2 ^ (m x n), since any open square must lead to an exit, but it is O(2 ^ (m x n)). To prove this, consider all mazes that do not have a solution path and are therefore invalid. Now make every other row entire open. All previously-invalid open squares are now adjacent to a solution row, while preserving (m x n) / 2 of the cells.

For every board there are O(m x n) starting positions to try. Since you know which board you are currently trying, there exists a known solution path of length O(m x n). So we immediately know that it will require O(B x m^2 x n^2) moves.


I'll work on non-deterministic runtime and expected runtime in a bit.
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
King K. Rool
Profile Blog Joined May 2009
Canada4408 Posts
Last Edited: 2009-06-09 19:07:46
June 09 2009 19:05 GMT
#58
I thought the maze was supposed to be arbitrary?

Solutions to this (assuming maze is given) seem inefficient like ven_ said. Assuming we follow an algorithm like muirhead's (can't really think of another solution, his is pretty cool)

Worst case the last box you check would be the correct box. Obvious upper bound for boxes are O(m^2 * n^2). Number of boxes to check would be O(m^2 * n^2). Of course you likely could math it down to a better upper bound.

Something similar to ...

loop1 : i = 1.. m^2 * n^2 //ith box you check
loop2: j = 1 .. i //follow 1..ith path
m^2*n^2 instructions //follow the path

Not sure if my math is right (not going to bother thinking too much, at work), but you get something like an arithmetic series 1+2+3+...+k, where k is m^2 * n^2. We know that the 1+2+...k is O(k^2), so you get O(m^4 n^4), but then this is assuming one instruction. We have at most m^2n^2 instructions so you get m^6n^6.

O(m^6n^6) + finding paths for all boxes (which seems like it'll be easier to do).
mmp
Profile Blog Joined April 2009
United States2130 Posts
Last Edited: 2009-06-09 20:04:59
June 09 2009 19:40 GMT
#59
On June 10 2009 02:32 Daveed wrote:
@ Muirhead:
I know that this problem doesn't specify it, but generally, robots should be constrained by processing ability and memory. Keeping an enumeration of 2^{m*n} possible mazes should be out of the question. As a math solution, this would work, but I don't think the quantifiers of the problem were set up as well as they could have been.

That being said, I believe some variant of bugnav should do the trick.


Most bug pathfinders are based on some limited information about the map. Our robit cannot detect collisions (or anything for that matter), so wall-crawling, tangent bug, etc. are simply out of the question. Because we have no information, the problem lends itself to non-heuristic approach.

As for memory constraints, you require (m x n) bits to store any one maze. Generating another is simply a matter of incrementing bits until you have exhausted all permutations. For any given maze, I believe that you can construct a spanning tree of the adjacency matrix in O(m x n) time. You can search the tree for a solution (not necessarily the shortest) from any starting location in just as much time (linear).

Computationally, 2 ^ (m x n) is bad, but you really cannot avoid this part of the problem. At best, you can do a depth-first approach and compute massively in parallel.
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
Daveed
Profile Blog Joined December 2006
United States236 Posts
June 09 2009 20:08 GMT
#60
@Muirhead:
Although it needs to keep only one maze in its head at a time, it also needs to know which maze it's on, in order to generate the next maze in its enumeration (that IS what you are doing, correct?).

@ mmp: I had overlooked the inability of the robot to detect where it was. Sure, point taken.
mmp
Profile Blog Joined April 2009
United States2130 Posts
Last Edited: 2009-06-09 20:50:46
June 09 2009 20:16 GMT
#61
On June 10 2009 05:08 Daveed wrote:
@Muirhead:
Although it needs to keep only one maze in its head at a time, it also needs to know which maze it's on, in order to generate the next maze in its enumeration (that IS what you are doing, correct?).



I wrote:
As for memory constraints, you require (m x n) bits to store any one maze.


That should read, (m x n) bits to keep track of the maze you are on. Simply increment the bits to look at the next maze. The information encoding IS the structure it represents (let every 1 be a wall, 0 non-wall).
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
Daveed
Profile Blog Joined December 2006
United States236 Posts
June 09 2009 21:10 GMT
#62
That's true, gg
Normal
Please log in or register to reply.
Live Events Refresh
Next event in 1h 36m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 245
trigger 34
StarCraft: Brood War
BeSt 266
Soma 261
Barracks 177
Backho 169
Dewaltoss 136
Larva 136
sorry 49
ajuk12(nOOB) 30
Sharp 16
Britney 0
Dota 2
ODPixel695
XcaliburYe591
League of Legends
JimRising 664
Super Smash Bros
Westballz39
Heroes of the Storm
Khaldor192
Other Games
summit1g5547
Fuzer 159
SortOf91
Trikslyr25
Organizations
Other Games
gamesdonequick2737
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH323
• practicex 30
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2181
League of Legends
• Stunt1212
Upcoming Events
CranKy Ducklings
1h 36m
Epic.LAN
3h 36m
CSO Contender
8h 36m
Sparkling Tuna Cup
1d 1h
Online Event
1d 7h
Esports World Cup
3 days
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Esports World Cup
4 days
Esports World Cup
5 days
Esports World Cup
6 days
Liquipedia Results

Completed

CSL Xiamen Invitational: ShowMatche
RSL Revival: Season 1
Murky Cup #2

Ongoing

BSL 2v2 Season 3
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
CSL Xiamen Invitational
2025 ACS Season 2
Championship of Russia 2025
Underdog Cup #2
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.