An Algorithm for Multiplex Network Generation