## Maze generation algorithm for specified parts

I am an undergraduate student studying mechanical engineering. We are doing a project called the labyrinth cutter, we're constructing a piece of artwork consisting of a a gantry connected to a cutter head. The cutter is supposed to cut out a labyrinth to a piece of music.

I decided to use the midi file of the music piece to create straight parts with certain lengths. At various beats the labyrinths changes direction.

I used Java with J-music to do this and came out with 400 pieces that now have to be placed in a certain order to create a labyrinth. The lenghts of the pieces depend on the frequency of the note being played and the time between pieces.

I wrote a program in c++ that uses recursive backtracking, simply trying to place piece after piece and see if it fits. Currently up to about 150 pieces is doable but after this the computation time gets way to heavy.

I am wondering if anybody has an idea of a certain algorithm that could be used to solve this or point me in the right direction a bit as I'm not quite sure what I can do right now except for reducing the amount of pieces.

Picture shows a solution with 150 pieces, obviously this won't fill the area.

http://img89.imageshack.us/my.php?image=labyyc7.jpg

Also if you have another idea of how to represent the labyrinths creation as being done to the piece of music please state your idea.
 PhysOrg.com science news on PhysOrg.com >> New language discovery reveals linguistic insights>> US official: Solar plane to help ground energy use (Update)>> Four microphones, computer algorithm enough to produce 3-D model of simple, convex room

 Similar discussions for: Maze generation algorithm for specified parts Thread Forum Replies Introductory Physics Homework 13 Engineering, Comp Sci, & Technology Homework 0 Set Theory, Logic, Probability, Statistics 3 Forum Feedback & Announcements 5