I have one nitpick on the definitions on railroading. I think RR-ing is not when the PC's have no choices; it's when the PC's believe that they have no choices. A good DM should be able to take a fairly railroady adventure and still give the illusion that the PC's are in the driver's seat the whole time. Part of the art of DMing is giving the players control of the plot when you can, and maintaining the illusion that they are in control when they aren’t.
For instance, if the adventure requires the PC's to steal the McGuffin, and they track down a sage who tells them that the McGuffin can only be found in the Flaming Volcano Mines of the East, that might smack of RR-ing. But, if he tells them that there are three surviving McGuffins, and one is in the Flaming Volcano Mines of the East, one is in the Palace of the Icy Winds in the North, and one is in the Poison Bog of the West, then they now believe that they have a choice. In fact, it's the same dungeon map, NPC's, etc. in each case. The only thing that gets switched out is the type of elemental damage they'll face, the color of the dragons, and the name that the evil clerics will be wailing when they die. But if it is done well, then the players will believe that they had a choice and that they are driving the plot.
Now, some modules are not quite so easy to work with, but to me as a DM, that is precisely my opportunity to creatively shine. Essentially, most DM work is creativity in advance with time to spare, and most playing as a PC is creativity on the spot, under pressure. As a DM, I look forward to those rare moments when the PC's derail the plot and I need to think on my feet. You shouldn't need to pause the game for three hours while you think. You should have at least one or two "buy some time" encounters that you can spring on the players to give you time to think, and you should use that time to figure out how to lead them back to the module plot while still maintaining the illusion of choice.
If you can't think on your feet that fast, or there doesn't seem to be any way to mesh the players' actions with the module plot, then the key rule for any DM is to let player choice take precedence. You will eventually get some time to think, even if it is after this gaming session is over and before the next one starts, and you can use that time to figure out how to get back on track, or how to alter the tracks to meet their new heading, or how to completely throw out the old module and start into a new module with some of the same NPC names.
That leads into a second illusion that is helpful to maintain: the players should not be able to tell where the module ends and the DM creativity begins. This is actually important to support the original illusion of “constant player control”. If you read the boxed text to the players for three sessions and it all goes according to plan, and then in the fourth session they decide to do something that they know is very likely to stray from the plot, and suddenly you stammer through an obviously improvised encounter, or even tell the players afterwards that they surprised you and you had to make something up, then you also just told them that everything they have done so far was easily railroaded to match the module and that they only briefly had control of the plot. Then when you return to the module, they will feel the railroading bringing them back.
If, however, you make the transition from pre-scripted module encounters to improvised encounters seamlessly, then the players will never know when they are really in control of the plot, and when they are being railroaded, and they will default to a feeling that they are always in control.