|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
Multiple solutions
I'm confused about the word shortest
Given the example maze: (and a few others I whipped up myself), it seems that there can be multiple "shortest" paths. For example, if I start numbering all of the spaces in the grid showing how many steps they are away from the start... In the example maze the following happens: php Code:
Both of the 9 spaces above lead to the 10th space in the maze... so which should I consider shortest? Should I show them both in my solution? |
|
#2
|
|||
|
|||
|
RE: Multiple solutions
Hrm..
I thought about this a little more and suspect that the shortest solution would be the one with the least amount of turns. (You know... the whole "shortest distance between two points is a straight line thing" One of those paths above requires a right turn to 9 from 8 and a left turn to 10 and then has to turn right again to go to 11... while the other goes straight from 8 to 9 without a turn... and then a right turn to 10 and then straight up to 11... Is this last path the way I should interpret shortest? |
|
#3
|
|||
|
|||
|
RE: Multiple solutions
I was just going to pose the same question. I have a couple of examples that are in png format.
![]() http://sig.mine.nu/maze/big2.png ![]() IMHO the shortest path would be the one with the least turns... if you think of the 'traveller' as a robot then the more turns it has to make the longer it will take to get through the maze. also adding the ability to move in diagonal will help solve this problem. ![]() but thats not allow I did have a thought though.. what about mazes with multiple levels... 3-D if you will where you can go up and down through floors... it would be too hard to add those vectors into code... and could be very cool. |
|
#4
|
|||
|
|||
|
RE: Multiple solutions
Either way would be the shortest since they are the same move count.
|
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > Multiple solutions |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|