Solve RSA problem with node priority and adaptive edge priority