ok. I'm assuming you have a basic array. 1(start),2(room),3(keyroom),4(room),5(room),6(boss)
this always gives you a linear progression 1-2, 2-3, 3-4, 4-5, 5-6
randomly pick from 3 to max-1 (3,4,5) and make it connect to two rooms previous. E.G.
room 3 is connected to room 1 and NOT room 2 (a branch)
This would give you some variance and not a linear progression (and more interesting to play)