@Carl Love @vv @tomleslie Thank you for the procedures. I am testing them with L1 (length=52190) and L2(lenth=121802). Some of the procedures are taking more than 3 hours to finish. I have modified my procedure to use Grid:-Map (Unfortunately, I don't know how to use infolevel[Threads:-Map] to check the progress, and therefore I left the use of Threads for later), and by doing that, the time is down to 17 minutes. I guess all the procedures will need some tuning to use parallelization tools. I can't imagine how long it will take to run the procedure when the lengths are over one million.
@Carl Love Many, many thanks for the implementation of the bipartite graph. I would appreciate if you could show me how to use embellishment options.
a) @tomleslie 's second routine
memory used=170.20GiB, alloc change=4.80MiB, cpu time=77.26h, real time=3.04h, gc time=76.90h
b) @Carl Love 's procedure
memory used=0.65TiB, alloc change=0 bytes, cpu time=20.05h, real time=3.26h, gc time=17.38h
c) @vv 's procedure
memory used=0.74TiB, alloc change=23.93GiB, cpu time=57.76h, real time=5.09h, gc time=54.58h
Bipartite option returns "Error, (in GraphTheory:-DrawGraph) input graph is not bipartite" using the example shown in the post above.