I would start with a unicursal maze generator. I had high hopes for the one shown here:
http://en.wikipedia.org/wiki/Maze_generation_algorithm - about 3/4 the way down the page under "Simple algorithms".

Unfortunately in practice, the mazes generated are less than spectacular. Having numerous enclosed squares and crappy stuff all over. Maybe I need to recheck my code.

Anyhow, maybe there are better algorithms out there.

Then when it's done, use the traditional "right-hand" rule to traverse the path - at the same time start numbering the cells of an array sequentially. Oh, the numeric array is probably twice the rows and cols as the maze - because you are going to travel all around the maze going in and then going out in the same halls.