On a real bike this would vary between individuals, to maximize efficiency, often based off of your ratio of slow twitch vs. fast twitch muscles and how smooth you are. Usually guys with mostly slow twitch muscles will spin much faster than others, especially if they are smooth. Assuming the same output power, spinning faster actually uses your slow twitch muscles more because you are decreasing the force on the pedals due to leverage. Some people thinks this is counter intuitive, but slow twitch muscles can actually contract as much as 200 times per minute. The classic example is Lance Armstrong vs. Jan Ullrich. Lance spins very fast, typically at 120 rpm's and sometimes as much as 150-160, while Jan spins very slow comparatively, usually 80-85, sometimes as low as 55 maybe on hills, but they are both great and was close to the same level. If you swapped that around though, and made Jan spin fast and Lance spin slow, they'd both be much slower.
Basically spinning faster puts the strain on your cardio system more while spinning slower puts more strain on your muscles, usually your fast twitch muscles if you get slow enough and forceful enough. But, different people are made in different ways so there is really no optimum exact number to shoot for that is the same for everybody. It's easy to say that you should bump up the rpm's as much as you can since it's more cardio oriented, but then your actual output power and endurance can suffer. Some people just can't handle certain ranges. Plus some people just aren't smooth, so if you can't smoothly put power to the pedals throughout the stroke, higher rpms do nothing but make your legs flail around wildly without producing much power.
Usually a standard cookie cutter response, if you insist on one, is to shoot for 90 rpm's. For most cyclists, this is the most efficient, in that you can maximize output power for the longest amount of time. This will typically mean that you will dip and spike between 85 and 95 rpm's.
Personally I wouldn't go by your heart rate because you can spike your heart rate at both very low and very high rpm's, depending on the intensity, so this doesn't tell you anything at all. I'd go by output power. Try to figure out what range you feel best at for extended periods of time while going as fast as you can, as in looking at the speedometer and not the speed of your legs.
Personally I like to stay at 80 or slightly higher, and I fluctuate usually between 78 and 85, sometimes getting down to 55 on steep hills and as much as 105 on slight hills if the wind is hitting me in the face. I'm all fast twitch though. I can pedal at higher rpm's but I'm not as fast, and if I bump up the intensity at higher rpm's, my legs burn really bad. I am most powerful at 82-85. Yours may be different.