Network alignment and motif discovery in dynamic networks