Algorithm TODO ============== * Re-define genBlackSubMobiles to be able to choose whether the first edge is an actual edge rather than a bud. DONE * When starting, don't create every possible sub-mobile and then just add a bud: generate every possible sub-mobile where the first edge is an actual edge, and then add a bud (this avoids duplicating generation for every possible bud being marked). DONE, but fix up when finishing off the matching stuff. ERROR: not correct for b == 1 case, possibly for others (check!) The b == 1 case is now taken care of. * Split whites: no need for trailers, just replace W-----W with W--b--W DONE * Every time you add a white edge to a black node, add an incoming bud DONE * Fuse in matching buds: keep two stacks: - Unmatched incoming buds on LHS - Unmatched outgoing buds on RHS Every time you add an outgoing bud on the right, match one straight away to an unmatched incoming. When you add an incoming bud on the left, match one to an unmatched outgoing. DONE * When converting SubMobile to Mobile, finish the matchings from the two stacks. DONE * Create an outer face node for the remaining `d' outgoing buds, and flip their directions. DONE * Reject any mobile where the marked node doesn't have an edge to the outer face node. DONE * Create a copy where every edge from the marked node to the outer face node is marked (can merge with previous step). DONE * Remove White nodes. * Remove all SplitBlack nodes, and combine the edges: e.g. B--b--B => B-----B * Rather than filtering for White and SplitBlack nodes, keep a list of them as you create the SubMobile. * Take the inverse: no need to worry about labels, it should be all undirected, etc. * Isomorphism testing: for every edge, do a BFS from that edge, serialise it, and see if it's the minimum, that is: isCanonical (m,g) = all ((serBF g m) <=) . map (serBF g) $ edges g where serBF g' = serialise . breadthFirstLabelling g - Can possibly test for rotational isomorphism earlier on, though some of the fused steps may interfere with this. * Re-investigate the sharing stuff. * Re-investigate whether it makes more sense to permute then merge, or merge then permute the marked nodes. End Goal ======== Generate all possible DangDs as fast as possible. Only care about final, undirected, unlabelled result. Possible after-work =================== * Support for dangd-p (i.e. d-angulation of girth d but the outer face is p) - Isomorphism testing for this is simpler: just test for rotational isomorphism. * Try and remove the girth requirement.