I don't really understand your question. So I'll take things to the extreme and assume there are n1 books, n2 categories, n3 super categories... etc.
This whole hierarchy can be represented as a rooted tree, and the number of valid permutations would be the number of postorder traversals of the tree (or equivalently, preorder).
(I don't expect this will ...
On the style of the code:
While I'm not saying the code is or isn't correct, there's some small tweaks you could make it to improve it's legibility:
Write code like you would write English (in some sense :P). After commas you needs spaces, so do
def crossover(p1, p2): instead of def crossover(p1,p2):;
random.uniform(b[i], b[i]) instead of ...