4x4x4 cube solution?

Started by
2 comments, last by vaneger 21 years, 8 months ago
if you have a 4x4x4 cube and you start in any given corner how many differnt routes (assuming only right/left/up/down movements and that each square is onnly accessed once) can be made? are there any c++ implemetations to generate such a thing and if nto hwo should one go about coding one?
Advertisement
The solution is given by the number of leaves in the decision tree that corresponds to the decisions you can make at each successive step of the path through the cube.

You should be able to code that up fairly easily.

Cheers,

Timkin
1. either you require all squares reached
or
2. can we pick the shortest path?

1. dunno yet
2. 144. to go thru all possible _shortest_ path in 4x4 square you need 4*(4-1)=12 passes? NxN square you need N*(N-1) passes
add third dimension (the same equa) and you have 12*12 = 144
but i guest it is not what you meant

greets
pet
Pet
the shortest path i can figure out on my own, but what i need to know is how many paths can be made if you access each room once and then how to code some function that will generate one of those possible paths based on a string parameter.

This topic is closed to new replies.

Advertisement