The case of bipartite maps: recursive program derived from ODE
> | # Returns the generating polynomial of ROOTED maps with n edges
# with u/v/z marking white v./black v./faces # Computation coefficient by coefficient from the non-shifted ODE: # (not optimized, a variant of Newton iteration could probably be used instead) bipmapsEdges:= proc(n) option remember: if n<1 then return 0: elif n=1 then return u*v*z; elif n=2 then return u^2*v*z+u*v^2*z+u*v*z^2+u*v*z; else eval(subs(eta(t)=a*t^(n)/2/n+add(bipmapsEdges(k)*t^(k)/2/k,k=1..n-1),bigODEbipartite)): factor(series(%,t=0,n+10)): coeff(%,t,n): factor(solve(%,a)): return %; fi; end: |
> | #Example: 5 edges
bipmapsEdges(5); |
(3.4.1) |
> | # Uses the previous one to compute maps by edges and genus
# (not optimal AT ALL for small genus since all genera are computed for each size) bipmapsEdgesGenus:= proc(n,g) option remember: if n<1 then return 0: else expand(subs(u=u/s,v=v/s,z=z/s,bipmapsEdges(n)*s^(n+2))): # print(%); return factor(coeff(%,s,2*g)); fi; end: |
> | #Example: 5 edges, genus 1
bipmapsEdgesGenus(5,1); |
(3.4.2) |